public class SpatialUtils extends Object
Modifier and Type | Method and Description |
---|---|
static org.locationtech.spatial4j.shape.Shape |
parseGeomSolrException(String geomStr,
org.locationtech.spatial4j.context.SpatialContext ctx)
Parses a 'geom' parameter (might also be used to parse shapes for indexing).
|
static org.locationtech.spatial4j.shape.Point |
parsePoint(String str,
org.locationtech.spatial4j.context.SpatialContext ctx)
Parses either "lat, lon" (spaces optional on either comma side) or "x y" style formats.
|
static org.locationtech.spatial4j.shape.Point |
parsePointSolrException(String externalVal,
org.locationtech.spatial4j.context.SpatialContext ctx)
Calls
parsePoint(String, org.locationtech.spatial4j.context.SpatialContext) and wraps
the exception with SolrException with a helpful message. |
static org.locationtech.spatial4j.shape.Rectangle |
parseRectangeSolrException(String externalVal,
org.locationtech.spatial4j.context.SpatialContext ctx)
Calls
parseRectangle(String, org.locationtech.spatial4j.context.SpatialContext) and wraps the exception with
SolrException with a helpful message. |
static org.locationtech.spatial4j.shape.Rectangle |
parseRectangle(String str,
org.locationtech.spatial4j.context.SpatialContext ctx)
Parses
str in the format of '[minPoint TO maxPoint]' where minPoint is the lower left corner
and maxPoint is the upper-right corner of the bounding box. |
public static org.locationtech.spatial4j.shape.Shape parseGeomSolrException(String geomStr, org.locationtech.spatial4j.context.SpatialContext ctx)
geomStr
can either be WKT or
a rectangle-range syntax (see parseRectangle(String, org.locationtech.spatial4j.context.SpatialContext)
.public static org.locationtech.spatial4j.shape.Point parsePoint(String str, org.locationtech.spatial4j.context.SpatialContext ctx) throws org.locationtech.spatial4j.exception.InvalidShapeException
str
- Non-null; may have leading or trailing spacesctx
- Non-nullorg.locationtech.spatial4j.exception.InvalidShapeException
- If for any reason there was a problem parsing the string or creating the point.public static org.locationtech.spatial4j.shape.Point parsePointSolrException(String externalVal, org.locationtech.spatial4j.context.SpatialContext ctx) throws SolrException
parsePoint(String, org.locationtech.spatial4j.context.SpatialContext)
and wraps
the exception with SolrException
with a helpful message.SolrException
public static org.locationtech.spatial4j.shape.Rectangle parseRectangle(String str, org.locationtech.spatial4j.context.SpatialContext ctx) throws org.locationtech.spatial4j.exception.InvalidShapeException
str
in the format of '[minPoint TO maxPoint]' where minPoint
is the lower left corner
and maxPoint is the upper-right corner of the bounding box. Both corners may optionally be wrapped with a quote
and then it's parsed via parsePoint(String, org.locationtech.spatial4j.context.SpatialContext)
.str
- Non-null; may *not* have leading or trailing spacesctx
- Non-nullorg.locationtech.spatial4j.exception.InvalidShapeException
- If for any reason there was a problem parsing the string or creating the rectangle.public static org.locationtech.spatial4j.shape.Rectangle parseRectangeSolrException(String externalVal, org.locationtech.spatial4j.context.SpatialContext ctx) throws SolrException
parseRectangle(String, org.locationtech.spatial4j.context.SpatialContext)
and wraps the exception with
SolrException
with a helpful message.SolrException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.