java.lang.Object
org.apache.lucene.spatial3d.Geo3DUtil
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final double
How many radians are in one degree -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static 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 Details
-
RADIANS_PER_DEGREE
static final double RADIANS_PER_DEGREEHow many radians are in one degree- See Also:
-
-
Constructor Details
-
Geo3DUtil
Geo3DUtil()
-
-
Method Details
-
decodeValueFloor
Returns smallest double that would encode to int x. -
decodeValueCeil
Returns largest double that would encode to int x. -
fromDegrees
static double fromDegrees(double degrees) Converts degress to radians -
fromPolygon
Convert a set of Polygon objects into a GeoPolygon.- Parameters:
polygons
- are the Polygon objects.- Returns:
- the GeoPolygon.
-
fromLargePolygon
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
Convert a Polygon object into a GeoPolygon. This method uses- Parameters:
polygon
- is the Polygon object.- Returns:
- the GeoPolygon.
-
convertToDescription
private static 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.
-