They seem to overlap in functionality, so if I only use PostGIS and Postgres SQL, do I miss anything important from JTS Topology Suite?


To expand on the answer given by tinlyx, you will not miss anything as PostGIS utilizes the GEOS library, which is a direct C++ port of JTS, for many of its spatial functions. In addition, PostGIS uses gdal under the hood and proj4, for transforming from one coordinate system to another. PostGIS also supports a raster datatype, so you can do raster/vector operations, very common in GIS, directly in SQL. There is also support for topology, growing support for 3D, Lidar point clouds, routing via pgRouting, and the list goes on... A full list of PostGIS functions should convince you fairly quickly that everything from JTS is covered.

You also gain the data management environment of Postgres, which is an extremely fully featured, MVCC, ACID compliant RMDBS, which also supports some NoSQL type features via JSONB (binary JSON) and hstore (a key/value extension), which is used by Open Street Map to store attributes.

TL;DR. No, not only will you not miss any functionality from JTS by adopting Postgres/PostGIS but you will also gain a lot of things — not least of which is the huge power that comes from being able to do advanced GIS type functionality in SQL, directly where the data resides. I say all of this as an ex Java developer, who used to use JTS extensively, but I now use Postgres/PostGIS for all my spatial work, as it scales much better.

Is there any particular JTS functionality that you are particularly concerned about -- it would make the answer more focussed, potentially.

| improve this answer | |
  • Thank you for the detailed answer. The project is just at the start so I don't have all the requirements yet. I just wanted to make sure we save the location data (GEOJson, generated from Leaflet GUI) in the right format for now and can work out the processing part later. – dnang Nov 1 '17 at 14:25
  • Now that PostGIS seems a much better choice, I will just look for a good Java library that can at least do some conversion and insert into the DB. Hibernate Spatial (newest version) looks very strong, if you have other suggestions please let me know. – dnang Nov 1 '17 at 14:25
  • 1
    @dnang, yes, as far as I know Hibernate Spatial is very good. I don't really do much dev work these days, I'm more of a data scientist/engineer, so maybe you should ask another question for views on ORBs :-). You will love Postgres/Postgis, though. Very impressive community, very stable, very powerful. – John Powell Nov 1 '17 at 15:57
  • Okay thank you! – dnang Nov 2 '17 at 6:28
  • Have a look at H2GIS h2gis.org as well. – user30184 Nov 3 '17 at 6:11

I don't think you need JTS per se. PostGIS uses GEOS, a C++ port of the Java library JTS.

| improve this answer | |

No ...no need unless u want to do some thing in Java...Postgis itself has overlap functionality..

| improve this answer | |
  • 1
    This is not a particularly imformative answer. It adds nothign to what @tinlyx has already stated. – John Powell Nov 1 '17 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.