2008 老虎/线®来自 Census.gov 的 Shapefile ->谷歌地图

发布于 2024-08-02 23:11:02 字数 483 浏览 1 评论 0原文

如何获取 shapefile 并提取纬度/经度坐标,以便可以在 Google 地图上绘制多边形?

http://www2.census.gov/cgi-bin/shapefiles/national-files

我在这里问了这个问题:

http://groups .google.com/group/Google-Maps-API/browse_thread/thread/18763b4b0cb996c7

他们告诉我该做什么,但没有告诉我怎么做=P

谢谢!

How do I take shapefiles and extract lat/lng coords so I can plot polygons on Google Maps?

http://www2.census.gov/cgi-bin/shapefiles/national-files

I asked this question here:

http://groups.google.com/group/Google-Maps-API/browse_thread/thread/18763b4b0cb996c7

and they told me WHAT to do, but not HOW to do it =P

Thx!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

中二柚 2024-08-09 23:11:02

这取决于您需要如何实现这一目标。如果您只需要一些形状,您可以自己在这些文件中查找坐标。您可以使用这些坐标在 Google 地图中创建 GPolygon。

如果您需要大量形状 - 您需要以编程方式完成。我建议使用您最喜欢的语言来解析 XML 文件并检索每个形状的坐标。

It depends on how you need to accomplish this. If you just need a few shapes, you can look up the coordinates in those files yourself. You can use those coordinates to create a GPolygon in Google Maps.

If you need lots of shapes - you'll need to do it programmatically. I would suggest using your favorite language to parse the XML file and retrieve the coordinates for each shape.

柳若烟 2024-08-09 23:11:02

去年,当我开发屏幕保护程序来呈现总统投票数据时,我遇到了类似的问题。我真的不想花时间解析人口普查网站上的 Shapefiles 数据(规范是 这里(如果您错过了)。

不确定我是否真的在这里节省了时间,但我最终编写了一个 python 应用程序来在屏幕上渲染 50 个状态,跟踪边缘,然后以简单的文本格式存储数据。不确定我的数据对于您的应用程序来说是否足够高分辨率,但您可以在此处获取我生成的数据:

http ://www.cannonade.net/pnt.zip

注意我生成的数据不是纬度/经度,但通过一些缩放,您应该能够翻译它们。

祝你好运。

I had a similar problem last year when I was developing a screensaver to render presidential polling data. I didn't really want to invest the time to parse the Shapefiles data on the census site (The spec is here if you missed it).

Not sure if I actually saved any time here, but I ended writing a python app to render the 50 states onscreen, trace the edges and then store the data in a simple text format. Not sure if my data is high res enough for your application, but you can grab the data I generated here:

http://www.cannonade.net/pnt.zip

N.B. The data I generate are not latitude/longitudes, but with some scaling you should be able to translate them.

Good luck.

白昼 2024-08-09 23:11:02

我在 http://www.census.gov 上使用 ARC 文件时运气更好/geo/www/cob/index.html
我现在找不到该网页,但我确实找到了一个有实际代码的网页。谷歌搜索“arc to kml”之类的东西,然后从那里开始。

I had better luck using the ARC files at http://www.census.gov/geo/www/cob/index.html
I can't find the webpage right now, but I did find one that had actual code. Google something like "arc to kml" and go from there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文