Package mil.nga.sf.util
Class GeometryUtils
- java.lang.Object
-
- mil.nga.sf.util.GeometryUtils
-
public class GeometryUtils extends Object
Utilities for Geometry objects- Since:
- 1.0.3
- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description GeometryUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
bearing(Line line)
Get the bearing heading in degrees between line end points in degreesstatic double
bearing(Point point1, Point point2)
Get the bearing heading in degrees between two points in degreesstatic void
bound(Geometry geometry, GeometryEnvelope envelope)
Bound all points in the geometry to be within the geometry envelope.static void
boundWebMercator(Geometry geometry)
Bound all points in the geometry to be within Web Mercator limits.static void
boundWGS84(Geometry geometry)
Bound all points in the geometry to be within WGS84 limits.static void
boundWGS84Transformable(Geometry geometry)
Bound all points in the geometry to be within WGS84 projection transformable (degrees to meters) limits.static void
boundWGS84WithWebMercator(Geometry geometry)
Bound all points in the WGS84 geometry to be within degree Web Mercator limits.static Map<GeometryType,Map<GeometryType,?>>
childHierarchy(GeometryType geometryType)
Get the child type hierarchy of the provided geometry type.static List<GeometryType>
childTypes(GeometryType geometryType)
Get the immediate child Geometry Types of the provided geometry typestatic boolean
closedPolygon(List<Point> points)
Check if the polygon ring points are explicitly closed, where the first and last point are the samestatic boolean
closedPolygon(LineString ring)
Check if the polygon ring is explicitly closed, where the first and last point are the samestatic boolean
closedPolygon(Polygon polygon)
Check if the polygon outer ring is explicitly closed, where the first and last point are the samestatic boolean
contains(GeometryEnvelope envelope1, GeometryEnvelope envelope2)
Determine if the first envelope contains the second within the default tolerance ofGeometryConstants.DEFAULT_EQUAL_EPSILON
.static boolean
contains(GeometryEnvelope envelope, Point point)
Determine if the envelope contains the point within the default tolerance ofGeometryConstants.DEFAULT_EQUAL_EPSILON
.static List<Point>
crop(List<Point> points, GeometryEnvelope envelope)
Crop the list of consecutive points in meters by the envelope bounds in meters.static CircularString
crop(CircularString circularString, GeometryEnvelope envelope)
Crop the circular string in meters by the envelope bounds in meters.static CompoundCurve
crop(CompoundCurve compoundCurve, GeometryEnvelope envelope)
Crop the compound curve in meters by the envelope bounds in meters.static CurvePolygon<Curve>
crop(CurvePolygon<Curve> curvePolygon, GeometryEnvelope envelope)
Crop the curve polygon in meters by the envelope bounds in meters.static Geometry
crop(Geometry geometry, GeometryEnvelope envelope)
Crop the geometry in meters by the envelope bounds in meters.static Line
crop(Line line, GeometryEnvelope envelope)
Crop the line in meters by the envelope bounds in meters.static LineString
crop(LineString lineString, GeometryEnvelope envelope)
Crop the line string in meters by the envelope bounds in meters.static MultiLineString
crop(MultiLineString multiLineString, GeometryEnvelope envelope)
Crop the multi line string in meters by the envelope bounds in meters.static MultiPoint
crop(MultiPoint multiPoint, GeometryEnvelope envelope)
Crop the multi point by the envelope bounds.static MultiPolygon
crop(MultiPolygon multiPolygon, GeometryEnvelope envelope)
Crop the multi polygon in meters by the envelope bounds in meters.static Point
crop(Point point, GeometryEnvelope envelope)
Crop the point by the envelope bounds.static Polygon
crop(Polygon polygon, GeometryEnvelope envelope)
Crop the polygon in meters by the envelope bounds in meters.static PolyhedralSurface
crop(PolyhedralSurface polyhedralSurface, GeometryEnvelope envelope)
Crop the polyhedral surface in meters by the envelope bounds in meters.static TIN
crop(TIN tin, GeometryEnvelope envelope)
Crop the TIN in meters by the envelope bounds in meters.static Triangle
crop(Triangle triangle, GeometryEnvelope envelope)
Crop the triangle in meters by the envelope bounds in meters.static Geometry
cropWebMercator(Geometry geometry)
Crop the geometry in meters by web mercator world bounds.static Point
degreesToMeters(double x, double y)
Convert a coordinate in degrees to a point in metersstatic CircularString
degreesToMeters(CircularString circularString)
Convert a circular string in degrees to a circular string in metersstatic CompoundCurve
degreesToMeters(CompoundCurve compoundCurve)
Convert a compound curve in degrees to a compound curve in metersstatic CurvePolygon<Curve>
degreesToMeters(CurvePolygon<Curve> curvePolygon)
Convert a curve polygon in degrees to a curve polygon in metersstatic Geometry
degreesToMeters(Geometry geometry)
Convert a geometry in degrees to a geometry in metersstatic Line
degreesToMeters(Line line)
Convert a line in degrees to a line in metersstatic LineString
degreesToMeters(LineString lineString)
Convert a line string in degrees to a line string in metersstatic MultiLineString
degreesToMeters(MultiLineString multiLineString)
Convert a multi line string in degrees to a multi line string in metersstatic MultiPoint
degreesToMeters(MultiPoint multiPoint)
Convert a multi point in degrees to a multi point in metersstatic MultiPolygon
degreesToMeters(MultiPolygon multiPolygon)
Convert a multi polygon in degrees to a multi polygon in metersstatic Point
degreesToMeters(Point point)
Convert a point in degrees to a point in metersstatic Polygon
degreesToMeters(Polygon polygon)
Convert a polygon in degrees to a polygon in metersstatic PolyhedralSurface
degreesToMeters(PolyhedralSurface polyhedralSurface)
Convert a polyhedral surface in degrees to a polyhedral surface in metersstatic TIN
degreesToMeters(TIN tin)
Convert a TIN in degrees to a TIN in metersstatic Triangle
degreesToMeters(Triangle triangle)
Convert a triangle in degrees to a triangle in metersstatic double
degreesToRadians(double degrees)
Convert degrees to radiansstatic Point
degreesToRadians(Point point)
Convert point in degrees to radiansstatic Geometry
deserialize(byte[] bytes)
Deserialize the bytes into a geometrystatic double
distance(Line line)
Get the Pythagorean theorem distance between the line end pointsstatic double
distance(Point point1, Point point2)
Get the Pythagorean theorem distance between two pointsstatic double
distanceHaversine(Line line)
Get the distance in meters between the end points of a line in degrees using the Haversine formulastatic double
distanceHaversine(Point point1, Point point2)
Get the distance in meters between two points in degrees using the Haversine formulastatic GeometryEnvelope
geodesicEnvelope(GeometryEnvelope envelope)
Expand the vertical bounds of a geometry envelope in degrees by including geodesic boundsstatic Point
geodesicMidpoint(Point point1, Point point2)
Get the geodesic midpoint in degrees between two points in degreesstatic Point
geodesicMidpointRadians(Point point1, Point point2)
Get the geodesic midpoint in radians between two points in radiansstatic List<Point>
geodesicPath(List<Point> points, double maxDistance)
Create a geodesic path of points in degrees with a max distance between any two path pointsstatic List<Point>
geodesicPath(LineString lineString, double maxDistance)
Create a geodesic path of a line string in degrees with a max distance between any two path pointsstatic List<Point>
geodesicPath(Point point1, Point point2, double maxDistance)
Create a geodesic path between the two points in degrees with a max distance between any two path pointsstatic Point
getCentroid(Geometry geometry)
Get the centroid point of a 2 dimensional representation of the Geometry (balancing point of a 2d cutout of the geometry).static Point
getDegreesCentroid(Geometry geometry)
Get the geographic centroid point of a 2 dimensional representation of the degree unit Geometry.static int
getDimension(Geometry geometry)
Get the dimension of the Geometry, 0 for points, 1 for curves, 2 for surfaces.static <T extends Geometry>
booleanhasM(List<T> geometries)
Determine if the geometries contain a M valuestatic <T extends Geometry>
booleanhasZ(List<T> geometries)
Determine if the geometries contain a Z valuestatic Point
intersection(Line line1, Line line2)
Get the point intersection between two linesstatic Point
intersection(Point line1Point1, Point line1Point2, Point line2Point1, Point line2Point2)
Get the point intersection between end points of two linesstatic boolean
isEastBearing(double bearing)
Determine if the bearing is in any east directionstatic boolean
isEqual(Point point1, Point point2)
Determine if the points are equal within the default tolerance ofGeometryConstants.DEFAULT_EQUAL_EPSILON
.static boolean
isEqual(Point point1, Point point2, double epsilon)
Determine if the points are equal within the tolerance.static boolean
isNorthBearing(double bearing)
Determine if the bearing is in any north directionstatic boolean
isSouthBearing(double bearing)
Determine if the bearing is in any south directionstatic boolean
isWestBearing(double bearing)
Determine if the bearing is in any west directionstatic Point
metersToDegrees(double x, double y)
Convert a coordinate in meters to a point in degreesstatic CircularString
metersToDegrees(CircularString circularString)
Convert a circular string in meters to a circular string in degreesstatic CompoundCurve
metersToDegrees(CompoundCurve compoundCurve)
Convert a compound curve in meters to a compound curve in degreesstatic CurvePolygon<Curve>
metersToDegrees(CurvePolygon<Curve> curvePolygon)
Convert a curve polygon in meters to a curve polygon in degreesstatic Geometry
metersToDegrees(Geometry geometry)
Convert a geometry in meters to a geometry in degreesstatic Line
metersToDegrees(Line line)
Convert a line in meters to a line in degreesstatic LineString
metersToDegrees(LineString lineString)
Convert a line string in meters to a line string in degreesstatic MultiLineString
metersToDegrees(MultiLineString multiLineString)
Convert a multi line string in meters to a multi line string in degreesstatic MultiPoint
metersToDegrees(MultiPoint multiPoint)
Convert a multi point in meters to a multi point in degreesstatic MultiPolygon
metersToDegrees(MultiPolygon multiPolygon)
Convert a multi polygon in meters to a multi polygon in degreesstatic Point
metersToDegrees(Point point)
Convert a point in meters to a point in degreesstatic Polygon
metersToDegrees(Polygon polygon)
Convert a polygon in meters to a polygon in degreesstatic PolyhedralSurface
metersToDegrees(PolyhedralSurface polyhedralSurface)
Convert a polyhedral surface in meters to a polyhedral surface in degreesstatic TIN
metersToDegrees(TIN tin)
Convert a TIN in meters to a TIN in degreesstatic Triangle
metersToDegrees(Triangle triangle)
Convert a triangle in meters to a triangle in degreesstatic void
minimize(Geometry geometry, double maxX)
Minimize the geometry using the shortest x distance between each connected set of points.static void
minimizeGeometry(Geometry geometry, double maxX)
Minimize the geometry using the shortest x distance between each connected set of points.static void
minimizeWebMercator(Geometry geometry)
Minimize the Web Mercator geometry using the shortest x distance between each connected set of points.static void
minimizeWGS84(Geometry geometry)
Minimize the WGS84 geometry using the shortest x distance between each connected set of points.static void
normalize(Geometry geometry, double maxX)
Normalize the geometry so all points outside of the min and max value range are adjusted to fall within the range.static void
normalizeGeometry(Geometry geometry, double maxX)
Normalize the geometry so all points outside of the min and max value range are adjusted to fall within the range.static void
normalizeWebMercator(Geometry geometry)
Normalize the Web Mercator geometry using the shortest x distance between each connected set of points.static void
normalizeWGS84(Geometry geometry)
Normalize the WGS84 geometry using the shortest x distance between each connected set of points.static List<GeometryType>
parentHierarchy(GeometryType geometryType)
Get the parent type hierarchy of the provided geometry type starting with the immediate parent.static GeometryType
parentType(GeometryType geometryType)
Get the parent Geometry Type of the provided geometry typestatic double
perpendicularDistance(Point point, Point lineStart, Point lineEnd)
Calculate the perpendicular distance between the point and the line represented by the start and end points.static boolean
pointInPolygon(Point point, List<Point> points)
Check if the point is in the polygon pointsstatic boolean
pointInPolygon(Point point, List<Point> points, double epsilon)
Check if the point is in the polygon pointsstatic boolean
pointInPolygon(Point point, LineString ring)
Check if the point is in the polygon ringstatic boolean
pointInPolygon(Point point, LineString ring, double epsilon)
Check if the point is in the polygon ringstatic boolean
pointInPolygon(Point point, Polygon polygon)
Check if the point is in the polygonstatic boolean
pointInPolygon(Point point, Polygon polygon, double epsilon)
Check if the point is in the polygonstatic boolean
pointOnLine(Point point, List<Point> points)
Check if the point is on the line represented by the pointsstatic boolean
pointOnLine(Point point, List<Point> points, double epsilon)
Check if the point is on the line represented by the pointsstatic boolean
pointOnLine(Point point, LineString line)
Check if the point is on the linestatic boolean
pointOnLine(Point point, LineString line, double epsilon)
Check if the point is on the linestatic boolean
pointOnPath(Point point, Point point1, Point point2)
Check if the point is on the path between point 1 and point 2static boolean
pointOnPath(Point point, Point point1, Point point2, double epsilon)
Check if the point is on the path between point 1 and point 2static boolean
pointOnPolygonEdge(Point point, List<Point> points)
Check if the point is on the polygon ring edge pointsstatic boolean
pointOnPolygonEdge(Point point, List<Point> points, double epsilon)
Check if the point is on the polygon ring edge pointsstatic boolean
pointOnPolygonEdge(Point point, LineString ring)
Check if the point is on the polygon ring edgestatic boolean
pointOnPolygonEdge(Point point, LineString ring, double epsilon)
Check if the point is on the polygon ring edgestatic boolean
pointOnPolygonEdge(Point point, Polygon polygon)
Check if the point is on the polygon edgestatic boolean
pointOnPolygonEdge(Point point, Polygon polygon, double epsilon)
Check if the point is on the polygon edgestatic double
radiansToDegrees(double radians)
Convert radians to degreesstatic Point
radiansToDegrees(Point point)
Convert point in radians to degreesstatic byte[]
serialize(Geometry geometry)
Serialize the geometry to bytesstatic List<Point>
simplifyPoints(List<Point> points, double tolerance)
Simplify the ordered points (representing a line, polygon, etc) using the Douglas Peucker algorithm to create a similar curve with fewer points.static GeometryEnvelope
webMercatorEnvelope()
Get a Web Mercator bounded geometry envelopestatic GeometryEnvelope
wgs84Envelope()
Get a WGS84 bounded geometry envelopestatic GeometryEnvelope
wgs84EnvelopeWithWebMercator()
Get a WGS84 geometry envelope with Web Mercator boundsstatic GeometryEnvelope
wgs84TransformableEnvelope()
Get a WGS84 bounded geometry envelope used for projection transformations (degrees to meters)
-
-
-
Method Detail
-
getDimension
public static int getDimension(Geometry geometry)
Get the dimension of the Geometry, 0 for points, 1 for curves, 2 for surfaces. If a collection, the largest dimension is returned.- Parameters:
geometry
- geometry object- Returns:
- dimension (0, 1, or 2)
-
distance
public static double distance(Point point1, Point point2)
Get the Pythagorean theorem distance between two points- Parameters:
point1
- point 1point2
- point 2- Returns:
- distance
-
distance
public static double distance(Line line)
Get the Pythagorean theorem distance between the line end points- Parameters:
line
- line- Returns:
- distance
- Since:
- 2.2.0
-
distanceHaversine
public static double distanceHaversine(Point point1, Point point2)
Get the distance in meters between two points in degrees using the Haversine formula- Parameters:
point1
- point 1point2
- point 2- Returns:
- distance in meters
- Since:
- 2.2.2
-
distanceHaversine
public static double distanceHaversine(Line line)
Get the distance in meters between the end points of a line in degrees using the Haversine formula- Parameters:
line
- line- Returns:
- distance in meters
- Since:
- 2.2.2
-
bearing
public static double bearing(Point point1, Point point2)
Get the bearing heading in degrees between two points in degrees- Parameters:
point1
- point 1point2
- point 2- Returns:
- bearing angle in degrees between 0 and 360
- Since:
- 2.2.0
-
bearing
public static double bearing(Line line)
Get the bearing heading in degrees between line end points in degrees- Parameters:
line
- line- Returns:
- bearing angle in degrees between 0 inclusively and 360 exclusively
- Since:
- 2.2.0
-
isNorthBearing
public static boolean isNorthBearing(double bearing)
Determine if the bearing is in any north direction- Parameters:
bearing
- bearing angle in degrees- Returns:
- true if north bearing
- Since:
- 2.2.0
-
isEastBearing
public static boolean isEastBearing(double bearing)
Determine if the bearing is in any east direction- Parameters:
bearing
- bearing angle in degrees- Returns:
- true if east bearing
- Since:
- 2.2.0
-
isSouthBearing
public static boolean isSouthBearing(double bearing)
Determine if the bearing is in any south direction- Parameters:
bearing
- bearing angle in degrees- Returns:
- true if south bearing
- Since:
- 2.2.0
-
isWestBearing
public static boolean isWestBearing(double bearing)
Determine if the bearing is in any west direction- Parameters:
bearing
- bearing angle in degrees- Returns:
- true if west bearing
- Since:
- 2.2.0
-
geodesicMidpoint
public static Point geodesicMidpoint(Point point1, Point point2)
Get the geodesic midpoint in degrees between two points in degrees- Parameters:
point1
- point 1point2
- point 2- Returns:
- geodesic midpoint in degrees
- Since:
- 2.2.2
-
geodesicMidpointRadians
public static Point geodesicMidpointRadians(Point point1, Point point2)
Get the geodesic midpoint in radians between two points in radians- Parameters:
point1
- point 1point2
- point 2- Returns:
- geodesic midpoint in radians
- Since:
- 2.2.2
-
degreesToRadians
public static double degreesToRadians(double degrees)
Convert degrees to radians- Parameters:
degrees
- degrees- Returns:
- radians
- Since:
- 2.2.0
-
radiansToDegrees
public static double radiansToDegrees(double radians)
Convert radians to degrees- Parameters:
radians
- radians- Returns:
- degrees
- Since:
- 2.2.0
-
degreesToRadians
public static Point degreesToRadians(Point point)
Convert point in degrees to radians- Parameters:
point
- point in degrees- Returns:
- point in radians
- Since:
- 2.2.2
-
radiansToDegrees
public static Point radiansToDegrees(Point point)
Convert point in radians to degrees- Parameters:
point
- point in radians- Returns:
- point in degrees
- Since:
- 2.2.2
-
getCentroid
public static Point getCentroid(Geometry geometry)
Get the centroid point of a 2 dimensional representation of the Geometry (balancing point of a 2d cutout of the geometry). Only the x and y coordinate of the resulting point are calculated and populated. The resultingPoint.getZ()
andPoint.getM()
methods will always return null.- Parameters:
geometry
- geometry object- Returns:
- centroid point
-
getDegreesCentroid
public static Point getDegreesCentroid(Geometry geometry)
Get the geographic centroid point of a 2 dimensional representation of the degree unit Geometry. Only the x and y coordinate of the resulting point are calculated and populated. The resultingPoint.getZ()
andPoint.getM()
methods will always return null.- Parameters:
geometry
- geometry object- Returns:
- centroid point
- Since:
- 2.0.5
-
minimizeWGS84
public static void minimizeWGS84(Geometry geometry)
Minimize the WGS84 geometry using the shortest x distance between each connected set of points. Resulting x values will be in the range: -540.0 <= x <= 540.0- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
minimizeWebMercator
public static void minimizeWebMercator(Geometry geometry)
Minimize the Web Mercator geometry using the shortest x distance between each connected set of points. Resulting x values will be in the range: -60112525.028367732 <= x <= 60112525.028367732- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
minimizeGeometry
public static void minimizeGeometry(Geometry geometry, double maxX)
Minimize the geometry using the shortest x distance between each connected set of points. The resulting geometry point x values will be in the range: (3 * min value <= x <= 3 * max value Example: For WGS84 provide a max x ofGeometryConstants.WGS84_HALF_WORLD_LON_WIDTH
. Resulting x values will be in the range: -540.0 <= x <= 540.0 Example: For web mercator provide a world width ofGeometryConstants.WEB_MERCATOR_HALF_WORLD_WIDTH
. Resulting x values will be in the range: -60112525.028367732 <= x <= 60112525.028367732- Parameters:
geometry
- geometrymaxX
- max positive x value in the geometry projection
-
minimize
public static void minimize(Geometry geometry, double maxX)
Minimize the geometry using the shortest x distance between each connected set of points. The resulting geometry point x values will be in the range: (3 * min value <= x <= 3 * max value Example: For WGS84 provide a max x ofGeometryConstants.WGS84_HALF_WORLD_LON_WIDTH
. Resulting x values will be in the range: -540.0 <= x <= 540.0 Example: For web mercator provide a world width ofGeometryConstants.WEB_MERCATOR_HALF_WORLD_WIDTH
. Resulting x values will be in the range: -60112525.028367732 <= x <= 60112525.028367732- Parameters:
geometry
- geometrymaxX
- max positive x value in the geometry projection- Since:
- 2.2.0
-
normalizeWGS84
public static void normalizeWGS84(Geometry geometry)
Normalize the WGS84 geometry using the shortest x distance between each connected set of points. Resulting x values will be in the range: -180.0 <= x <= 180.0- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
normalizeWebMercator
public static void normalizeWebMercator(Geometry geometry)
Normalize the Web Mercator geometry using the shortest x distance between each connected set of points. Resulting x values will be in the range: -20037508.342789244 <= x <= 20037508.342789244- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
normalizeGeometry
public static void normalizeGeometry(Geometry geometry, double maxX)
Normalize the geometry so all points outside of the min and max value range are adjusted to fall within the range. Example: For WGS84 provide a max x ofGeometryConstants.WGS84_HALF_WORLD_LON_WIDTH
. Resulting x values will be in the range: -180.0 <= x <= 180.0 Example: For web mercator provide a world width ofGeometryConstants.WEB_MERCATOR_HALF_WORLD_WIDTH
. Resulting x values will be in the range: -20037508.342789244 <= x <= 20037508.342789244- Parameters:
geometry
- geometrymaxX
- max positive x value in the geometry projection
-
normalize
public static void normalize(Geometry geometry, double maxX)
Normalize the geometry so all points outside of the min and max value range are adjusted to fall within the range. Example: For WGS84 provide a max x ofGeometryConstants.WGS84_HALF_WORLD_LON_WIDTH
. Resulting x values will be in the range: -180.0 <= x <= 180.0 Example: For web mercator provide a world width ofGeometryConstants.WEB_MERCATOR_HALF_WORLD_WIDTH
. Resulting x values will be in the range: -20037508.342789244 <= x <= 20037508.342789244- Parameters:
geometry
- geometrymaxX
- max positive x value in the geometry projection- Since:
- 2.2.0
-
simplifyPoints
public static List<Point> simplifyPoints(List<Point> points, double tolerance)
Simplify the ordered points (representing a line, polygon, etc) using the Douglas Peucker algorithm to create a similar curve with fewer points. Points should be in a meters unit type projection. The tolerance is the minimum tolerated distance between consecutive points.- Parameters:
points
- geometry pointstolerance
- minimum tolerance in meters for consecutive points- Returns:
- simplified points
- Since:
- 1.0.4
-
geodesicPath
public static List<Point> geodesicPath(LineString lineString, double maxDistance)
Create a geodesic path of a line string in degrees with a max distance between any two path points- Parameters:
lineString
- line string in degreesmaxDistance
- max distance allowed between path points- Returns:
- geodesic path of points
- Since:
- 2.2.2
-
geodesicPath
public static List<Point> geodesicPath(List<Point> points, double maxDistance)
Create a geodesic path of points in degrees with a max distance between any two path points- Parameters:
points
- points in degreesmaxDistance
- max distance allowed between path points- Returns:
- geodesic path of points
- Since:
- 2.2.2
-
geodesicPath
public static List<Point> geodesicPath(Point point1, Point point2, double maxDistance)
Create a geodesic path between the two points in degrees with a max distance between any two path points- Parameters:
point1
- point 1point2
- point 2maxDistance
- max distance allowed between path points- Returns:
- geodesic path of points
- Since:
- 2.2.2
-
geodesicEnvelope
public static GeometryEnvelope geodesicEnvelope(GeometryEnvelope envelope)
Expand the vertical bounds of a geometry envelope in degrees by including geodesic bounds- Parameters:
envelope
- geometry envelope in degrees- Returns:
- geodesic expanded geometry envelope in degrees
- Since:
- 2.2.2
-
perpendicularDistance
public static double perpendicularDistance(Point point, Point lineStart, Point lineEnd)
Calculate the perpendicular distance between the point and the line represented by the start and end points. Points should be in a meters unit type projection.- Parameters:
point
- pointlineStart
- point representing the line startlineEnd
- point representing the line end- Returns:
- distance in meters
- Since:
- 1.0.4
-
pointInPolygon
public static boolean pointInPolygon(Point point, Polygon polygon)
Check if the point is in the polygon- Parameters:
point
- pointpolygon
- polygon- Returns:
- true if in the polygon
- Since:
- 1.0.5
-
pointInPolygon
public static boolean pointInPolygon(Point point, Polygon polygon, double epsilon)
Check if the point is in the polygon- Parameters:
point
- pointpolygon
- polygonepsilon
- epsilon line tolerance- Returns:
- true if in the polygon
- Since:
- 1.0.5
-
pointInPolygon
public static boolean pointInPolygon(Point point, LineString ring)
Check if the point is in the polygon ring- Parameters:
point
- pointring
- polygon ring- Returns:
- true if in the polygon
- Since:
- 1.0.5
-
pointInPolygon
public static boolean pointInPolygon(Point point, LineString ring, double epsilon)
Check if the point is in the polygon ring- Parameters:
point
- pointring
- polygon ringepsilon
- epsilon line tolerance- Returns:
- true if in the polygon
- Since:
- 1.0.5
-
pointInPolygon
public static boolean pointInPolygon(Point point, List<Point> points)
Check if the point is in the polygon points- Parameters:
point
- pointpoints
- polygon points- Returns:
- true if in the polygon
- Since:
- 1.0.5
-
pointInPolygon
public static boolean pointInPolygon(Point point, List<Point> points, double epsilon)
Check if the point is in the polygon points- Parameters:
point
- pointpoints
- polygon pointsepsilon
- epsilon line tolerance- Returns:
- true if in the polygon
- Since:
- 1.0.5
-
pointOnPolygonEdge
public static boolean pointOnPolygonEdge(Point point, Polygon polygon)
Check if the point is on the polygon edge- Parameters:
point
- pointpolygon
- polygon- Returns:
- true if on the polygon edge
- Since:
- 1.0.5
-
pointOnPolygonEdge
public static boolean pointOnPolygonEdge(Point point, Polygon polygon, double epsilon)
Check if the point is on the polygon edge- Parameters:
point
- pointpolygon
- polygonepsilon
- epsilon line tolerance- Returns:
- true if on the polygon edge
- Since:
- 1.0.5
-
pointOnPolygonEdge
public static boolean pointOnPolygonEdge(Point point, LineString ring)
Check if the point is on the polygon ring edge- Parameters:
point
- pointring
- polygon ring- Returns:
- true if on the polygon edge
- Since:
- 1.0.5
-
pointOnPolygonEdge
public static boolean pointOnPolygonEdge(Point point, LineString ring, double epsilon)
Check if the point is on the polygon ring edge- Parameters:
point
- pointring
- polygon ringepsilon
- epsilon line tolerance- Returns:
- true if on the polygon edge
- Since:
- 1.0.5
-
pointOnPolygonEdge
public static boolean pointOnPolygonEdge(Point point, List<Point> points)
Check if the point is on the polygon ring edge points- Parameters:
point
- pointpoints
- polygon points- Returns:
- true if on the polygon edge
- Since:
- 1.0.5
-
pointOnPolygonEdge
public static boolean pointOnPolygonEdge(Point point, List<Point> points, double epsilon)
Check if the point is on the polygon ring edge points- Parameters:
point
- pointpoints
- polygon pointsepsilon
- epsilon line tolerance- Returns:
- true if on the polygon edge
- Since:
- 1.0.5
-
closedPolygon
public static boolean closedPolygon(Polygon polygon)
Check if the polygon outer ring is explicitly closed, where the first and last point are the same- Parameters:
polygon
- polygon- Returns:
- true if the first and last points are the same
- Since:
- 1.0.5
-
closedPolygon
public static boolean closedPolygon(LineString ring)
Check if the polygon ring is explicitly closed, where the first and last point are the same- Parameters:
ring
- polygon ring- Returns:
- true if the first and last points are the same
- Since:
- 1.0.5
-
closedPolygon
public static boolean closedPolygon(List<Point> points)
Check if the polygon ring points are explicitly closed, where the first and last point are the same- Parameters:
points
- polygon ring points- Returns:
- true if the first and last points are the same
- Since:
- 1.0.5
-
pointOnLine
public static boolean pointOnLine(Point point, LineString line)
Check if the point is on the line- Parameters:
point
- pointline
- line- Returns:
- true if on the line
- Since:
- 1.0.5
-
pointOnLine
public static boolean pointOnLine(Point point, LineString line, double epsilon)
Check if the point is on the line- Parameters:
point
- pointline
- lineepsilon
- epsilon line tolerance- Returns:
- true if on the line
- Since:
- 1.0.5
-
pointOnLine
public static boolean pointOnLine(Point point, List<Point> points)
Check if the point is on the line represented by the points- Parameters:
point
- pointpoints
- line points- Returns:
- true if on the line
- Since:
- 1.0.5
-
pointOnLine
public static boolean pointOnLine(Point point, List<Point> points, double epsilon)
Check if the point is on the line represented by the points- Parameters:
point
- pointpoints
- line pointsepsilon
- epsilon line tolerance- Returns:
- true if on the line
- Since:
- 1.0.5
-
pointOnPath
public static boolean pointOnPath(Point point, Point point1, Point point2)
Check if the point is on the path between point 1 and point 2- Parameters:
point
- pointpoint1
- path point 1point2
- path point 2- Returns:
- true if on the path
- Since:
- 1.0.5
-
pointOnPath
public static boolean pointOnPath(Point point, Point point1, Point point2, double epsilon)
Check if the point is on the path between point 1 and point 2- Parameters:
point
- pointpoint1
- path point 1point2
- path point 2epsilon
- epsilon line tolerance- Returns:
- true if on the path
- Since:
- 1.0.5
-
intersection
public static Point intersection(Line line1, Line line2)
Get the point intersection between two lines- Parameters:
line1
- first lineline2
- second line- Returns:
- intersection point or null if no intersection
- Since:
- 2.1.0
-
intersection
public static Point intersection(Point line1Point1, Point line1Point2, Point line2Point1, Point line2Point2)
Get the point intersection between end points of two lines- Parameters:
line1Point1
- first point of the first lineline1Point2
- second point of the first lineline2Point1
- first point of the second lineline2Point2
- second point of the second line- Returns:
- intersection point or null if no intersection
- Since:
- 2.1.0
-
degreesToMeters
public static Geometry degreesToMeters(Geometry geometry)
Convert a geometry in degrees to a geometry in meters- Parameters:
geometry
- geometry in degrees- Returns:
- geometry in meters
- Since:
- 2.2.0
-
degreesToMeters
public static Point degreesToMeters(Point point)
Convert a point in degrees to a point in meters- Parameters:
point
- point in degrees- Returns:
- point in meters
- Since:
- 2.1.0
-
degreesToMeters
public static Point degreesToMeters(double x, double y)
Convert a coordinate in degrees to a point in meters- Parameters:
x
- x value in degreesy
- y value in degrees- Returns:
- point in meters
- Since:
- 2.1.0
-
degreesToMeters
public static MultiPoint degreesToMeters(MultiPoint multiPoint)
Convert a multi point in degrees to a multi point in meters- Parameters:
multiPoint
- multi point in degrees- Returns:
- multi point in meters
- Since:
- 2.2.0
-
degreesToMeters
public static LineString degreesToMeters(LineString lineString)
Convert a line string in degrees to a line string in meters- Parameters:
lineString
- line string in degrees- Returns:
- line string in meters
- Since:
- 2.2.0
-
degreesToMeters
public static Line degreesToMeters(Line line)
Convert a line in degrees to a line in meters- Parameters:
line
- line in degrees- Returns:
- line in meters
- Since:
- 2.2.0
-
degreesToMeters
public static MultiLineString degreesToMeters(MultiLineString multiLineString)
Convert a multi line string in degrees to a multi line string in meters- Parameters:
multiLineString
- multi line string in degrees- Returns:
- multi line string in meters
- Since:
- 2.2.0
-
degreesToMeters
public static Polygon degreesToMeters(Polygon polygon)
Convert a polygon in degrees to a polygon in meters- Parameters:
polygon
- polygon in degrees- Returns:
- polygon in meters
- Since:
- 2.2.0
-
degreesToMeters
public static MultiPolygon degreesToMeters(MultiPolygon multiPolygon)
Convert a multi polygon in degrees to a multi polygon in meters- Parameters:
multiPolygon
- multi polygon in degrees- Returns:
- multi polygon in meters
- Since:
- 2.2.0
-
degreesToMeters
public static CircularString degreesToMeters(CircularString circularString)
Convert a circular string in degrees to a circular string in meters- Parameters:
circularString
- circular string in degrees- Returns:
- circular string in meters
- Since:
- 2.2.0
-
degreesToMeters
public static CompoundCurve degreesToMeters(CompoundCurve compoundCurve)
Convert a compound curve in degrees to a compound curve in meters- Parameters:
compoundCurve
- compound curve in degrees- Returns:
- compound curve in meters
- Since:
- 2.2.0
-
degreesToMeters
public static CurvePolygon<Curve> degreesToMeters(CurvePolygon<Curve> curvePolygon)
Convert a curve polygon in degrees to a curve polygon in meters- Parameters:
curvePolygon
- curve polygon in degrees- Returns:
- curve polygon in meters
- Since:
- 2.2.0
-
degreesToMeters
public static PolyhedralSurface degreesToMeters(PolyhedralSurface polyhedralSurface)
Convert a polyhedral surface in degrees to a polyhedral surface in meters- Parameters:
polyhedralSurface
- polyhedral surface in degrees- Returns:
- polyhedral surface in meters
- Since:
- 2.2.0
-
degreesToMeters
public static TIN degreesToMeters(TIN tin)
Convert a TIN in degrees to a TIN in meters- Parameters:
tin
- TIN in degrees- Returns:
- TIN in meters
- Since:
- 2.2.0
-
degreesToMeters
public static Triangle degreesToMeters(Triangle triangle)
Convert a triangle in degrees to a triangle in meters- Parameters:
triangle
- triangle in degrees- Returns:
- triangle in meters
- Since:
- 2.2.0
-
metersToDegrees
public static Geometry metersToDegrees(Geometry geometry)
Convert a geometry in meters to a geometry in degrees- Parameters:
geometry
- geometry in meters- Returns:
- geometry in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static Point metersToDegrees(Point point)
Convert a point in meters to a point in degrees- Parameters:
point
- point in meters- Returns:
- point in degrees
- Since:
- 2.1.0
-
metersToDegrees
public static Point metersToDegrees(double x, double y)
Convert a coordinate in meters to a point in degrees- Parameters:
x
- x value in metersy
- y value in meters- Returns:
- point in degrees
- Since:
- 2.1.0
-
metersToDegrees
public static MultiPoint metersToDegrees(MultiPoint multiPoint)
Convert a multi point in meters to a multi point in degrees- Parameters:
multiPoint
- multi point in meters- Returns:
- multi point in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static LineString metersToDegrees(LineString lineString)
Convert a line string in meters to a line string in degrees- Parameters:
lineString
- line string in meters- Returns:
- line string in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static Line metersToDegrees(Line line)
Convert a line in meters to a line in degrees- Parameters:
line
- line in meters- Returns:
- line in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static MultiLineString metersToDegrees(MultiLineString multiLineString)
Convert a multi line string in meters to a multi line string in degrees- Parameters:
multiLineString
- multi line string in meters- Returns:
- multi line string in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static Polygon metersToDegrees(Polygon polygon)
Convert a polygon in meters to a polygon in degrees- Parameters:
polygon
- polygon in meters- Returns:
- polygon in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static MultiPolygon metersToDegrees(MultiPolygon multiPolygon)
Convert a multi polygon in meters to a multi polygon in degrees- Parameters:
multiPolygon
- multi polygon in meters- Returns:
- multi polygon in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static CircularString metersToDegrees(CircularString circularString)
Convert a circular string in meters to a circular string in degrees- Parameters:
circularString
- circular string in meters- Returns:
- circular string in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static CompoundCurve metersToDegrees(CompoundCurve compoundCurve)
Convert a compound curve in meters to a compound curve in degrees- Parameters:
compoundCurve
- compound curve in meters- Returns:
- compound curve in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static CurvePolygon<Curve> metersToDegrees(CurvePolygon<Curve> curvePolygon)
Convert a curve polygon in meters to a curve polygon in degrees- Parameters:
curvePolygon
- curve polygon in meters- Returns:
- curve polygon in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static PolyhedralSurface metersToDegrees(PolyhedralSurface polyhedralSurface)
Convert a polyhedral surface in meters to a polyhedral surface in degrees- Parameters:
polyhedralSurface
- polyhedral surface in meters- Returns:
- polyhedral surface in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static TIN metersToDegrees(TIN tin)
Convert a TIN in meters to a TIN in degrees- Parameters:
tin
- TIN in meters- Returns:
- TIN in degrees
- Since:
- 2.2.0
-
metersToDegrees
public static Triangle metersToDegrees(Triangle triangle)
Convert a triangle in meters to a triangle in degrees- Parameters:
triangle
- triangle in meters- Returns:
- triangle in degrees
- Since:
- 2.2.0
-
wgs84Envelope
public static GeometryEnvelope wgs84Envelope()
Get a WGS84 bounded geometry envelope- Returns:
- geometry envelope
- Since:
- 2.2.0
-
wgs84TransformableEnvelope
public static GeometryEnvelope wgs84TransformableEnvelope()
Get a WGS84 bounded geometry envelope used for projection transformations (degrees to meters)- Returns:
- geometry envelope
- Since:
- 2.2.0
-
webMercatorEnvelope
public static GeometryEnvelope webMercatorEnvelope()
Get a Web Mercator bounded geometry envelope- Returns:
- geometry envelope
- Since:
- 2.2.0
-
wgs84EnvelopeWithWebMercator
public static GeometryEnvelope wgs84EnvelopeWithWebMercator()
Get a WGS84 geometry envelope with Web Mercator bounds- Returns:
- geometry envelope
- Since:
- 2.2.0
-
cropWebMercator
public static Geometry cropWebMercator(Geometry geometry)
Crop the geometry in meters by web mercator world bounds. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
geometry
- geometry in meters- Returns:
- cropped geometry in meters or null
- Since:
- 2.2.0
-
crop
public static Geometry crop(Geometry geometry, GeometryEnvelope envelope)
Crop the geometry in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
geometry
- geometry in metersenvelope
- envelope in meters- Returns:
- cropped geometry in meters or null
- Since:
- 2.2.0
-
crop
public static Point crop(Point point, GeometryEnvelope envelope)
Crop the point by the envelope bounds.- Parameters:
point
- pointenvelope
- envelope- Returns:
- cropped point or null
- Since:
- 2.2.0
-
crop
public static List<Point> crop(List<Point> points, GeometryEnvelope envelope)
Crop the list of consecutive points in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
points
- consecutive pointsenvelope
- envelope in meters- Returns:
- cropped points in meters or null
- Since:
- 2.2.0
-
crop
public static MultiPoint crop(MultiPoint multiPoint, GeometryEnvelope envelope)
Crop the multi point by the envelope bounds.- Parameters:
multiPoint
- multi pointenvelope
- envelope- Returns:
- cropped multi point or null
- Since:
- 2.2.0
-
crop
public static LineString crop(LineString lineString, GeometryEnvelope envelope)
Crop the line string in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
lineString
- line string in metersenvelope
- envelope in meters- Returns:
- cropped line string in meters or null
- Since:
- 2.2.0
-
crop
public static Line crop(Line line, GeometryEnvelope envelope)
Crop the line in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
line
- line in metersenvelope
- envelope in meters- Returns:
- cropped line in meters or null
- Since:
- 2.2.0
-
crop
public static MultiLineString crop(MultiLineString multiLineString, GeometryEnvelope envelope)
Crop the multi line string in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
multiLineString
- multi line string in metersenvelope
- envelope in meters- Returns:
- cropped multi line string in meters or null
- Since:
- 2.2.0
-
crop
public static Polygon crop(Polygon polygon, GeometryEnvelope envelope)
Crop the polygon in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
polygon
- polygon in metersenvelope
- envelope in meters- Returns:
- cropped polygon in meters or null
- Since:
- 2.2.0
-
crop
public static MultiPolygon crop(MultiPolygon multiPolygon, GeometryEnvelope envelope)
Crop the multi polygon in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
multiPolygon
- multi polygon in metersenvelope
- envelope in meters- Returns:
- cropped multi polygon in meters or null
- Since:
- 2.2.0
-
crop
public static CircularString crop(CircularString circularString, GeometryEnvelope envelope)
Crop the circular string in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
circularString
- circular string in metersenvelope
- envelope in meters- Returns:
- cropped circular string in meters or null
- Since:
- 2.2.0
-
crop
public static CompoundCurve crop(CompoundCurve compoundCurve, GeometryEnvelope envelope)
Crop the compound curve in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
compoundCurve
- compound curve in metersenvelope
- envelope in meters- Returns:
- cropped compound curve in meters or null
- Since:
- 2.2.0
-
crop
public static CurvePolygon<Curve> crop(CurvePolygon<Curve> curvePolygon, GeometryEnvelope envelope)
Crop the curve polygon in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
curvePolygon
- curve polygon in metersenvelope
- envelope in meters- Returns:
- cropped curve polygon in meters or null
- Since:
- 2.2.0
-
crop
public static PolyhedralSurface crop(PolyhedralSurface polyhedralSurface, GeometryEnvelope envelope)
Crop the polyhedral surface in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
polyhedralSurface
- polyhedral surface in metersenvelope
- envelope in meters- Returns:
- cropped polyhedral surface in meters or null
- Since:
- 2.2.0
-
crop
public static TIN crop(TIN tin, GeometryEnvelope envelope)
Crop the TIN in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
tin
- TIN in metersenvelope
- envelope in meters- Returns:
- cropped TIN in meters or null
- Since:
- 2.2.0
-
crop
public static Triangle crop(Triangle triangle, GeometryEnvelope envelope)
Crop the triangle in meters by the envelope bounds in meters. Cropping removes points outside the envelope and creates new points on the line intersections with the envelope.- Parameters:
triangle
- triangle in metersenvelope
- envelope in meters- Returns:
- cropped triangle in meters or null
- Since:
- 2.2.0
-
isEqual
public static boolean isEqual(Point point1, Point point2)
Determine if the points are equal within the default tolerance ofGeometryConstants.DEFAULT_EQUAL_EPSILON
. For exact equality, usePoint.equals(Object)
.- Parameters:
point1
- point 1point2
- point 2- Returns:
- true if equal
- Since:
- 2.2.0
-
isEqual
public static boolean isEqual(Point point1, Point point2, double epsilon)
Determine if the points are equal within the tolerance. For exact equality, usePoint.equals(Object)
.- Parameters:
point1
- point 1point2
- point 2epsilon
- epsilon equality tolerance- Returns:
- true if equal
- Since:
- 2.2.0
-
contains
public static boolean contains(GeometryEnvelope envelope, Point point)
Determine if the envelope contains the point within the default tolerance ofGeometryConstants.DEFAULT_EQUAL_EPSILON
. For exact equality, useGeometryEnvelope.contains(Point)
.- Parameters:
envelope
- envelopepoint
- point- Returns:
- true if contains
- Since:
- 2.2.0
-
contains
public static boolean contains(GeometryEnvelope envelope1, GeometryEnvelope envelope2)
Determine if the first envelope contains the second within the default tolerance ofGeometryConstants.DEFAULT_EQUAL_EPSILON
. For exact equality, useGeometryEnvelope.contains(GeometryEnvelope)
.- Parameters:
envelope1
- envelope 1envelope2
- envelope 2- Returns:
- true if contains
- Since:
- 2.2.0
-
boundWGS84
public static void boundWGS84(Geometry geometry)
Bound all points in the geometry to be within WGS84 limits. To perform a geometry crop using line intersections, seedegreesToMeters(Geometry)
andcrop(Geometry, GeometryEnvelope)
.- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
boundWGS84Transformable
public static void boundWGS84Transformable(Geometry geometry)
Bound all points in the geometry to be within WGS84 projection transformable (degrees to meters) limits. To perform a geometry crop using line intersections, seedegreesToMeters(Geometry)
andcrop(Geometry, GeometryEnvelope)
.- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
boundWebMercator
public static void boundWebMercator(Geometry geometry)
Bound all points in the geometry to be within Web Mercator limits. To perform a geometry crop using line intersections, seecropWebMercator(Geometry)
.- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
boundWGS84WithWebMercator
public static void boundWGS84WithWebMercator(Geometry geometry)
Bound all points in the WGS84 geometry to be within degree Web Mercator limits. To perform a geometry crop using line intersections, seedegreesToMeters(Geometry)
andcropWebMercator(Geometry)
.- Parameters:
geometry
- geometry- Since:
- 2.2.0
-
bound
public static void bound(Geometry geometry, GeometryEnvelope envelope)
Bound all points in the geometry to be within the geometry envelope. Point x and y values are bounded by the min and max envelope values. To perform a geometry crop using line intersections, seecrop(Geometry, GeometryEnvelope)
(requires geometry in meters).- Parameters:
geometry
- geometryenvelope
- geometry envelope- Since:
- 2.2.0
-
hasZ
public static <T extends Geometry> boolean hasZ(List<T> geometries)
Determine if the geometries contain a Z value- Type Parameters:
T
- geometry type- Parameters:
geometries
- list of geometries- Returns:
- true if has z
-
hasM
public static <T extends Geometry> boolean hasM(List<T> geometries)
Determine if the geometries contain a M value- Type Parameters:
T
- geometry type- Parameters:
geometries
- list of geometries- Returns:
- true if has m
-
parentHierarchy
public static List<GeometryType> parentHierarchy(GeometryType geometryType)
Get the parent type hierarchy of the provided geometry type starting with the immediate parent. If the argument is GEOMETRY, an empty list is returned, else the final type in the list will be GEOMETRY.- Parameters:
geometryType
- geometry type- Returns:
- list of increasing parent types
- Since:
- 2.0.1
-
parentType
public static GeometryType parentType(GeometryType geometryType)
Get the parent Geometry Type of the provided geometry type- Parameters:
geometryType
- geometry type- Returns:
- parent geometry type or null if argument is GEOMETRY (no parent type)
- Since:
- 2.0.1
-
childHierarchy
public static Map<GeometryType,Map<GeometryType,?>> childHierarchy(GeometryType geometryType)
Get the child type hierarchy of the provided geometry type.- Parameters:
geometryType
- geometry type- Returns:
- child type hierarchy, null if no children
- Since:
- 2.0.1
-
childTypes
public static List<GeometryType> childTypes(GeometryType geometryType)
Get the immediate child Geometry Types of the provided geometry type- Parameters:
geometryType
- geometry type- Returns:
- child geometry types, empty list if no child types
- Since:
- 2.0.1
-
serialize
public static byte[] serialize(Geometry geometry)
Serialize the geometry to bytes- Parameters:
geometry
- geometry- Returns:
- serialized bytes
- Since:
- 2.0.1
-
deserialize
public static Geometry deserialize(byte[] bytes)
Deserialize the bytes into a geometry- Parameters:
bytes
- serialized bytes- Returns:
- geometry
- Since:
- 2.0.1
-
-