Rav Pawluk
Rav Pawluk

Reputation: 19

containsLocation() Polyline in Polygon

Is there a possibilty to check that Polyline is in Polygon? Or I must check each points in Polyline containsLocation in Polygon? I think about importing gpx files (my Polyline) and check what administrative area (my Polygons) contains this Polyline. I was thinking about reverse geocoding for each points in Polyline, but its impossible due to geocoding limitations. Any ideas?

Upvotes: 1

Views: 660

Answers (1)

antonio
antonio

Reputation: 18262

You have to check every point of the Polyline against your Polygon. Take into account that a Polyline can be (according to DE-9IM):

  • Within your polygon (contained) = completely contained
  • Intersect your polygon = partially contained
  • Disjoint = not contained

So, a polyline can intersect two different Polygons (your Polyline can intersect two different administrative areas)

Upvotes: 1

Related Questions