<commit_before>
Spatial4j is a general purpose spatial / geospatial "ASL":http://www.apache.org/licenses/LICENSE-2.0.html 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":https://sourceforge.net/projects/jts-topo-suite/. 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.

h3. Features

* Shape classes that are geospatially[1] 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":http://en.wikipedia.org/wiki/Well-known_text
* 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":http://travis-ci.org/#!/spatial4j/spatial4j continuous integration.

fn1. 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.

h3. 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

h3. Discuss

Discuss Spatial4j on our "mailing list":http://spatial4j.16575.n6.nabble.com/.

h3. Ports

Spatial4j has been ported to .NET (C#) where it is appropriately named "Spatial4n":https://github.com/synhershko/Spatial4n

h3. History

Spatial4j began life within "Lucene Spatial Playground":http://code.google.com/p/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":https://github.com/spatial4j/lucene-spatial-extras now.<commit_msg>Updated reference to "Spatial Solr Sandbox"<commit_after>
Spatial4j is a general purpose spatial / geospatial "ASL":http://www.apache.org/licenses/LICENSE-2.0.html 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":https://sourceforge.net/projects/jts-topo-suite/. 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.

h3. Features

* Shape classes that are geospatially[1] 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":http://en.wikipedia.org/wiki/Well-known_text
* 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":http://travis-ci.org/#!/spatial4j/spatial4j continuous integration.

fn1. 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.

h3. 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

h3. Discuss

Discuss Spatial4j on our "mailing list":http://spatial4j.16575.n6.nabble.com/.

h3. Ports

Spatial4j has been ported to .NET (C#) where it is appropriately named "Spatial4n":https://github.com/synhershko/Spatial4n

h3. History

Spatial4j began life within "Lucene Spatial Playground":http://code.google.com/p/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 "Spatial Solr Sandbox":https://github.com/ryantxu/spatial-solr-sandbox now.
{'fraction_non_alphanumeric': 0.0744297719087635, 'fraction_numerical': 0.011804721888755502, 'mean_word_length': 4.772517321016166, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2678716', 'n_tokens_mistral': 1504, 'n_tokens_neox': 1408, 'n_words': 618}