org.apache.solr.util
Class SpatialUtils

java.lang.Object
  extended by org.apache.solr.util.SpatialUtils

public class SpatialUtils
extends Object

Utility methods pertaining to spatial.


Method Summary
static com.spatial4j.core.shape.Point parsePoint(String str, com.spatial4j.core.context.SpatialContext ctx)
          Parses either "lat, lon" (spaces optional on either comma side) or "x y" style formats.
static com.spatial4j.core.shape.Point parsePointSolrException(String externalVal, com.spatial4j.core.context.SpatialContext ctx)
          Calls parsePoint(String, com.spatial4j.core.context.SpatialContext) and wraps the exception with SolrException with a helpful message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parsePoint

public static com.spatial4j.core.shape.Point parsePoint(String str,
                                                        com.spatial4j.core.context.SpatialContext ctx)
                                                 throws com.spatial4j.core.exception.InvalidShapeException
Parses either "lat, lon" (spaces optional on either comma side) or "x y" style formats. Spaces can be basically anywhere. And not any whitespace, just the space char.

Parameters:
str - Non-null; may have leading or trailing spaces
ctx - Non-null
Returns:
Non-null
Throws:
com.spatial4j.core.exception.InvalidShapeException - If for any reason there was a problem parsing the string or creating the point.

parsePointSolrException

public static com.spatial4j.core.shape.Point parsePointSolrException(String externalVal,
                                                                     com.spatial4j.core.context.SpatialContext ctx)
                                                              throws SolrException
Calls parsePoint(String, com.spatial4j.core.context.SpatialContext) and wraps the exception with SolrException with a helpful message.

Throws:
SolrException


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.