JTS Topology Suite
JTS Topology Suite (also called Java Topology Suite) is an open-source Java software library that provides an object model for Euclidean planar linear geometry, along with a set of basic geometric functions. It is mainly meant to be a core part of vector-based geomatics software, such as geographical information systems. It can also be used as a general-purpose library with algorithms in computational geometry.
JTS follows the geometry model and interface defined by the OpenGIS Consortium in its Simple Features Specification for SQL. This gives it a standards-compliant geometry system for building spatial applications, such as viewers, spatial query processors, and tools for validating, cleaning, and integrating data.
Besides the Java library, the foundations of JTS and some of its functions are kept in a C++ port called the GEOS software library. This port can be linked in a C-style way on all major operating systems.
Up to JTS 1.14 and the GEOS port are published under the GNU Lesser General Public License (LGPL). With the LocationTech adoption, future releases will be under the EPL/BSD licenses.
Scope
JTS can model points, linestrings, polygons, and collections of shapes. These shapes are flat, placed on a 2-dimensional plane, and their corners (vertices) may also carry a Z value. Users can set their own precision models, and the library's algorithms give robust geometric computation under all precision models. It offers many geometric functions, such as checking whether shapes are topologically valid, calculating areas and distances, and testing relationships with the Egenhofer DE-9IM model. It also includes overlay functions such as intersection, difference, union, and symmetric difference, plus buffer computation, convex hull, geometric simplification using the Douglas–Peucker algorithm, linear referencing, Delaunay triangulation, Voronoi diagram generation, smallest enclosing rectangle, and discrete Hausdorff distance.
The library also has spatial tools for working with shapes. These include a robust way to check where line segments cross, an efficient line arrangement intersection method, an efficient point in polygon check, and spatial index structures such as the quadtree and STR-tree. It provides planar graph structures and algorithms as well. JTS can read and write the WKT, WKB, and GML file formats.
History
Funding for the first work on JTS came in the Fall of 2000 from GeoConnections and the Government of British Columbia. It was based on a proposal by Mark Sondheim and David Skea. Martin Davis (software design and lead developer) and Jonathan Aquino (developer) did the work. Both were part of Vivid Solutions at that time.
Since then, Martin Davis has kept JTS going as an independent software project. Since late 2016 or early 2017, JTS has been adopted by LocationTech.
Projects using JTS
Some projects that use JTS are:
- GeoServer
- GeoTools
- OpenJUMP and forks
- uDig
- gvSIG
- Batik
- Hibernate Spatial
- Whitebox Geospatial Analysis Tools
Platforms
JTS is developed for the Java JDK 1.4 platform. It is 100% pure Java and will also run on all more recent JDKs.
JTS has been ported to the .NET Framework as the Net Topology Suite. A JTS subset has been ported to C++, with entry points declared as C interfaces, as the GEOS library.
C/C++ port: GEOS
GEOS is the C/C++ version of a part of JTS, along with some of its functions. It is a foundation part of a group of programs that run as native, compiled files on Linux, Mac, and Windows. Java code is hard to use as a library in these systems because of how Java and the Java Virtual Machine work. Linux, Microsoft Windows, and the BSD family, including Mac, can link libraries from many languages into one program, but Java does not join in this way without special methods.
GEOS is built into popular programs, and it is also provided to GDAL, a widely used engine for mapping software. Because of this, GEOS becomes a core geometry tool in even more programs. These include GDAL, QGIS, PostGIS, GeoDjango, Google Earth, GRASS, MapServer, World Wind Java, Orfeo toolbox, R, and SAGA GIS.

Quiz time!
5 questions about JTS Topology Suite
What is JTS mainly meant to be?
Keep exploring
This article is a child-friendly adaptation of the Wikipedia article on JTS Topology Suite, available under CC BY-SA 4.0.