0


On one project , I recovered all the coordinates of the polygons of different postal code. When I search a zip code, I draw the polygon using the google api.
Now I would like to know whether a given polygon is so much distance from another . Is that possible ?

By parsing all my geojson , I need to know if a random polygon is 5km from the polygon drawn .

There is computeDistanceBetween method from the geometry library...but its for two points. Is there the same for the distance between two polygons ?

Thx u for your help

Luigi13
  • 19
  • 1
  • 5
  • 1
    related question: [What is the fastest algorithm to calculate the minimum distance between two sets of points?](http://stackoverflow.com/questions/3700983/what-is-the-fastest-algorithm-to-calculate-the-minimum-distance-between-two-sets) – geocodezip Mar 11 '16 at 15:47

1 Answers1

0

Not sure if this would solve your problem but you can somehow use this library to compute distances within your polygon.

BDCCgeo.js

There is a function called bdccGeoDistanceToPolyMtrs(), you can measure the distance between a point and a polygon edge or polyline. Perhaps you can get a certain point on your first polygon and compare with with the second using this function.

Reference:

Distance from point within a polygon to polygon edge

Community
  • 1
  • 1
Jereme
  • 621
  • 6
  • 14