Hi all, are there any recommended libraries for wo...
# announcements
t
Hi all, are there any recommended libraries for working with Geo data? The features I'm looking for are representations of locations as points (lat lng), polygons, etc, determining if one is inside another, and eventually working with addresses an converting them to from those basic points. This is multi platform as well so not limited to android.
The best/most up to date one I've een is ArcGIS for java but it seems pretty comprehensive when initially i just want to determine if a point falls within an area
m
In the past I’ve used this Java lib with great satisfaction: https://locationtech.github.io/jts/, but I’m afraid it won’t be suitable for your project?
t
thansk i'll take a look this evening 🙏
f
jts is great, covering a lot of edge cases and is well tested. We use it a lot! The API is … 90ies java…
☝️ 1
😆 1
t
Brilliant!
have you been using it for compare a longitude + latitude point and against geofenched areas/a polygon?
f
yes, you are looking for
Polygon#contains(Geometry)
. Note that JTS assumes planar coordinates (hence its name topology suite) and uses
x,y
. For point-in-polygon this is fine. But you wouldn’t get anything useful as distance metrics.
t
ahh okay thats great to know
Sounds like JTS will work for us short term, but I believe we will eventually require support for more advanced geo queries
m
I guess you will, if you need advanced GIS features, as JTS is just a topology lib. Maybe you can have a look at GeoTools, which is a macro-library and includes JTS as well: https://geotools.org/
t
ahh perfect
I think JTS works for now but will also play around with geo tools
i always hate pulling in larger libraries when i only need a few features
thanks for the help stranger!
m
GeoTools is modular, so you can include just the pieces you want: https://docs.geotools.org/latest/userguide/welcome/architecture.html it’s made of various modules and plugins
you’re welcome! I just happened to use these libs at work some years ago and shared my experience
145 Views