Geospatial starts with geometry
How can open source mapping improve location technologies? In this article, Jody Garnett goes over a cornerstone of the open source geospatial toolkit, JTS 1.15. The JTS topology suite brings spatial data types, spatial relationships, and spatial operations for processing geometries to the Eclipse Foundation.
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.
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.
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 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
This post was originally published in the November 2017 issue of the Eclipse Newsletter: Location Matters
For more information and articles check out the Eclipse Newsletter.