Skip to content
JTS Topology Suite 1.14 with additional functions for GeoSpark
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Maven Central

JTSplus artifacts are hosted in Maven Central. You can add a Maven dependency with the following coordinates:

groupId: org.datasyslab
artifactId: JTSplus
version: 0.1.4


JTS Topology Suite 1.14 with additional functions for GeoSpark

  1. Spatial data partitioning: Add a function in STR-Tree and Quad-Tree to return the leaf nodes bounding envelopes as the boundaries of spatial partitions.
  2. KNN query: Add K Nearest Neighbors in STR-Tree implementation.

Version information

Version Summary
0.1.4 Minor changes: Prepare for GeoSpark Spatial Index customized serializer: (1) Add additional getter and setter for spatial index. (2) Set some index fields as "Public".
0.1.3 Geometry toString() appends UserData to Geometry WKT String. Separated by tab.
0.1.2 Bug fix: Fix inaccurate equals function. JTS doesn't consider "UserData" when checking the equality between two geometries
0.1.1 Bug fix: Fix the inaccurate STR-Tree KNN result when K is large
0.1.0 Initial release

Functions usage

Spatial partitioning

STR-Tree partitioning is as follows:

STRtree strtree = new STRtree();
strtree.insert();//Please insert spatial records

Quad-Tree partitioning is as follows:

Quadtree quadtree = new Quadtree();
quadtree.insert();//Please insert spatial records

K Nearest Neighbors (KNN) query

STRtree strtree = new STRtree();
strtree.insert();//Please insert spatial records. Make sure you insert Geometry type object (instead of Envelope or others)
strtree.kNearestNeighbors(new Envelope(-98.6361828, -95.0993852,46.88333326666667,48.392923),fact.toGeometry(new Envelope(-98.6361828, -95.0993852,46.88333326666667,48.392923)),new GeometryItemDistance(), 10);

Java API usage

Please refer to JTS plus Java API usage


Please refer to PartitioningQualityAnalysis java file for a detailed example.


Jia Yu (Email:

Mohamed Sarwat (Email:


JTSplus makes use of JTS Topology Suite Version 1.14 for some spatial computations.

Please refer JTS Topology Suite website for more details.

You can’t perform that action at this time.