public class SpatialContextFactory extends Object
SpatialContext based on configuration data. Call
makeSpatialContext(java.util.Map, ClassLoader) to construct one via String name-value
pairs. To construct one via code then create a factory instance, set the fields, then call
newSpatialContext().
The following keys are looked up in the args map:
SpatialContext.isGeo() DistanceCalculatorENVELOPE(xMin, xMax, yMax, yMin) -- see SpatialContext.getWorldBounds()SpatialContext.isNormWrapLongitude()| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
args
|
Class<? extends BinaryCodec> |
binaryCodecClass |
protected ClassLoader |
classLoader
|
DistanceCalculator |
distCalc |
boolean |
geo |
boolean |
normWrapLongitude |
Class<? extends WktShapeParser> |
wktShapeParserClass |
Rectangle |
worldBounds |
| Constructor and Description |
|---|
SpatialContextFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
init(Map<String,String> args,
ClassLoader classLoader) |
protected void |
initCalculator() |
protected void |
initField(String name)
Gets
name from args and populates a field by the same name with the value. |
protected void |
initWorldBounds() |
BinaryCodec |
makeBinaryCodec(SpatialContext ctx) |
static SpatialContext |
makeSpatialContext(Map<String,String> args,
ClassLoader classLoader)
Creates a new
SpatialContext based on configuration in
args. |
WktShapeParser |
makeWktShapeParser(SpatialContext ctx) |
SpatialContext |
newSpatialContext()
Subclasses should simply construct the instance from the initialized configuration.
|
protected ClassLoader classLoader
public boolean geo
public DistanceCalculator distCalc
public Rectangle worldBounds
public boolean normWrapLongitude
public Class<? extends WktShapeParser> wktShapeParserClass
public Class<? extends BinaryCodec> binaryCodecClass
public static SpatialContext makeSpatialContext(Map<String,String> args, ClassLoader classLoader)
SpatialContext based on configuration in
args. See the class definition for what keys are looked up
in it.
The factory class is looked up via "spatialContextFactory" in args
then falling back to a Java system property (with initial caps). If neither are specified
then SpatialContextFactory is chosen.args - Non-null map of name-value pairs.classLoader - Optional, except when a class name is provided to an
argument.protected void init(Map<String,String> args, ClassLoader classLoader)
protected void initField(String name)
name from args and populates a field by the same name with the value.protected void initCalculator()
protected void initWorldBounds()
public SpatialContext newSpatialContext()
public WktShapeParser makeWktShapeParser(SpatialContext ctx)
public BinaryCodec makeBinaryCodec(SpatialContext ctx)
Copyright © 2016 LocationTech. All rights reserved.