javascript - How to bring Google Maps polygons within a certain coordinates? -
i using google maps javascript library. have database polygons stored , bring ones fit in given coordinates.
lets standing @ lat 99.42333, long -99.169333... how can bring polygons 1km around me? huge table of polygons, testing each imposible.
i thinking of adding 2 more columns "quadrant_lat" , "quadrant_lng" , wrapping rows matching guess not right way.
any ideas? thank you
an efficient solution create geo indexes polygons in database. of modern databases come geo-indexing , querying capabilities pre-bundled or provide plugin/library this.
the geo indexes can used search polygons within x meters radius given lat-long pair. simplest of geo searches, however, can lot more advanced processing 2d/3d geo indexes. on map view/client, use google maps apis render polygons returned geo query.
if database not have geo capabilities, need write code heavy lifting yourself. solution depend on size of dataset.
what database using , how many polygons there.?
Comments
Post a Comment