public class GeometryUtils extends Object
| Constructor and Description |
|---|
GeometryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static double |
distance(Point point1,
Point point2)
Get the Pythagorean theorem distance between two points
|
static Point |
getCentroid(Geometry geometry)
Get the centroid point of the Geometry
|
static int |
getDimension(Geometry geometry)
Get the dimension of the Geometry, 0 for points, 1 for curves, 2 for
surfaces.
|
static void |
minimizeGeometry(Geometry geometry,
double maxX)
Minimize the geometry using the shortest x distance between each
connected set of points.
|
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 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 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.
|
public static int getDimension(Geometry geometry)
geometry - geometry objectpublic static double distance(Point point1, Point point2)
point1 - point 1point2 - point 2public static Point getCentroid(Geometry geometry)
geometry - geometry objectpublic static void minimizeGeometry(Geometry geometry, double maxX)
geometry - geometrymaxX - max positive x value in the geometry projectionpublic static void normalizeGeometry(Geometry geometry, double maxX)
geometry - geometrymaxX - max positive x value in the geometry projectionpublic static List<Point> simplifyPoints(List<Point> points, double tolerance)
points - geometry pointstolerance - minimum tolerance in meters for consecutive pointspublic static double perpendicularDistance(Point point, Point lineStart, Point lineEnd)
point - pointlineStart - point representing the line startlineEnd - point representing the line endCopyright © 2017 National Geospatial-Intelligence Agency. All rights reserved.