如何检查点是否在KML多边形中(GIS Shapefile) [英] How to Check if a Point is in KML Polygon (GIS Shapefile)
问题描述
我有一个从Shapefile导出的Overlay KML多边形,是否有什么方法可以找到该多边形(KML)中的某个点? 我知道当我们创建多边形槽式Google Map api之类的可能性
I have an Overlay KML Polygon exported from a Shapefile, is there any way I can find weather a point is in that polygon(KML) or not? I know this is possible when we create polygon trough Google map api like
var polygon = new google.maps.Polygon([], "#000000", 1, 1, "#336699", 0.3);
但是我们如何使用KML叠加层做到这一点?
But how we can do this with KML overlays?
推荐答案
对于KML,您有2种选择:
You have 2 options with KML:
-
使用第三方解析器,例如 geoxml3 或使用geoxml3的示例
use a third party parser like geoxml3 or geoxml-v3 to render your KML as native Google Maps API v3 polygons, then use the way you know how. example using geoxml3
将您的KML导入FusionTable,然后使用ST_INTERSECTS检查多边形与您的点周围的小圆圈的交集 shpescape.com
import your KML into a FusionTable, and use the ST_INTERSECTS to check for the intersection of your Polygon with a small circle around your point example using FusionTables. Note with FusionTables you can directly import shapefiles using shpescape.com
这篇关于如何检查点是否在KML多边形中(GIS Shapefile)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!