Package org.apache.lucene.spatial3d
Class Geo3DUtil
- java.lang.Object
-
- org.apache.lucene.spatial3d.Geo3DUtil
-
class Geo3DUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static double
RADIANS_PER_DEGREE
How many radians are in one degree
-
Constructor Summary
Constructors Constructor Description Geo3DUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.List<GeoPolygonFactory.PolygonDescription>
convertToDescription(PlanetModel planetModel, Polygon... polygons)
Convert a list of polygons to a list of polygon descriptions.(package private) static double
decodeValueCeil(int x, PlanetModel planetModel)
Returns largest double that would encode to int x.(package private) static double
decodeValueFloor(int x, PlanetModel planetModel)
Returns smallest double that would encode to int x.(package private) static GeoBBox
fromBox(PlanetModel planetModel, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)
Convert input parameters to a box.(package private) static double
fromDegrees(double degrees)
Converts degress to radians(package private) static GeoCircle
fromDistance(PlanetModel planetModel, double latitude, double longitude, double radiusMeters)
Convert input parameters to a circle.(package private) static GeoPolygon
fromLargePolygon(PlanetModel planetModel, Polygon... polygons)
Convert a Polygon object to a large GeoPolygon.(package private) static GeoPath
fromPath(PlanetModel planetModel, double[] pathLatitudes, double[] pathLongitudes, double pathWidthMeters)
Convert input parameters to a path.private static GeoPolygon
fromPolygon(PlanetModel planetModel, Polygon polygon)
Convert a Polygon object into a GeoPolygon.(package private) static GeoPolygon
fromPolygon(PlanetModel planetModel, Polygon... polygons)
Convert a set of Polygon objects into a GeoPolygon.
-
-
-
Field Detail
-
RADIANS_PER_DEGREE
static final double RADIANS_PER_DEGREE
How many radians are in one degree- See Also:
- Constant Field Values
-
-
Method Detail
-
decodeValueFloor
static double decodeValueFloor(int x, PlanetModel planetModel)
Returns smallest double that would encode to int x.
-
decodeValueCeil
static double decodeValueCeil(int x, PlanetModel planetModel)
Returns largest double that would encode to int x.
-
fromDegrees
static double fromDegrees(double degrees)
Converts degress to radians
-
fromPolygon
static GeoPolygon fromPolygon(PlanetModel planetModel, Polygon... polygons)
Convert a set of Polygon objects into a GeoPolygon.- Parameters:
polygons
- are the Polygon objects.- Returns:
- the GeoPolygon.
-
fromLargePolygon
static GeoPolygon fromLargePolygon(PlanetModel planetModel, Polygon... polygons)
Convert a Polygon object to a large GeoPolygon.- Parameters:
polygons
- is the list of polygons to convert.- Returns:
- the large GeoPolygon.
-
fromPath
static GeoPath fromPath(PlanetModel planetModel, double[] pathLatitudes, double[] pathLongitudes, double pathWidthMeters)
Convert input parameters to a path.- Parameters:
pathLatitudes
- latitude values for points of the path: must be within standard +/-90 coordinate bounds.pathLongitudes
- longitude values for points of the path: must be within standard +/-180 coordinate bounds.pathWidthMeters
- width of the path in meters.- Returns:
- the path.
-
fromDistance
static GeoCircle fromDistance(PlanetModel planetModel, double latitude, double longitude, double radiusMeters)
Convert input parameters to a circle.- Parameters:
latitude
- latitude at the center: must be within standard +/-90 coordinate bounds.longitude
- longitude at the center: must be within standard +/-180 coordinate bounds.radiusMeters
- maximum distance from the center in meters: must be non-negative and finite.- Returns:
- the circle.
-
fromBox
static GeoBBox fromBox(PlanetModel planetModel, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)
Convert input parameters to a box.- Parameters:
minLatitude
- latitude lower bound: must be within standard +/-90 coordinate bounds.maxLatitude
- latitude upper bound: must be within standard +/-90 coordinate bounds.minLongitude
- longitude lower bound: must be within standard +/-180 coordinate bounds.maxLongitude
- longitude upper bound: must be within standard +/-180 coordinate bounds.- Returns:
- the box.
-
fromPolygon
private static GeoPolygon fromPolygon(PlanetModel planetModel, Polygon polygon)
Convert a Polygon object into a GeoPolygon. This method uses- Parameters:
polygon
- is the Polygon object.- Returns:
- the GeoPolygon.
-
convertToDescription
private static java.util.List<GeoPolygonFactory.PolygonDescription> convertToDescription(PlanetModel planetModel, Polygon... polygons)
Convert a list of polygons to a list of polygon descriptions.- Parameters:
polygons
- is the list of polygons to convert.- Returns:
- the list of polygon descriptions.
-
-