/jsts

JSTS Topology Suite

Primary LanguageJavaScriptGNU Lesser General Public License v2.1LGPL-2.1

JSTS Topology Suite

Build Status

The JSTS Topology Suite is a JavaScript library of spatial predicates and functions for processing geometry conforming to the Simple Features Specification for SQL published by the Open Geospatial Consortium. JSTS Topology Suite is also a JavaScript port of the well established Java library JTS Topology Suite with a built in parser for OpenLayers geometries.

SWECO Position AB (my current employer) has gratiously provided sponsoring for this project.

The primary goal of the project is to provide OpenLayers applications with a complete library for processing and analysing simple geometries, but as of version 0.11.0 hard dependencies to OpenLayers was removed which makes it possible to use JSTS Topology Suite as a free standing geometry library.

A Google group is available for developer discussions.

Unit tests are made using the Jasmine testing framework. A port of JTS Validation Suite provides additional tests.

A "recent" trunk snapshot of API docs is available. Also available are simple example use of buffer, overlay and triangulation operations. There are also some examples of using JSTS with Node.js.

Development environment

  • Eclipse 4.3.1 (Kepler)
  • Assumes OpenLayers 2.13.1 distribution in project root from http://www.openlayers.org/
  • Assumes OS Ubuntu/Linux
  • Assumes Python and easy_install are available (for building).

Building

  • Make sure you've read the readme in the build folder.
  • sudo npm install
  • ./build.sh

Testing

Make sure you've built the project first.

  • npm test or, presuming you already have Jasmine installed:
  • jasmine JASMINE_CONFIG_PATH=test/spec/support/jasmine.json

Design changes

These are effective/potential changes from the original JTS Topology Suite:

  • Skip abstracted CoordinateSequence interface/implementation

JSTS in use

  • Viper - a game that uses quadtree index and the robust line intersection algorithm.