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

5 ビュー (過去 30 日間)
Anton Gromov
Anton Gromov 2021 年 3 月 5 日
コメント済み: Sergey Kostrukov 2021 年 11 月 14 日
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?

回答 (1 件)

darova
darova 2021 年 3 月 5 日
Can you project the point on the polygon? Then you can use only (x,y) (inpolygon) to detect if the point is inside
  2 件のコメント
Anton Gromov
Anton Gromov 2021 年 3 月 5 日
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 2021 年 11 月 14 日
It's unfortunate that Mapping Toolbox doesn't provide much beyond file reading and plotting.

サインインしてコメントする。

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by