/JTSplus

JTS Topology Suite 1.14 with additional functions for GeoSpark

Primary LanguageJavaOtherNOASSERTION

JTSplus

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

Introduction

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
...
...
...
strtree.queryBoundary();

Quad-Tree partitioning is as follows:

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

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

Example

Please refer to PartitioningQualityAnalysis java file for a detailed example.

Contact

Jia Yu (Email: jiayu2@asu.edu)

Mohamed Sarwat (Email: msarwat@asu.edu)

Acknowledgement

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

Please refer JTS Topology Suite website for more details.