moovida / dart_shp

Dart shapefile reader/writer
BSD 3-Clause "New" or "Revised" License
8 stars 8 forks source link

Does a point belong to a polygon function #4

Closed wildsurfer closed 1 year ago

wildsurfer commented 1 year ago

I’m building a Flutter app that needs to analyse location(lat, lon) and tell if this location is a water or a land. I want it to work offline that’s why I’m planning to embed a shapefile with the coastline polygons. File can be taken here: https://osmdata.openstreetmap.de/data/water-polygons.html (Simplified polygons).

Is there a method in your library that can be used to do what I want?

Thanks for your work, @moovida!

moovida commented 1 year ago

The lib makes use of the JTS project (https://github.com/moovida/dart_jts), which makes geometry objects available, that have all the necessary methods (contains, intersects, etc).