使用Google Maps API在多边形形状内查找邮政编码 [英] Find zipcodes inside polygon shape using google maps api
问题描述
我正在使用Google Map应用程序.我在GMap上绘制了一个多边形,并使其覆盖了该区域.我需要找出覆盖区域内有多少个邮政编码.如何继续使用Google Maps API?有什么建议吗?
I'm working on a google map application. I am drawing a polygon on GMap and getting the area covered by it. I need to find out how many zipcodes are there inside the covered area. How can I proceed using google maps API? Any suggestion?
推荐答案
正如大卫·斯特拉坎(David strachan)所说,您需要每个邮政编码的几何,这里是一个这样的数据库:
You'll need, as david strachan said, the geometry for each ZIP-code, here is such an database: https://www.google.com/fusiontables/DataSource?docid=1AxB511DayCdtmyBuYOIPHIe_WM9iG87Q3jKh6EQ#rows:id=1
使用支持地理空间查询的数据库,并使用 ST_CONTAINS
和 ST_ INTERSECTS
use a database that supports geospatial queries and query the database by using ST_CONTAINS
and ST_INTERSECTS
注意:链接数据库是FusionTable,它将为您提供几何图形,但是您必须将这些数据存储在另一个数据库中,因为FusionTables不支持针对空间条件的多边形
Note: The linked database is a FusionTable, it will give you the geometry, but you must store these data in another database , because FusionTables did not support Polygons for spatial conditions
这篇关于使用Google Maps API在多边形形状内查找邮政编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!