有没有可能的方法来提取谷歌地球中多边形内的坐标?
有没有办法提取谷歌地球中多边形内的坐标。例如,我有一个项目,需要使用某个区域中每 1km^2 的坐标并在 MATLAB 中使用它们。这怎么能做到呢?
is there a way to extract coordinates inside a polygon in Google Earth. For example I have a project in which I need to use the coordinates for every 1km^2 in an area and use them in MATLAB. How can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然您可以使用 Google 地球覆盖多边形和坐标网格并直观地确定答案,但 Google 地球不提供在另一个要素(多边形)内选择和导出要素(网格点)的方法。
但是,您可以通过以下方式解决该问题:
1. 将多边形要素保存为KML文件;
2. 使用 XML 阅读器以您喜欢的语言解析 KML 文件;
3. 构造一个要测试的坐标网格;
4. 使用实现点的库(例如Java中的JTS、C中的GEOS、Python中的Shapely)多边形内算法。 MATLAB 似乎提供了多边形中的点函数。
While you could use Google Earth to overlay polygons and a grid of coordinates and visually determine your answer, Google Earth does not provide a way to select and export features (grid points) within another feature (a polygon).
However, you could approach the problem by:
1. saving the polygon feature to a KML file;
2. parse the KML file using an XML reader in your favorite language;
3. construct a grid of coordinates that you want to test;
4. use a library (such as JTS in Java, GEOS in C, Shapely in Python) that implements a point-in-polygon algorithm. MATLAB appears to provide a point in polygon function.