Package org.locationtech.spatial4j.io
Class ParseUtils
- java.lang.Object
-
- org.locationtech.spatial4j.io.ParseUtils
-
@Deprecated public class ParseUtils extends Object
Deprecated.Not useful; see https://github.com/spatial4j/spatial4j/issues/19Utility methods related to parsing a series of numbers.This code came from DistanceUtils, which came from Apache Lucene, LUCENE-773, which in turn came from "LocalLucene".
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static double[]
parseLatitudeLongitude(double[] outLatLon, String latLonStr)
Deprecated.A variation ofparseLatitudeLongitude(String)
that re-uses an output array.static double[]
parseLatitudeLongitude(String latLonStr)
Deprecated.Extract (by callingparsePoint(String[], String, int)
and validate the latitude and longitude contained in the String by making sure the latitude is between 90 & -90 and longitude is between -180 and 180.static String[]
parsePoint(String[] out, String externalVal, int dimension)
Deprecated.Given a string containing dimension values encoded in it, separated by commas, return a String array of length dimension containing the values.static double[]
parsePointDouble(double[] out, String externalVal, int dimension)
Deprecated.Given a string containing dimension values encoded in it, separated by commas, return a double array of length dimension containing the values.
-
-
-
Method Detail
-
parsePoint
public static String[] parsePoint(String[] out, String externalVal, int dimension) throws InvalidShapeException
Deprecated.Given a string containing dimension values encoded in it, separated by commas, return a String array of length dimension containing the values.- Parameters:
out
- A preallocated array. Must be size dimension. If it is not it will be resized.externalVal
- The value to parsedimension
- The expected number of values for the point- Returns:
- An array of the values that make up the point (aka vector)
- Throws:
InvalidShapeException
- if the dimension specified does not match the number of values in the externalValue.
-
parsePointDouble
public static double[] parsePointDouble(double[] out, String externalVal, int dimension) throws InvalidShapeException
Deprecated.Given a string containing dimension values encoded in it, separated by commas, return a double array of length dimension containing the values.- Parameters:
out
- A preallocated array. Must be size dimension. If it is not it will be resized.externalVal
- The value to parsedimension
- The expected number of values for the point- Returns:
- An array of the values that make up the point (aka vector)
- Throws:
InvalidShapeException
- if the dimension specified does not match the number of values in the externalValue.
-
parseLatitudeLongitude
public static final double[] parseLatitudeLongitude(String latLonStr) throws InvalidShapeException
Deprecated.Extract (by callingparsePoint(String[], String, int)
and validate the latitude and longitude contained in the String by making sure the latitude is between 90 & -90 and longitude is between -180 and 180.The latitude is assumed to be the first part of the string and the longitude the second part.
- Parameters:
latLonStr
- The string to parse. Latitude is the first value, longitude is the second.- Returns:
- The lat long
- Throws:
InvalidShapeException
- if there was an error parsing
-
parseLatitudeLongitude
public static final double[] parseLatitudeLongitude(double[] outLatLon, String latLonStr) throws InvalidShapeException
Deprecated.A variation ofparseLatitudeLongitude(String)
that re-uses an output array.- Throws:
InvalidShapeException
- See Also:
parseLatitudeLongitude(String)
-
-