How to determine if a geographic point is inside a polygon?

11 Ansichten (letzte 30 Tage)
Anton Gromov
Anton Gromov am 5 Mär. 2021
Kommentiert: Sergey Kostrukov am 14 Nov. 2021
Base Matlab offers inpolygon function but it uses planar coordinates which makes it tricky to use in geographic applications. I get that I can still use it, but I will always be forced to think about things like sufficient point density along the polygon perimeter, date line crossings, poles, etc. I also can use intrplat if I need to properly increase the point density of my polygon taking great circle distances into account, but I'm wondering if there's an easier way.
Mapping toolbox while offering geopoint and geoshape objects, as well as multitude of tools for working with polygons, does not seem to provide a way to easily identify geopoints which lie inside a polygon or geoshape.
Or am I missing something?

Antworten (1)

darova
darova am 5 Mär. 2021
Can you project the point on the polygon? Then you can use only (x,y) (inpolygon) to detect if the point is inside
  2 Kommentare
Anton Gromov
Anton Gromov am 5 Mär. 2021
The problem is not that the point is not in the plane, but there is no plane at all since all the polygons are on a sphere of the Earth. And we need to deal with spherical geometry here.
Sergey Kostrukov
Sergey Kostrukov am 14 Nov. 2021
It's unfortunate that Mapping Toolbox doesn't provide much beyond file reading and plotting.

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by