public class GeometryUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GeometryUtil.RotationOrigin |
Modifier and Type | Field and Description |
---|---|
static int |
CLOCKWISE
Constant for the clockwise direction.
|
static int |
COUNTERCLOCKWISE
Constant for the counterclockwise direction.
|
static double |
DEG_TO_RAD
Constant which defines the ratio used to convert degrees into radians,
|
static int |
DEGREE
Constant for the degree unit.
|
static double |
EARTH_RADIUS
Constant which defines the earth radius in meters for the WGS84 datum used
for Longitude/Latitude projection.
|
static double |
MAX_DIST_TRESHOLD
precision used for Point-Point equality
|
static double |
RAD_TO_DEG
Constant which defines the ratio used to convert radians into degrees,
|
static int |
RADIAN
Constant for the radian unit.
|
static double |
TWO_PI
Constant which defines the value for (2 * PI).
|
Constructor and Description |
---|
GeometryUtil() |
Modifier and Type | Method and Description |
---|---|
static Geometry |
buffer(Geometry geometry,
double distance,
double angleStepUser)
Deprecated.
|
static Geometry |
buffer(Geometry geometry,
double distance,
double angleStepUser,
PrecisionModel precisionModel)
Computes the set of points whose distance to geometry is less than
distance.
|
static Geometry |
buffer(Geometry geometry,
Projection mapProjection,
double distance,
double angleStepUser,
PrecisionModel precisionModel)
Computes the set of points whose distance to geometry is less than
distance.
|
static LineString |
buildArc(Point startPoint,
Point midPoint,
Point endPoint,
Point arcCenter)
Builds a circular arc.
|
static double |
computeArea(PolygonTypeGeometry surface,
Projection mapProjection,
JMapUnit mapUnit,
Projection measurementProjection,
JMapUnit distanceUnit) |
static double |
computeDistance(Point coord1,
Point coord2,
Projection mapProjection,
JMapUnit mapUnit,
Projection measurementProjection,
JMapUnit distanceUnit)
Computes the distance between the two specified coordinates.
|
static boolean |
contains(Ellipse ellipse,
double x,
double y,
PrecisionModel precisionModel) |
static boolean |
contains(Ellipse ellipse1,
Ellipse ellipse2,
PrecisionModel precisionModel)
Tests if the first ellipse contains the second ellipse.
|
static boolean |
contains(Ellipse ellipse,
LineString line,
PrecisionModel precisionModel) |
static boolean |
contains(Ellipse ellipse,
Point coord,
PrecisionModel precisionModel) |
static boolean |
contains(Ellipse ellipse,
Polygon poly,
PrecisionModel precisionModel) |
static boolean |
contains(Ellipse ellipse,
Rectangle rect,
PrecisionModel precisionModel) |
static boolean |
contains(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
contains(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
test "contains" relationship as defined in OpenGIS : Simple Features
Specification For SQL available at www.opengis.org
|
static boolean |
contains(Line line,
Point c,
PrecisionModel precisionModel)
Tests if a line contains a point.
|
static boolean |
contains(LineString l1,
LineString l2)
Deprecated.
|
static boolean |
contains(LineString l1,
LineString l2,
PrecisionModel precisionModel)
Tests if the first linestring contains the second linestring.
|
static boolean |
contains(LineString lineString,
Point c)
Deprecated.
|
static boolean |
contains(LineString lineString,
Point coord,
PrecisionModel precisionModel)
Tests if a linestring contains a point.
|
static boolean |
contains(Point[] coords,
Point coord)
Deprecated.
|
static boolean |
contains(Point[] coords,
Point coord,
PrecisionModel precisionModel)
Verifies if a polygon contains the specified coordinates within it's closed
region.
|
static boolean |
contains(Point coord,
LineString lineString,
PrecisionModel precisionModel) |
static boolean |
contains(Point a,
Point b)
Deprecated.
|
static boolean |
contains(Point a,
Point b,
Point c)
Deprecated.
|
static boolean |
contains(Point a,
Point b,
Point c,
PrecisionModel precisionModel)
Tests if a line defined by 2 points a and b contains point c.
|
static boolean |
contains(Point a,
Point b,
PrecisionModel precisionModel)
Tests if the first point contains the second point.
|
static boolean |
contains(Point c,
Polygon poly)
Deprecated.
|
static boolean |
contains(Point c,
Polygon poly,
PrecisionModel precisionModel) |
static boolean |
contains(Polygon poly,
Ellipse ellipse,
PrecisionModel precisionModel) |
static boolean |
contains(Polygon poly,
LineString lineString,
PrecisionModel precisionModel) |
static boolean |
contains(Polygon poly,
Point c,
PrecisionModel precisionModel)
Tests whether or not the specified point in contained by the specified
polygon.
|
static boolean |
contains(Polygon poly1,
Polygon poly2)
Deprecated.
|
static boolean |
contains(Polygon poly1,
Polygon poly2,
PrecisionModel precisionModel) |
static boolean |
contains(Polygon poly,
Rectangle rect,
PrecisionModel precisionModel) |
static boolean |
contains(Rectangle rect,
Point coord,
PrecisionModel precisionModel) |
static boolean |
contains(Rectangle r1,
Rectangle r2,
PrecisionModel precisionModel)
Tests if the first rectangle contains the second rectangle.
|
static Geometry |
convexHull(Geometry geometry,
boolean oneForCollection)
Deprecated.
|
static Geometry |
convexHull(Geometry geometry,
boolean oneForCollection,
PrecisionModel precisionModel)
Computes the convexHull of a geometry
|
static Ellipse |
createCircle(Point p1,
Point p2,
Point p3)
Creates a new circle with the specified coordinates.
|
static boolean |
crosses(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
crosses(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
test "crosses" relationship as defined in OpenGIS : Simple Features
Specification For SQL available at www.opengis.org uses relate() method
|
static Geometry |
difference(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static Geometry |
difference(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
Compute the difference between two Geometries basically just calls the
correct method according to argument class
|
static Geometry |
diffSym(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static Geometry |
diffSym(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
Compute the symmetric difference between two Geometries basically just
calls the correct method according to argument class
|
static boolean |
disjoint(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
disjoint(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
test "disjoint" relationship as defined in OpenGIS : Simple Features
Specification For SQL available at www.opengis.org defined as
!intersects(geometry1,geometry2) the worst case is guaranteed n*log(n) time
cost
|
static double |
distance(double x0,
double y0,
double x1,
double y1)
This method calculates the distance between 2 coordinates.
|
static double |
distance(Ellipse ellipse1,
Ellipse ellipse2,
PrecisionModel precisionModel) |
static double |
distance(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static double |
distance(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel) |
static double |
distance(LineString ls,
Ellipse ellipse,
PrecisionModel precisionModel) |
static double |
distance(LineString l1,
LineString l2,
PrecisionModel precisionModel)
Calculates the distance between 2 LineStrings
|
static double |
distance(LineString l,
Point p,
PrecisionModel precisionModel) |
static double |
distance(LineString ls,
Polygon poly,
PrecisionModel precisionModel)
Calculates the distance between a LineString and a Polygon
|
static double |
distance(Point p,
Ellipse ellipse,
PrecisionModel precisionModel) |
static double |
distance(Point p,
LineString l,
PrecisionModel precisionModel)
Calculates the distance from a point to LineString
brute force, computes distance to each segment possible optimization : computes the square distance of each segment (without doing sqrt) |
static double |
distance(Point p0,
Point p1)
This method calculates the distance between 2 coordinates.
|
static double |
distance(Point p,
Point a,
Point b)
Deprecated.
|
static double |
distance(Point a,
Point b,
Point c,
Point d)
Deprecated.
|
static double |
distance(Point a,
Point b,
Point c,
Point d,
PrecisionModel precisionModel)
Calculates the distance between 2 segments [ab] and [cd]
|
static double |
distance(Point p,
Point a,
Point b,
PrecisionModel precisionModel)
Calculates the distance from a point to a segment defined as [ab]
|
static double |
distance(Point p0,
Point p1,
PrecisionModel precisionModel)
This method calculates the distance between 2 coordinates.
|
static double |
distance(Point p,
Polygon poly,
PrecisionModel precisionModel)
Calculates the distance from a point to polygon
|
static double |
distance(Polygon poly,
Ellipse ellipse,
PrecisionModel precisionModel) |
static double |
distance(Polygon poly,
LineString ls,
PrecisionModel precisionModel) |
static double |
distance(Polygon poly,
Point p,
PrecisionModel precisionModel) |
static double |
distance(Polygon poly1,
Polygon poly2,
PrecisionModel precisionModel)
Calculates the distance between 2 polygons
|
static double |
distance(Polygon poly,
Rectangle rect,
PrecisionModel precisionModel) |
static double |
distance(Rectangle rect,
Ellipse ellipse,
PrecisionModel precisionModel) |
static double |
distVincenty(Projection projection,
double lon1,
double lat1,
double lon2,
double lat2)
Calculates geodesic distance (in m) between two points specified by
latitude/longitude (in numeric degrees) using Vincenty inverse formula for
ellipsoids
|
static double |
distVincenty(Projection projection,
Point c1,
Point c2) |
static Point.Double[] |
ellipseToPolyline(double Cx,
double Cy,
double a,
double b,
double angle,
double startAngle,
double endAngle,
int geometryType)
This function converts an ellipse or arc to a line or polygon.
|
static Point.Double[] |
ellipseToPolyline(double Cx,
double Cy,
double a,
double b,
double angle,
double startAngle,
double endAngle,
int geometryType,
boolean ccw)
This function converts an ellipse or arc to a line or polygon.
|
static Polygon |
extractLargestPolygon(GeometryCollection collection)
Goes through the collection of geometries and finds the largest Polygon.
|
static double |
findInterpolatedPoint(LineTypeGeometry lineGeometry,
double percent,
Point resultPoint)
This method find the point being at a certain percentage of the path
between the starting point and the final point
|
static Point |
findPerpendicularPoint(Point lsp1,
Point lsp2,
Point perpPoint)
Deprecated.
|
static Point |
findPerpendicularPoint(Point lsp1,
Point lsp2,
Point perpPoint,
PrecisionModel precisionModel)
this method finds the perpendicular point on a line to a specified point
|
static double |
getAngle(double x1,
double y1,
double x2,
double y2)
Returns the angle in degrees at the point x1,y1 for a line going from x1,y1
to x2,y2
|
static double |
getAngleAtArcVertex(Point arcVertex,
Point center,
double radius)
Deprecated.
|
static double |
getAngleAtPoint(LineTypeGeometry geometry,
Point WCCoord,
Point intersectPt)
Returns the positive angle in degrees (0-360) of the line or polyline at
the intersection of a segment of the polyline and a vertical or horizontal
line passing through the specified coordinate.
|
static Point |
getArcCenter(Point startPoint,
Point midPoint,
Point endPoint)
Deprecated.
|
static Point |
getArcCenter(Point pt1,
Point pt2,
Point pt3,
PrecisionModel precisionModel)
Finds the center of a circular Arc given three points.
|
static int |
getArcDirection(Point startPoint,
Point midPoint,
Point endPoint)
Calculates the direction of an arc (Clockwise and counter-clockwise)
starting from the point of departure, passing through the middle point, and
ending at the end point
|
static int |
getPointDirection(double pointX,
double pointY,
double centerX,
double centerY)
Deprecated.
|
static Geometry |
intersection(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static Geometry |
intersection(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
Compute the intersection between two Geometries basically just calls the
correct method according to argument class
|
static Geometry |
intersectionMultiple(Geometry[] geometries)
Deprecated.
|
static Geometry |
intersectionMultiple(Geometry[] geometries,
PrecisionModel precisionModel)
Fast method to intersect many geometries
It executes a binary intersection |
static boolean |
intersects(double x1,
double y1,
double x2,
double y2,
double xA,
double yA,
double xB,
double yB)
Deprecated.
|
static boolean |
intersects(double x1,
double y1,
double x2,
double y2,
double xA,
double yA,
double xB,
double yB,
PrecisionModel precisionModel)
Tests if two line segments intersect.
|
static boolean |
intersects(Ellipse ellipse1,
Ellipse ellipse2,
PrecisionModel precisionModel) |
static boolean |
intersects(Ellipse ellipse,
LineString lineString,
PrecisionModel precisionModel) |
static boolean |
intersects(Ellipse ellipse,
Point point,
PrecisionModel precisionModel) |
static boolean |
intersects(Ellipse ellipse,
Polygon polygon,
PrecisionModel precisionModel) |
static boolean |
intersects(Ellipse ellipse,
Rectangle rect,
PrecisionModel precisionModel) |
static boolean |
intersects(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
intersects(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
test "intersects" relationship as defined in OpenGIS : Simple Features
Specification For SQL available at www.opengis.org the worst case is
guaranteed n*log(n) time cost
|
static boolean |
intersects(LineString l1,
LineString l2,
PrecisionModel precisionModel)
Tests if 2 LineStrings intersect
|
static boolean |
intersects(LineString l,
Point a,
PrecisionModel precisionModel) |
static boolean |
intersects(LineString l,
Polygon poly,
PrecisionModel precisionModel)
Tests if a LineString intersects a Polygon
|
static boolean |
intersects(Point center,
double radius,
Geometry geometry)
Deprecated.
|
static boolean |
intersects(Point center,
double radius,
Geometry geometry,
PrecisionModel precisionModel) |
static boolean |
intersects(Point center,
double radius,
LinearRing[] rings)
Deprecated.
|
static boolean |
intersects(Point center,
double radius,
LinearRing[] rings,
PrecisionModel precisionModel)
This method checks if a circle intersects a polygon
|
static boolean |
intersects(Point center,
double radius,
LineString line)
Deprecated.
|
static boolean |
intersects(Point center,
double radius,
LineString line,
PrecisionModel precisionModel)
Tests if specified circle area touches at any point the specifies polyline.
|
static boolean |
intersects(Point center,
double radius,
Rectangle rect)
Deprecated.
|
static boolean |
intersects(Point center,
double radius,
Rectangle rect,
PrecisionModel precisionModel)
This method check if a circle intersects a rectangle.
|
static boolean |
intersects(Point a,
LineString l,
PrecisionModel precisionModel) |
static boolean |
intersects(Point startPoint1,
Point endPoint1,
Point startPoint2,
Point endPoint2) |
static boolean |
intersects(Point a,
Point b,
Point c,
Point d,
Point intersectPt)
Deprecated.
|
static boolean |
intersects(Point a,
Point b,
Point c,
Point d,
PrecisionModel precisionModel,
Point intersectPt)
This method tests for an intersection between the line segments defined by
a-b and c-d.
|
static boolean |
intersects(Point a,
Point b,
PrecisionModel precisionModel) |
static boolean |
intersects(Point a,
Polygon poly,
PrecisionModel precisionModel) |
static boolean |
intersects(Polygon poly,
LineString l,
PrecisionModel precisionModel)
Tests if a polygon intersects a linestring.
|
static boolean |
intersects(Polygon poly,
Point c,
PrecisionModel precisionModel) |
static boolean |
intersects(Polygon poly1,
Polygon poly2,
PrecisionModel precisionModel)
Tests if 2 Polygons intersect
|
static boolean |
intersects(Rectangle r1,
Rectangle r2,
PrecisionModel precisionModel) |
static boolean |
intersectsArc(Ellipse ellipse,
double xA,
double yA,
double xB,
double yB)
Deprecated.
|
static boolean |
intersectsArc(Ellipse ellipse,
double xA,
double yA,
double xB,
double yB,
PrecisionModel precisionModel) |
static boolean |
intersectsOutline(Ellipse ellipse,
double xA,
double yA,
double xB,
double yB)
Deprecated.
|
static boolean |
intersectsOutline(Ellipse ellipse,
double xA,
double yA,
double xB,
double yB,
PrecisionModel precisionModel) |
static LinearRing |
inverseRingDirection(LinearRing l)
Change the orientation of a linearRing.
|
static boolean |
isPerpendicular(Point pt1,
Point pt2,
Point pt3,
PrecisionModel precisionModel)
Verify if the given points are perpendicular to x or y axis
|
static Geometry |
makeValid(Geometry geometry)
Check if the geometry is valid, if not valid try to correct it
Return the corrected (or not) geometry
|
static boolean |
overlaps(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
overlaps(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
Tests "overlaps" relationship as defined in OpenGIS : Simple Features
Specification For SQL available at www.opengis.org uses relate() method
|
static Polygon |
polygonToQuadrilateral(Polygon poly)
Generalizes a polygon so that it becomes a quadrilateral - a polygon with
four sides or edges and four vertices or corners.
|
static boolean |
relate(Geometry geometry1,
Geometry geometry2,
char[] matrix)
Deprecated.
|
static boolean |
relate(Geometry geometry1,
Geometry geometry2,
char[] matrix,
PrecisionModel precisionModel)
Tests relationship between two given geometries defined by the matrix
DE-9IM The syntax used is described in the document : OpenGIS : Simple
Features Specification For SQL available at www.opengis.org Computes the
intersection matrix elements only when it is needed, according to the
parameter matrix
|
static int |
ringDirection(LinearRing l)
The orientation of a linearRing.
|
static boolean |
spatiallyEquals(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
spatiallyEquals(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel) |
static double |
sphericalDistance(double long1,
double lati1,
double long2,
double lati2)
This method calculates the distance in meters between 2 points in longitude
and latitude.
|
static double |
sphericalDistance(Point c1,
Point c2) |
static boolean |
touches(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
touches(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
test "touches" relationship as defined in OpenGIS : Simple Features
Specification For SQL available at www.opengis.org
|
static Geometry |
union(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static Geometry |
union(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
Compute the union between two Geometries basically just calls the correct
method according to argument class
|
static Geometry |
unionMultiple(Geometry[] geometries)
Deprecated.
|
static Geometry |
unionMultiple(Geometry[] geometries,
PrecisionModel precisionModel)
Fast method to merge many geometries
It executes a binary union. |
static boolean |
within(Geometry geometry1,
Geometry geometry2)
Deprecated.
|
static boolean |
within(Geometry geometry1,
Geometry geometry2,
PrecisionModel precisionModel)
test "within" relationship as defined in OpenGIS : Simple Features
Specification For SQL available at www.opengis.org uses contains() method
|
public static final double MAX_DIST_TRESHOLD
public static final double DEG_TO_RAD
public static final double RAD_TO_DEG
public static final double EARTH_RADIUS
public static final double TWO_PI
public static final int DEGREE
public static final int RADIAN
public static final int CLOCKWISE
public static final int COUNTERCLOCKWISE
@Deprecated public static boolean contains(Point a, Point b)
contains(Point, Point, PrecisionModel)
a
- point 1.b
- point 2.public static boolean contains(Point a, Point b, PrecisionModel precisionModel)
a
- point 1.b
- point 2.precisionModel
- the precision model to use.public static boolean contains(Line line, Point c, PrecisionModel precisionModel)
line
- line.c
- point.precisionModel
- the precision model to use.@Deprecated public static boolean contains(Point a, Point b, Point c)
contains(Point, Point, Point, PrecisionModel)
a
- line start point.b
- line end point.c
- point.public static boolean contains(Point a, Point b, Point c, PrecisionModel precisionModel)
a
- line start point.b
- line end point.c
- point.@Deprecated public static boolean contains(LineString lineString, Point c)
contains(LineString, Point, PrecisionModel)
lineString
- the linestring.c
- point.public static boolean contains(LineString lineString, Point coord, PrecisionModel precisionModel)
lineString
- the linestring.coord
- the point to test.precisionModel
- the precision model to use.public static boolean contains(Point coord, LineString lineString, PrecisionModel precisionModel)
@Deprecated public static boolean contains(LineString l1, LineString l2)
l1
- the first linestring.l2
- the second linestring.public static boolean contains(LineString l1, LineString l2, PrecisionModel precisionModel)
l1
- the first linestring.l2
- the second linestring.precisionModel
- public static boolean contains(Polygon poly, LineString lineString, PrecisionModel precisionModel)
poly
- polygonlineString
- line stringpublic static boolean contains(Polygon poly, Ellipse ellipse, PrecisionModel precisionModel)
public static boolean contains(Polygon poly, Rectangle rect, PrecisionModel precisionModel)
public static boolean contains(Polygon poly, Point c, PrecisionModel precisionModel)
poly
- the polygon to use.c
- the point to test.precisionModel
- the precision model to use.public static boolean contains(Ellipse ellipse, Point coord, PrecisionModel precisionModel)
public static boolean contains(Ellipse ellipse, LineString line, PrecisionModel precisionModel)
public static boolean contains(Ellipse ellipse, Polygon poly, PrecisionModel precisionModel)
public static boolean contains(Ellipse ellipse1, Ellipse ellipse2, PrecisionModel precisionModel)
ellipse1
- the first ellipse.ellipse2
- the second ellipse.precisionModel
- public static boolean contains(Rectangle r1, Rectangle r2, PrecisionModel precisionModel)
r1
- the first rectangle.r2
- the second rectangle.precisionModel
- public static boolean contains(Rectangle rect, Point coord, PrecisionModel precisionModel)
public static boolean contains(Ellipse ellipse, Rectangle rect, PrecisionModel precisionModel)
public static boolean contains(Ellipse ellipse, double x, double y, PrecisionModel precisionModel)
public static boolean intersects(Polygon poly, Point c, PrecisionModel precisionModel)
@Deprecated public static boolean contains(Point c, Polygon poly)
c
- poly
- public static boolean contains(Point c, Polygon poly, PrecisionModel precisionModel)
@Deprecated public static boolean contains(Polygon poly1, Polygon poly2)
poly1
- poly2
- public static boolean contains(Polygon poly1, Polygon poly2, PrecisionModel precisionModel)
@Deprecated public static final boolean contains(Point[] coords, Point coord)
coords
- the array of coordinates representing the polygon's edge.coord
- the point for which we want to find out if it is contained in the
polygon.public static final boolean contains(Point[] coords, Point coord, PrecisionModel precisionModel)
coords
- the array of coordinates representing the polygon's edge.coord
- the point for which we want to find out if it is contained in the
polygon.@Deprecated public static boolean spatiallyEquals(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean spatiallyEquals(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
@Deprecated public static boolean disjoint(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean disjoint(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- precisionModel
- public static boolean intersects(Point a, Point b, PrecisionModel precisionModel)
public static boolean intersects(Point a, LineString l, PrecisionModel precisionModel)
public static boolean intersects(LineString l, Point a, PrecisionModel precisionModel)
public static boolean intersects(Rectangle r1, Rectangle r2, PrecisionModel precisionModel)
public static boolean intersects(Point a, Polygon poly, PrecisionModel precisionModel)
public static boolean intersects(LineString l1, LineString l2, PrecisionModel precisionModel)
l1
- l2
- precisionModel
- public static boolean intersects(LineString l, Polygon poly, PrecisionModel precisionModel)
l
- poly
- public static boolean intersects(Polygon poly, LineString l, PrecisionModel precisionModel)
l
- poly
- public static boolean intersects(Polygon poly1, Polygon poly2, PrecisionModel precisionModel)
poly1
- poly2
- @Deprecated public static boolean intersects(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean intersects(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- precisionModel
- @Deprecated public static boolean intersects(Point a, Point b, Point c, Point d, Point intersectPt)
intersects(Point, Point, Point, Point, PrecisionModel, Point)
public static boolean intersects(Point a, Point b, Point c, Point d, PrecisionModel precisionModel, Point intersectPt)
a
- first point of first segmentb
- second point of first segmentc
- first point of second segmentd
- second point of second segmentprecisionModel
- the precision model to use.intersectPt
- intersection point (output parameter)@Deprecated public static boolean intersects(Point center, double radius, Geometry geometry)
center
- radius
- geometry
- public static boolean intersects(Point center, double radius, Geometry geometry, PrecisionModel precisionModel)
@Deprecated public static boolean intersects(Point center, double radius, LinearRing[] rings)
center
- the K2DCoord instance that represents the center of the circleradius
- the radius of the corresponding circlepublic static boolean intersects(Point center, double radius, LinearRing[] rings, PrecisionModel precisionModel)
center
- the K2DCoord instance that represents the center of the circleradius
- the radius of the corresponding circle@Deprecated public static boolean intersects(Point center, double radius, LineString line)
center
- the center coordinate of the circleradius
- the radius of the circleline
- the polyline for which we want to test the intersectionpublic static boolean intersects(Point center, double radius, LineString line, PrecisionModel precisionModel)
center
- the center coordinate of the circleradius
- the radius of the circleline
- the polyline for which we want to test the intersection@Deprecated public static boolean intersects(Point center, double radius, Rectangle rect)
center
- the center of the circleradius
- the radius of the circlerect
- the corresponding rectanglepublic static boolean intersects(Point center, double radius, Rectangle rect, PrecisionModel precisionModel)
center
- the center of the circleradius
- the radius of the circlerect
- the corresponding rectangle@Deprecated public static boolean touches(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean touches(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- @Deprecated public static boolean crosses(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean crosses(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- @Deprecated public static boolean within(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean within(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- precisionModel
- @Deprecated public static boolean contains(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean contains(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- public static boolean intersects(Ellipse ellipse1, Ellipse ellipse2, PrecisionModel precisionModel)
public static boolean intersects(Ellipse ellipse, Polygon polygon, PrecisionModel precisionModel)
public static boolean intersects(Ellipse ellipse, LineString lineString, PrecisionModel precisionModel)
public static boolean intersects(Ellipse ellipse, Point point, PrecisionModel precisionModel)
public static boolean intersects(Ellipse ellipse, Rectangle rect, PrecisionModel precisionModel)
@Deprecated public static boolean overlaps(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static boolean overlaps(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- @Deprecated public static boolean relate(Geometry geometry1, Geometry geometry2, char[] matrix)
geometry1
- geometry2
- matrix
- public static boolean relate(Geometry geometry1, Geometry geometry2, char[] matrix, PrecisionModel precisionModel)
geometry1
- geometry2
- matrix
- @Deprecated public static Geometry buffer(Geometry geometry, double distance, double angleStepUser)
geometry
- distance
- angleStepUser
- : the step in radian to approximate circles ; if 0 then default
value is Pi*3/180 (ie 3 deg)public static Geometry buffer(Geometry geometry, double distance, double angleStepUser, PrecisionModel precisionModel)
geometry
- distance
- angleStepUser
- : the step in radian to approximate circles ; if 0 then default
value is Pi*3/180 (ie 3 deg)public static Geometry buffer(Geometry geometry, Projection mapProjection, double distance, double angleStepUser, PrecisionModel precisionModel)
geometry
- distance
- angleStepUser
- : the step in radian to approximate circles ; if 0 then default
value is Pi*3/180 (ie 3 deg)@Deprecated public static Geometry convexHull(Geometry geometry, boolean oneForCollection)
geometry
- oneForCollection
- : if geometry is a collection : if true, then one polygon is
returned, else one for each elementpublic static Geometry convexHull(Geometry geometry, boolean oneForCollection, PrecisionModel precisionModel)
geometry
- oneForCollection
- : if geometry is a collection : if true, then one polygon is
returned, else one for each element@Deprecated public static Geometry intersection(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static Geometry intersection(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- @Deprecated public static Geometry union(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static Geometry union(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- precisionModel
- @Deprecated public static Geometry unionMultiple(Geometry[] geometries)
geometries
- public static Geometry unionMultiple(Geometry[] geometries, PrecisionModel precisionModel)
geometries
- precisionModel
- @Deprecated public static Geometry intersectionMultiple(Geometry[] geometries)
geometries
- public static Geometry intersectionMultiple(Geometry[] geometries, PrecisionModel precisionModel)
geometries
- @Deprecated public static Geometry difference(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static Geometry difference(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- @Deprecated public static Geometry diffSym(Geometry geometry1, Geometry geometry2)
geometry1
- geometry2
- public static Geometry diffSym(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
geometry1
- geometry2
- public static int ringDirection(LinearRing l)
l
- public static LinearRing inverseRingDirection(LinearRing l)
l
- public static Ellipse createCircle(Point p1, Point p2, Point p3)
p1
- the first coordinate.p2
- the second coordinate.p3
- the third coordinate.public static Point.Double[] ellipseToPolyline(double Cx, double Cy, double a, double b, double angle, double startAngle, double endAngle, int geometryType)
Cx
- the center point's X coordinate.Cy
- the center point's Y coordinate.a
- the bigger axisb
- the smaller axisangle
- the inclination angle in degrees, clockwisestartAngle
- the starting angle of the sweep in degrees. Starts on right x
axis, counterclockwiseendAngle
- the ending angle of the sweep in degrees. Starts on right x axis,
counterclockwisegeometryType
- the geometry typeLayer
public static Point.Double[] ellipseToPolyline(double Cx, double Cy, double a, double b, double angle, double startAngle, double endAngle, int geometryType, boolean ccw)
Cx
- the center point's X coordinate.Cy
- the center point's Y coordinate.a
- the bigger axisb
- the smaller axisangle
- the inclination angle in degrees, clockwisestartAngle
- the starting angle of the sweep in degrees. Starts on right x
axis, counterclockwiseendAngle
- the ending angle of the sweep in degrees. Starts on right x axis,
counterclockwisegeometryType
- the geometry typeccw
- true if resulting point[] direction is counterclockwise, false if
clockwiseLayer
public static double getAngleAtPoint(LineTypeGeometry geometry, Point WCCoord, Point intersectPt)
WCCoord
- the coordinate where to find the angleintersectPt
- optional output parameter that will contain the closest
intersection point if anypublic static double getAngle(double x1, double y1, double x2, double y2)
x1
- x coordinate of Point1y1
- y coordinate of Point1x2
- x coordinate of Point2y2
- y coordinate of Point2public static double findInterpolatedPoint(LineTypeGeometry lineGeometry, double percent, Point resultPoint)
percent
- the value of the percentage expressed as a float between 0 and 1resultPoint
- the K2DCoord instance that will serve to store the result@Deprecated public static double distance(Geometry geometry1, Geometry geometry2)
public static double distance(Geometry geometry1, Geometry geometry2, PrecisionModel precisionModel)
public static double distance(Point p0, Point p1, PrecisionModel precisionModel)
p0
- the first coordinatep1
- the second coordinatepublic static double distance(Point p0, Point p1)
p0
- the first coordinatep1
- the second coordinatepublic static double distance(double x0, double y0, double x1, double y1)
x0
- the first coordinate X value.y0
- the first coordinate Y value.x1
- the second coordinate X value.y1
- the second coordinate Y value.public static double distance(Point p, Point a, Point b, PrecisionModel precisionModel)
p
- a
- b
- public static double distance(Point a, Point b, Point c, Point d, PrecisionModel precisionModel)
a
- b
- c
- d
- public static double distance(Point p, LineString l, PrecisionModel precisionModel)
p
- l
- public static double distance(LineString l, Point p, PrecisionModel precisionModel)
public static double distance(Point p, Polygon poly, PrecisionModel precisionModel)
p
- poly
- public static double distance(Point p, Ellipse ellipse, PrecisionModel precisionModel)
public static double distance(Polygon poly, Point p, PrecisionModel precisionModel)
public static double distance(Polygon poly1, Polygon poly2, PrecisionModel precisionModel)
poly1
- poly2
- public static double distance(Polygon poly, Rectangle rect, PrecisionModel precisionModel)
public static double distance(Rectangle rect, Ellipse ellipse, PrecisionModel precisionModel)
public static double distance(Polygon poly, Ellipse ellipse, PrecisionModel precisionModel)
public static double distance(LineString l1, LineString l2, PrecisionModel precisionModel)
l1
- l2
- public static double distance(LineString ls, Polygon poly, PrecisionModel precisionModel)
ls
- poly
- public static double distance(LineString ls, Ellipse ellipse, PrecisionModel precisionModel)
public static double distance(Ellipse ellipse1, Ellipse ellipse2, PrecisionModel precisionModel)
public static double distance(Polygon poly, LineString ls, PrecisionModel precisionModel)
public static double sphericalDistance(double long1, double lati1, double long2, double lati2)
long1
- the first coordinate longitude in degreeslati1
- the first coordinate latitude in degreeslong2
- the second coordinate longitude in degreeslati2
- the second coordinate latitude in degreespublic static double computeDistance(Point coord1, Point coord2, Projection mapProjection, JMapUnit mapUnit, Projection measurementProjection, JMapUnit distanceUnit)
coord1
- the first coordinate.coord2
- the second coordinate.mapProjection
- the projection of the coordinates.mapUnit
- the current map unit.measurementProjection
- the projection to use while computing the distance.distanceUnit
- the value will be returned in that unit.public static double computeArea(PolygonTypeGeometry surface, Projection mapProjection, JMapUnit mapUnit, Projection measurementProjection, JMapUnit distanceUnit)
public static double distVincenty(Projection projection, double lon1, double lat1, double lon2, double lat2)
projection
- map projectionlon1
- the first coordinate longitude in degreeslat1
- the first coordinate latitude in degreeslon2
- the second coordinate longitude in degreeslat2
- the second coordinate latitude in degreespublic static double distVincenty(Projection projection, Point c1, Point c2)
public static boolean intersects(Point startPoint1, Point endPoint1, Point startPoint2, Point endPoint2)
@Deprecated public static boolean intersects(double x1, double y1, double x2, double y2, double xA, double yA, double xB, double yB)
x1
- abscissa of the first point of the first line segmenty1
- ordinate of the first point of the first line segmentx2
- abscissa of the second point of the first line segmenty2
- ordinate of the second point of the first line segmentxA
- abscissa of the first point of the second line segmentyA
- ordinate of the first point of the second line segmentxB
- abscissa of the second point of the second line segmentyB
- ordinate of the second point of the second line segmentpublic static boolean intersects(double x1, double y1, double x2, double y2, double xA, double yA, double xB, double yB, PrecisionModel precisionModel)
x1
- abscissa of the first point of the first line segmenty1
- ordinate of the first point of the first line segmentx2
- abscissa of the second point of the first line segmenty2
- ordinate of the second point of the first line segmentxA
- abscissa of the first point of the second line segmentyA
- ordinate of the first point of the second line segmentxB
- abscissa of the second point of the second line segmentyB
- ordinate of the second point of the second line segment@Deprecated public static Point findPerpendicularPoint(Point lsp1, Point lsp2, Point perpPoint)
lsp1
- pt 1 of the linelsp2
- pt 2 of the lineperpPoint
- a pt where the perpendicular line would passpublic static Point findPerpendicularPoint(Point lsp1, Point lsp2, Point perpPoint, PrecisionModel precisionModel)
lsp1
- pt 1 of the linelsp2
- pt 2 of the lineperpPoint
- a pt where the perpendicular line would pass@Deprecated public static boolean intersectsOutline(Ellipse ellipse, double xA, double yA, double xB, double yB)
ellipse
- xA
- yA
- xB
- yB
- public static boolean intersectsOutline(Ellipse ellipse, double xA, double yA, double xB, double yB, PrecisionModel precisionModel)
@Deprecated public static boolean intersectsArc(Ellipse ellipse, double xA, double yA, double xB, double yB)
ellipse
- xA
- yA
- xB
- yB
- public static boolean intersectsArc(Ellipse ellipse, double xA, double yA, double xB, double yB, PrecisionModel precisionModel)
public static Polygon extractLargestPolygon(GeometryCollection collection)
collection
- of geometriespublic static LineString buildArc(Point startPoint, Point midPoint, Point endPoint, Point arcCenter)
startPoint
- The start point of an arcmidPoint
- The middle point of an arcendPoint
- The end point of an arcarcCenter
- The center of rotation of an arc@Deprecated public static Point getArcCenter(Point startPoint, Point midPoint, Point endPoint)
startPoint
- The start point of an arcmidPoint
- The mid-point of an arcendPoint
- The end point of an arcpublic static Point getArcCenter(Point pt1, Point pt2, Point pt3, PrecisionModel precisionModel)
pt1
- The 1st point of an arc (start)pt2
- The 2nd point of an arcpt3
- The 3rd point of an arc (end)public static boolean isPerpendicular(Point pt1, Point pt2, Point pt3, PrecisionModel precisionModel)
pt1
- first pointpt2
- second pointpt3
- third pointpublic static int getArcDirection(Point startPoint, Point midPoint, Point endPoint)
startPoint
- The start point of an arcendPoint
- The end point of an arcmidPoint
- The middle point of an arc@Deprecated public static double getAngleAtArcVertex(Point arcVertex, Point center, double radius)
getAngle(double, double, double, double)
arcVertex
- The start or the end point of an arccenter
- The center of a circle the arc is part ofradius
- The radius of a circle the arc is part of@Deprecated public static int getPointDirection(double pointX, double pointY, double centerX, double centerY)
pointX
- The point X coordinatepointY
- The point Y coordinatecenterX
- The second point X coordinatecenterY
- The second point Y coordinatepublic static Polygon polygonToQuadrilateral(Polygon poly)
poly
- The polygon to generalize