jts

Provide 2D vector geometry and topology operations for Java applications.

49|9|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/znlgis/opengis-skills --skill jts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jts
Source: https://github.com/znlgis/opengis-skills/tree/main/jts
Command: npx skills add https://github.com/znlgis/opengis-skills --skill jts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

JTS provides a reliable, high-performance Java implementation of 2D vector geometry and topology operations to eliminate brittle custom geometry code and inconsistent spatial results in GIS applications. It addresses the need for correct topological predicates, robust overlay operations, and standardized geometry I/O so developers can focus on application logic rather than numerical and topology edge cases.

Core Features & Use Cases

  • Geometry model and creation: points, line strings, polygons, multi-geometries, and geometry collections for programmatic spatial data construction.
  • Spatial predicates and topology: DE-9IM relations, contains/within/intersects/touches/crosses/overlaps, and prepared geometries for high-performance repeated queries.
  • Robust geometry operations: intersection, union, difference, symmetric difference, buffer, convex hull, centroid, and topology-preserving simplification, including OverlayNG for robust overlay results.
  • Spatial indexing and queries: STRtree and Quadtree for fast spatial searches and nearest-neighbour queries in batch and streaming scenarios.
  • Format I/O and interoperability: WKT, WKB, and GeoJSON readers/writers for database and application integration.
  • Typical use cases include geofencing and point-in-polygon checks, buffering and proximity analysis, geometry validation and repair, bulk spatial joins and overlay analysis, and conversion between geometry formats for storage or APIs.

Quick Start

Create a GeometryFactory, use a WKTReader to parse your WKT string into a Geometry, and then call spatial methods such as intersection or contains for analysis.

Frequently Asked Questions about jts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform robust spatial overlay operations like intersection and union in Java?

Robust spatial overlay operations in Java, including intersection, union, and difference, are provided through a 2D vector geometry model with OverlayNG, ensuring topology-preserving results without brittle custom code.

What is the best way to check if a point is within a polygon for geofencing in Java?

Point-in-polygon checks for geofencing in Java utilize DE-9IM spatial predicates like contains and within, with prepared geometries available to accelerate high-performance repeated spatial queries.

How do I parse and write WKT, WKB, or GeoJSON geometries in a Java application?

Parsing and writing WKT, WKB, and GeoJSON geometries in Java applications is handled by built-in format I/O readers and writers, enabling seamless database storage and API interoperability.

How can I speed up bulk spatial joins and nearest-neighbour queries in Java GIS?

Bulk spatial joins and nearest-neighbour queries in Java GIS are accelerated by STRtree and Quadtree spatial indexing structures, which facilitate fast spatial searches across streaming and batch scenarios.

Does this Java geometry library support older environments like JDK 8?

Yes, this Java geometry library supports JDK 8 and later versions, ensuring compatibility for server-side Java services and desktop tools across legacy and modern application stacks.

Why do my custom Java geometry overlay operations fail on edge cases?

Custom Java geometry overlay operations often fail on edge cases due to numerical instability, whereas using a robust topology library with OverlayNG eliminates inconsistent spatial results and handles edge cases automatically.