How do I find if a x,y point is within a given polygon?
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ranjan Sonalkar
el 12 de En. de 2015
Respondida: Kelly Kearney
el 12 de En. de 2015
Is there a function, probably in the mapping community, that I could use to find out if a location specified by (Latitude, longitude) is within a polygon defined by the (Latitude, longitude) coordinates of the corners? A general function for x,y will do just as well. My polygon is convex, which is an easier problem than a general non-convex polygon.
0 comentarios
Respuesta aceptada
Kelly Kearney
el 12 de En. de 2015
The inpolygon function is included in base Matlab. If your polygons cover a small geographic area and don't cross the poles, you can probably just call it directly. For larger polygons, you may have to preprocess the polygon coordinates (see e.g. interpm, flatearthpoly).
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Map Display en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!