elasticsearch/elasticsearch — pull request #5336 by dsmiley (2014-03-04 18:38:35+00:00)
Title: Upgrade to Spatial4j 0.4.1 and JTS 1.13

(This is a new pull request for #5286 because it needed to be re-based off master)

Fixes #5279.

The main think irking me is that ElasticSearch uses a global hard-coded instance of JtsSpatialContext.GEO as the one and only SpatialContext as a static final in ShapeBuilder.SPATIAL_CONTEXT. That wasn't what I had in mind when I (or was it Ryan or Chris, I forget) devised SpatialContext concept. If you look at JtsSpatialContextFactory (or don't even use JTS, look at SpatialContextFactory) you'll see a bunch of options that trigger various behavior. The most important one is "geo" (aka geodetic or geodesic, synonyms) which is a boolean that chooses between a latitude-longitude spherical world model or a flat plane (Euclidean geometry). It's not quite clear to me at this time how ElasticSearch users that want a flat world model and who pre-project their data are using this.

Ping @chilling