国家/州/海洋的地理区域数据
我正在开发一个应用程序,其中实体位于地球上的位置。我想要一组数据,从中可以确定某个点包含在哪些区域中。
区域可能有以下类型:
- 大陆
- 、乡村、
- 湖
- 海、
- DMZ、
- 沙漠、
- 冰架
……等等。
我设想将每个区域表示为多边形。对于任何给定的点,我会测试它是否包含在每个多边形中。非常欢迎其他想法。
我还希望找到包含部分或全部这些边界的公共领域数据集。
其中一些多边形将非常详细(可能比我需要的更详细),因此我需要有效执行这些计算的技巧。我希望简化二维多边形的方法也很有用。此类事情的最佳实践是什么?
任何人都可以推荐这些数据的任何好的资源、任何特定的编程方法或执行此类操作的现有软件库吗?
编辑
我应该指出,区域的数据集将是相当静态的,因此如果可以提高性能,预计算是一个不错的选择。
I'm developing an application where entities are located at positions on Earth. I want to have a set of data from which I can determine what region(s) a point is contained within.
Regions may be of types:
- Continent
- Country
- Lake
- Sea
- DMZ
- Desert
- Ice Shelf
...and so forth.
I'm envisioning representing each region as a polygon. For any given point, I would test to see if it is contained in each polygon. Alternative ideas are very welcome.
I am also hoping to find public domain data sets that contain some or all of these boundaries.
Some of these polygons are going to be enormously detailed (possibly more detailed than I need) and so I need tips on performing these calculations efficiently. Methods for simplifying 2D polygons would also be useful I expect. What are the best practices for these kinds of things?
Can anyone recommend any good resources of this data, any particular programming approaches or existing software libraries that do this kind of thing?
EDIT
I should point out that the data set of regions will be fairly static, so precomputation is a good option if it improves performance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Natural Earth 是一个很好的资源。
数据以 ESRI Shapefile 形式提供。存在许多 Shapefile 库。
如果您在自己的编程语言中找不到对 Shapefile 的支持,请参阅此 PDF 详细说明文件格式。
A great resource is Natural Earth.
The data is provided as ESRI Shapefiles. There are many Shapefile libraries in existence.
If you can't find support for Shapefiles in your programming languages, this PDF details the file format.
如果您在平面上,常见的算法是从您的点绘制一条随机的半直线,并检查与给定多边形的交点数量。如果是奇数,你就在里面,如果是偶数,你就在外面。您必须注意顶点和数值不准确。
现在,你在一个球体上。您可以将其投影到平面上(您使用的实际投影可能取决于多边形)并执行上述操作。
If you're on a plane, the common algorithm is to draw a random straight half line from your point and checking for the number of intersections points with the given polygon. If it is odd, you're inside, if it is even, you're outside. You have to beware of vertices and of numerical inaccuracies.
Now, you're on a sphere. You can project it on a plane (the actual projection you use can depend on the polygon) and do the above.