Geospatial starts with Geometry

Eclipse collaborative working groups explore new open source fields, helping our community build bridges to new industries. LocationTech is exploring the application of open source mapping and location technologies. These technologies are experiencing rapid growth as they are realized across our new IT landscape.

JTS Topology Suite

There are two fundamental concepts a location-based technology stack needs to provide: the shape of items in the world, and where those items are located.

The JTS Topology Suite project tackles the first issue. It is a “geometry” library written in Java. JTS is a little bit more, it is the geometry library for the open source spatial industry - with ports to JavaScript, C++ and several other widely used languages.

This project acts as cornerstone of the open source spatial community. The project has been recognized for its importance by the presentation of the OSGeo Sol Katz Award to project lead Martin Davis in 2011. Worldwide hundreds of projects use JTS, either directly in the JVM, or indirectly through JavaScript or C++ ports. At LocationTech, JTS is used by our cloud processing solutions (GeoMesa, GeoTrellis, GeoWave), distributed data control (GeoGig), and desktop applications (uDig), and the Spatial4J library.

To explain what the fuss is about, it helps to explore what goes into a “geometry library”. While many projects (including Java 2D and SWT) have a data structure for shapes, JTS functions as a topology suite implementing spatial data types, spatial relationships between geometries, and spatial operations for processing geometries.

Spatial operations including Voronoi, convex hull, buffer and simplification

The JTS Library is focused on planar linear geometry (i.e. shapes defined by straight-line segments on a flat surface). It provides an extensive framework for algorithm development and exploration. The core data structures are Point, Line and Polygon along with geometry collections. These are supplemented with indexes, edge graphs, a pluggable precision model, and perhaps most importantly point-set-theory predicates and overlays.

JTS works with standards, providing an implementation of the the industry standard “Simple Feature for SQL” geometry data structures and operations. The project also provides support for standard spatial text (WKT), binary (WKB), GeoJSON and GML formats.

A key success factor for JTS is over a decade of extensive testing. Many of the algorithms employed are intensive running into the limitations of computational stability. A battery of hundreds of tests have been built up over time. The tests ensure that robustness and stability is maintained across releases, which is essential to such a widely-used library.

One of the joys of working on a spatial library is the ability to see a picture of what you are working on. Tests are defined as XML files, captured with the visual JTS TestBuilder tool shown below.

JTS TestBuilder

JTS Topology Suite 1.15 at Eclipse Foundation

JTS is an established project, with an initial 1.0 release in 2002. This November, JTS has completed the Eclipse incubation process with the release of JTS 1.15.

Key features of the JTS 1.15 release:

  • Initial LocationTech release with focus on organization and packaging, migration from svn to git, maven build chain and breakdown into modules
  • New dual license: Eclipse Public License and Eclipse Distribution License
  • K-Nearest Neighbor search for STR-Tree
  • Improved handling of Quadtree queries
  • Intersects now supports GeometryCollection
  • JTSTestRunner command-line application

We would like to thank the the community, our mentors Gunnar Wagenknecht and Wayne Beaton, and the Eclipse Staff for their support.

The Future is Spatial

We have some great plans for the year ahead, and welcome your interest and collaboration. In the short term we are pursuing greater collaboration with the downstream JSTS (JavaScript) and GEOS (C++) teams. We are also excited to outline a JTS 2.0 focused on supporting multiple geometry interfaces, and more extensive operations infrastructure to collaborate with our fellow LocationTech Spatial4J project.

For more information visit the JTS Project Page or catch up with the recent State of JTS 2017 presentation. We look forward to doing great work in the year ahead, please join us!

Additional information:

About the Author

Jody Garnett

Jody Garnett