sterkh66 / jts-extension   0.1

GNU General Public License v3.0 only GitHub

Scala extension for Java Topology Suite (JTS)

Scala versions: 2.11

Scala spatial extension over Java Topology Suite (JTS)

Provides various spatial utils over JTS such as:

  • polygon map quad tree (trie) spatial indexing
  • improved STRTree index search with result refinement and neighboors detecting

Example: Query polygons containing point

      import com.github.sterkh66.spatial.index.quadtree.QuadTree
      import com.github.sterkh66.spatial.index.Shape
      import org.locationtech.jts.io.WKTReader

      val wkt = new WKTReader()
      val shape = Shape("s1", wkt.read("POLYGON ((3 3, 3 4, 4 4, 4 3, 3 3))"))
      val qt = new QuadTree[String]()

      qt.createIndex(List(shape), 8)
      qt.queryIndex(3.1, 3.5)
      
      Seq("s1")