GeoJson世界数据库 [英] GeoJson World Database

查看:1567
本文介绍了GeoJson世界数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,需要使用d3.js显示国家和城市的地图。

I am working on a project where it is necessary to display maps of countries and cities using d3.js.

实际上,D3支持GeoJson格式。通常,我猜GeoJson格式是从一些其他格式转换的。

Actually, D3 supports GeoJson format. Usually, I guess, GeoJson format is converted from some other format.

我发现这个GeoJson数据有些地方:

I found some places with this GeoJson data:

http://mbostock.github.com/protovis/ex/countries.js

但是,这只是一个国家列表,我正在寻找一些服务或程序,让我能够设置一个ID,获得这种格式,

But, this is only a list of countries, I am looking for some service or program that gives me the ability to set an ID, get this format, and convert it to GeoJson, or get it in GeoJson better.

谢谢!

推荐答案

这需要一个服务吗?以下是我过去使用免费/开源工具处理过的问题:

Does this need to be a service? Here's how I've approached this in the past, using free/Open Source tools:

使用 Quantum GIS 将.shp转换为.geojson(一步,在图层>另存为...下) p>

Use Quantum GIS to convert .shp to .geojson (one step, under "Layer > Save As...")

现在您已拥有高解析GeoJSON资料。 这里有一些国家

Now you have hi-res GeoJSON data. Here, have some countries.

这是一个非常大的文件,所以你会想要拆分它。但是你不需要一个服务,只是每个国家的静态文件,由ID命名。这将是很容易生成一个脚本在你的选择的实用程序(Python,Ruby,node.js)。

This is a really big file, though, so you'll want to split it up. But you don't need a service for this, just static files for each country, named by ID. This would be easy enough to produce with a script in your utility of choice (Python, Ruby, node.js).

这篇关于GeoJson世界数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆