Git Product home page Git Product logo

spatial4j's Introduction

Spatial4j is a general purpose spatial / geospatial ASL licensed open-source Java library. It’s core capabilities are 3-fold: to provide common geospatially-aware shapes, to provide distance calculations and other math, and to read and write the shapes to strings.

The most popular spatial library in Java is probably JTS. JTS is powerful but it is LGPL licensed, and it is not a geospatial library — just spatial. Surprisingly, there is no native circle shape in JTS either. Nevertheless, JTS is very powerful and Spatial4J includes integration classes for it.

Features

  • Shape classes that are geospatially1 aware
    • Shapes: Point, Rectangle, Circle, Polygon (via JTS)
    • shape intersection logic, yielding: disjoint, contains, within, intersects
    • bounding box
    • area calculation
  • Distance math
    • Spherical: Law of Cosines, Haversine, Vincenty
  • Input and Output of shapes to strings using our dialect of WKT
  • Integration with JTS to adapt its shapes to Spatial4j’s interfaces, including adding some geospatial awareness
  • No runtime dependencies unless JTS is needed

In addition, the code is well tested and it’s monitored via Travis-CI continuous integration.

1 Geospatial awareness means it is aware of the implications of the international dateline and poles. It can’t pretend the earth is flat and infinitely large.

Future Roadmap

  • Better multi-shape aggregates
  • Polygon pole wrap
  • Better and more standardized WKT support and potential use of CQL where it makes sense
  • Polygon support without JTS, maybe via java.awt.geom
  • Better support for other projections (not just WGS-84)
  • Elliptical earth model distance math

Discuss

Discuss Spatial4j on our mailing list.

Ports

Spatial4j has been ported to .NET (C#) where it is appropriately named Spatial4n

History

Spatial4j began life within Lucene Spatial Playground (LSP) and from this work a generic core spatial library emerged, independent of Lucene. The other parts of LSP were either merged into Lucene / Solr itself or were migrated to Lucene Spatial Extras now.

spatial4j's People

Contributors

chrismale avatar dsmiley avatar ryantxu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.