The Spatial4j SpatialContext
is a sort of global-ish singleton
needed by Lucene spatial.
The Spatial4j SpatialContext
is a sort of global-ish singleton
needed by Lucene spatial. It's a facade to the rest of Spatial4j, acting
as a factory for Shape
s and provides access to reading and writing
them from Strings.
Quoting from spatial4j (https://github.com/locationtech/spatial4j#getting-started)
"To get a SpatialContext (or just "context" for short), you could use a global singleton SpatialContext.GEO or JtsSpatialContext.GEO which both use geodesic surface-of-sphere calculations (when available); the JTS one principally adds Polygon support."
The Lucene spatial SpatialStrategy
encapsulates an approach to
indexing and searching shapes, and providing distance values for them.
The Lucene spatial SpatialStrategy
encapsulates an approach to
indexing and searching shapes, and providing distance values for them.
It's a simple API to unify different approaches. You might use more than
one strategy for a shape as each strategy has its strengths and weaknesses.
Note that these are initialized with a field name.