NetTopologySuite An interface for rules which determine whether node points which are in boundaries of geometry components are in the boundary of the parent geometry collection. The SFS specifies a single kind of boundary node rule, the rule. However, other kinds of Boundary Node Rules are appropriate in specific situations (for instance, linear network topology usually follows the .) Some JTS operations (such as , and ) allow the BoundaryNodeRule to be specified, and respect the supplied rule when computing the results of the operation. An example use case for a non-SFS-standard Boundary Node Rule is that of checking that a set of s have valid linear network topology, when turn-arounds are represented as closed rings. In this situation, the entry road to the turn-around is only valid when it touches the turn-around ring at the single (common) endpoint. This is equivalent to requiring the set of LineStrings to be simple under the . The SFS-standard is not sufficient to perform this test, since it states that closed rings have no boundary points. This interface and its subclasses follow the Strategy design pattern. Martin Davis Tests whether a point that lies in boundaryCount geometry component boundaries is considered to form part of the boundary of the parent geometry. boundaryCount the number of component boundaries that this point occurs in true if points in this number of boundaries lie in the parent boundary Provides access to static instances of common s. The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS). The Endpoint Boundary Node Rule. The MultiValent Endpoint Boundary Node Rule. The Monovalent Endpoint Boundary Node Rule. The Boundary Node Rule specified by the OGC Simple Features Specification, which is the same as the Mod-2 rule. A specifies that points are in the boundary of a lineal geometry iff the point lies on the boundary of an odd number of components. Under this rule s and closed s have an empty boundary. This is the rule specified by the OGC SFS, and is the default rule used in JTS. Martin Davis A which specifies that any points which are endpoints of lineal components are in the boundary of the parent geometry. This corresponds to the "intuitive" topological definition of boundary. Under this rule s have a non-empty boundary (the common endpoint of the underlying LineString). This rule is useful when dealing with linear networks. For example, it can be used to check whether linear networks are correctly noded. The usual network topology constraint is that linear segments may touch only at endpoints. In the case of a segment touching a closed segment (ring) at one point, the Mod2 rule cannot distinguish between the permitted case of touching at the node point and the invalid case of touching at some other interior (non-node) point. The EndPoint rule does distinguish between these cases, so is more appropriate for use. Martin Davis A which determines that only endpoints with valency greater than 1 are on the boundary. This corresponds to the boundary of a being all the "attached" endpoints, but not the "unattached" ones. Martin Davis A which determines that only endpoints with valency of exactly 1 are on the boundary. This corresponds to the boundary of a being all the "unattached" endpoints. Martin Davis Computes an approximate intersection of two line segments by taking the most central of the endpoints of the segments. This is effective in cases where the segments are nearly parallel and should intersect at an endpoint. It is also a reasonable strategy for cases where the endpoint of one segment lies on or almost on the interior of another one. Taking the most central endpoint ensures that the computed intersection point lies in the envelope of the segments. Also, by always returning one of the input points, this should result in reducing segment fragmentation. Intended to be used as a last resort for computing ill-conditioned intersection situations which cause other methods to fail. WARNING: in some cases this algorithm makes a poor choice of endpoint. It has been replaced by a better heuristic in . Computes an approximate intersection of two line segments by taking the most central of the endpoints of the segments. This is effective in cases where the segments are nearly parallel and should intersect at an endpoint. The 1st coordinate of the 1st line segement. The 2nd coordinate of the 1st line segemen. The 1st coordinate of the 2nd line segement. The 2nd coordinate of the 2nd line segement. Creates an instance of this class using the provided input coordinates The 1st coordinate of the 1st line segement. The 2nd coordinate of the 1st line segemen. The 1st coordinate of the 2nd line segement. The 2nd coordinate of the 2nd line segement. Determines a point closest to the given point. Gets the intersection point Computes the centroid of a of any dimension. If the geometry is nominally of higher dimension, but has lower effective dimension (i.e. contains only components having zero length or area), the centroid will be computed as for the equivalent lower-dimension geometry. If the input geometry is empty, a null Coordinate is returned.

Algorithm

Dimension 2 - the centroid ic computed as a weighted sum of the centroids of a decomposition of the area into (possibly overlapping) triangles. Holes and multipolygons are handled correctly. See http://www.faqs.org/faqs/graphics/algorithms-faq/ for further details of the basic approach. Dimension 1 - Computes the average of the midpoints of all line segments weighted by the segment length. Zero-length lines are treated as points. Dimension 0 - Compute the average coordinate over all points. Repeated points are all included in the average If the input geometries are empty, a null Coordinate is returned.
1.7
Computes the centroid point of a geometry. The geometry to use The centroid point, or null if the geometry is empty the point all triangles are based at temporary variable to hold centroid of triangle Partial area sum partial centroid sum Creates a new instance for computing the centroid of a geometry Adds a to the centroid total. >The to add. Gets the computed centroid. The computed centroid, or null if the input is empty Computes three times the centroid of the triangle p1-p2-p3. The factor of 3 is left in to permit division to be avoided until later. Returns twice the signed area of the triangle p1-p2-p3. The area is positive if the triangle is oriented CCW, and negative if CW. Adds the line segments defined by an array of coordinates to the linear centroid accumulators. An array of s Adds a point to the point centroid accumulator. A Computes the centroid of an area point. Algorithm: Based on the usual algorithm for calculating the centroid as a weighted sum of the centroids of a decomposition of the area into (possibly overlapping) triangles. The algorithm has been extended to handle holes and multi-polygons. See for further details of the basic approach. The code has also be extended to handle degenerate (zero-area) polygons. In this case, the centroid of the line segments in the polygon will be returned. Adds the area defined by a Geometry to the centroid total. If the point has no area it does not contribute to the centroid. The point to add. Adds the area defined by an array of coordinates. The array must be a ring; i.e. end with the same coordinate as it starts with. An array of Coordinates. Returns three times the centroid of the triangle p1-p2-p3. The factor of 3 is left in to permit division to be avoided until later. Returns twice the signed area of the triangle p1-p2-p3, positive if a,b,c are oriented ccw, and negative if cw. Adds the linear segments defined by an array of coordinates to the linear centroid accumulators. This is done in case the polygon(s) have zero-area, in which case the linear centroid is computed instead. an array of s Computes the centroid of a linear point. Algorithm: Compute the average of the midpoints of all line segments weighted by the segment length. Adds the linear components of by a Geometry to the centroid total. If the geometry has no linear components it does not contribute to the centroid. The point to add. Adds the length defined by an array of coordinates. An array of Coordinates. Computes the centroid of a point point. Algorithm: Compute the average of all points. Adds the point(s) defined by a Geometry to the centroid total. If the point is not of dimension 0 it does not contribute to the centroid. The point to add. Adds the length defined by a coordinate. A coordinate. Basic computational geometry algorithms for geometry and coordinates defined in 3-dimensional Cartesian space. @author mdavis Computes the distance between two 3D segments. @param A the start point of the first segment @param B the end point of the first segment @param C the start point of the second segment @param D the end point of the second segment @return the distance between the segments Implements basic computational geometry algorithms using arithmetic. Martin Davis A value which is safely greater than the relative round-off error in double-precision numbers Returns the index of the direction of the point q relative to a vector specified by p1-p2. The origin point of the vector The final point of the vector the point to compute the direction to 1 if q is counter-clockwise (left) from p1-p2 -1 if q is clockwise (right) from p1-p2 0 if q is collinear with p1-p2 Computes the sign of the determinant of the 2x2 matrix with the given entries. -1 if the determinant is negative, 1 if the determinant is positive, 0 if the determinant is 0. A filter for computing the orientation index of three coordinates. If the orientation can be computed safely using standard DP arithmetic, this routine returns the orientation index. Otherwise, a value i > 1 is returned. In this case the orientation index must be computed using some other more robust method. The filter is fast to compute, so can be used to avoid the use of slower robust methods except when they are really needed, thus providing better average performance. Uses an approach due to Jonathan Shewchuk, which is in the public domain. The orientation index if it can be computed safely > 1 if the orientation index cannot be computed safely> Computes an intersection point between two lines using DD arithmetic. Currently does not handle case of parallel lines. A point of 1st segment Another point of 1st segment A point of 2nd segment Another point of 2nd segment Specifies and implements various fundamental Computational Geometric algorithms. The algorithms supplied in this class are robust for double-precision floating point. A value that indicates an orientation of clockwise, or a right turn. A value that indicates an orientation of clockwise, or a right turn. A value that indicates an orientation of counterclockwise, or a left turn. A value that indicates an orientation of counterclockwise, or a left turn. A value that indicates an orientation of collinear, or no turn (straight). A value that indicates an orientation of collinear, or no turn (straight). Returns the index of the direction of the point q relative to a vector specified by p1-p2. The origin point of the vector. The final point of the vector. The point to compute the direction to. 1 if q is counter-clockwise (left) from p1-p2, -1 if q is clockwise (right) from p1-p2, 0 if q is collinear with p1-p2. Tests whether a point lies inside or on a ring. The ring may be oriented in either direction. A point lying exactly on the ring boundary is considered to be inside the ring. This method does not first check the point against the envelope of the ring. Point to check for ring inclusion. An array of s representing the ring (which must have first point identical to last point) true if p is inside ring. Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. The ring may be oriented in either direction. This method does not first check the point against the envelope of the ring. Point to check for ring inclusion An array of coordinates representing the ring (which must have first point identical to last point) The of p relative to the ring Tests whether a point lies on the line segments defined by a list of coordinates. true if the point is a vertex of the line or lies in the interior of a line segment in the linestring Computes whether a ring defined by an array of s is oriented counter-clockwise. > The list of points is assumed to have the first and last points equal. This will handle coordinate lists which contain repeated points. This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. An array of s froming a ring true if the ring is oriented If there are too few points to determine orientation (<4) Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise. > The list of points is assumed to have the first and last points equal. This will handle coordinate lists which contain repeated points. This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. A coordinate sequence froming a ring true if the ring is oriented If there are too few points to determine orientation (<4) Computes the orientation of a point q to the directed line segment p1-p2. The orientation of a point relative to a directed line segment indicates which way you turn to get to q after travelling from p1 to p2. The first vertex of the line segment The second vertex of the line segment The point to compute the relative orientation of 1 if q is counter-clockwise from p1-p2, or -1 if q is clockwise from p1-p2, or 0 if q is collinear with p1-p2 Computes the distance from a point p to a line segment AB. Note: NON-ROBUST! The point to compute the distance for. One point of the line. Another point of the line (must be different to A). The distance from p to line segment AB. Computes the perpendicular distance from a point p to the (infinite) line containing the points AB The point to compute the distance for. One point of the line. Another point of the line (must be different to A). The perpendicular distance from p to line AB. Computes the distance from a point to a sequence of line segments. A point A sequence of contiguous line segments defined by their vertices The minimum distance between the point and the line segments If there are too few points to make up a line (at least one?) Computes the distance from a line segment AB to a line segment CD. Note: NON-ROBUST! A point of one line. The second point of the line (must be different to A). One point of the line. Another point of the line (must be different to A). The distance from line segment AB to line segment CD. Computes the signed area for a ring. The signed area is positiveif the ring is oriented CW negativeif the ring is oriented CCW zeroif the ring is degenerate or flat The coordinates of the ring The signed area of the ring Computes the signed area for a ring. The signed area is positiveif the ring is oriented CW negativeif the ring is oriented CCW zeroif the ring is degenerate or flat The coordinates forming the ring The signed area of the ring Computes the length of a linestring specified by a sequence of points. The points specifying the linestring The length of the linestring Computes the convex hull of a . The convex hull is the smallest convex Geometry that contains all the points in the input Geometry. Uses the Graham Scan algorithm. Create a new convex hull construction for the input Geometry. Create a new convex hull construction for the input array. Returns a Geometry that represents the convex hull of the input point. The point will contain the minimal number of points needed to represent the convex hull. In particular, no more than two consecutive points will be collinear. If the convex hull contains 3 or more points, a Polygon; 2 points, a LineString; 1 point, a Point; 0 points, an empty GeometryCollection. Uses a heuristic to reduce the number of points scanned to compute the hull. The heuristic is to find a polygon guaranteed to be in (or on) the hull, and eliminate all points inside it. A quadrilateral defined by the extremal points in the four orthogonal directions can be used, but even more inclusive is to use an octilateral defined by the points in the 8 cardinal directions. Note that even if the method used to determine the polygon vertices is not 100% robust, this does not affect the robustness of the convex hull. To satisfy the requirements of the Graham Scan algorithm, the returned array has at least 3 entries. The coordinates to reduce The reduced array of coordinates Pre sorts the coordinates Whether the three coordinates are collinear and c2 lies between c1 and c3 inclusive. The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). A 2-vertex LineString if the vertices are collinear; otherwise, a Polygon with unnecessary (collinear) vertices removed. The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). The coordinates with unnecessary (collinear) vertices removed. Compares s for their angle and distance relative to an origin. Initializes a new instance of the class. Computes the Euclidean distance (L2 metric) from a to a . Also computes two points on the geometry which are separated by the distance found. Contains a pair of points and the distance between them. Provides methods to update with a new point pair with either maximum or minimum distance. Initializes to null. Initializes the points. 1st coordinate 2nd coordinate Initializes the points, avoiding recomputing the distance. 1st coordinate 2nd coordinate the distance between and The distance between the paired coordinates Returns an array containing the paired points Represents a homogeneous coordinate in a 2-D coordinate space. In NTS s are used as a clean way of computing intersections between line segments. David Skea Computes the (approximate) intersection point between two line segments using homogeneous coordinates. Note that this algorithm is not numerically stable; i.e. it can produce intersection points which lie outside the envelope of the line segments themselves. In order to increase the precision of the calculation input points should be normalized before passing them to this routine. 1st Coordinate of 1st linesegment 2nd Coordinate of 1st linesegment 1st Coordinate of 2nd linesegment 2nd Coordinate of 2nd linesegment Computes the (approximate) intersection point between two line segments using homogeneous coordinates. Note that this algorithm is not numerically stable; i.e. it can produce intersection points which lie outside the envelope of the line segments themselves. In order to increase the precision of the calculation input points should be normalized before passing them to this routine. Constructs a homogeneous coordinate which is the intersection of the lines s. define by the homogenous coordinates represented by two A coordinate A coordinate Direct access to x private field Direct access to y private field Direct access to w private field Computes a point in the interior of an areal geometry.

Algorithm:

Find a Y value which is close to the centre of the geometry's vertical extent but is different to any of it's Y ordinates. Create a horizontal bisector line using the Y value and the geometry's horizontal extent Find the intersection between the geometry and the horizontal bisector line. The intersection is a collection of lines and points. Pick the midpoint of the largest intersection geometry

KNOWN BUGS

If a fixed precision model is used, in some cases this method may return a point which does not lie in the interior.
Creates a new interior point finder for an areal geometry. An areal geometry Tests the interior vertices (if any) defined by an areal Geometry for the best inside point. If a component Geometry is not of dimension 2 it is not tested. The point to add. Finds an interior point of a Polygon. The geometry to analyze. If point is a collection, the widest sub-point; otherwise, the point itself. Returns the centre point of the envelope. The envelope to analyze. The centre of the envelope. Gets the computed interior point. Finds a safe bisector Y ordinate by projecting to the Y axis and finding the Y-ordinate interval which contains the centre of the Y extent. The centre of this interval is returned as the bisector Y-ordinate. Martin Davis Computes a point in the interior of an linear point. Algorithm: Find an interior vertex which is closest to the centroid of the linestring. If there is no interior vertex, find the endpoint which is closest to the centroid. Tests the interior vertices (if any) defined by a linear Geometry for the best inside point. If a Geometry is not of dimension 1 it is not tested. The point to add. Tests the endpoint vertices defined by a linear Geometry for the best inside point. If a Geometry is not of dimension 1 it is not tested. The point to add. Computes a point in the interior of an point point. Algorithm: Find a point which is closest to the centroid of the point. Tests the point(s) defined by a Geometry for the best inside point. If a Geometry is not of dimension 0 it is not tested. The point to add. An interface for classes which determine the of points in a Martin Davis Determines the of a point in the . The point to test the location of the point in the geometry A LineIntersector is an algorithm that can both test whether two line segments intersect and compute the intersection point(s) if they do. There are three possible outcomes when determining whether two line segments intersect: - the segments do not intersect - the segments intersect in a single point - the segments are collinear and they intersect in a line segment For segments which intersect in a single point, the point may be either an endpoint or in the interior of each segment. If the point lies in the interior of both segments, this is termed a proper intersection. The property test for this situation. The intersection point(s) may be computed in a precise or non-precise manner. Computing an intersection point precisely involves rounding it via a supplied . LineIntersectors do not perform an initial envelope intersection test to determine if the segments are disjoint. This is because this class is likely to be used in a context where envelope overlap is already known to occur (or be likely). These are deprecated, due to ambiguous naming Indicates that line segments do not intersect Indicates that line segments intersect in a single point Indicates that line segments intersect in a line segment Computes the "edge distance" of an intersection point p along a segment. The edge distance is a metric of the point along the edge. The metric used is a robust and easy to compute metric function. It is not equivalent to the usual Euclidean metric. It relies on the fact that either the x or the y ordinates of the points in the edge are unique, depending on whether the edge is longer in the horizontal or vertical direction. NOTE: This function may produce incorrect distances for inputs where p is not precisely on p1-p2 (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distanct 0.0, which is incorrect. My hypothesis is that the function is safe to use for points which are the result of rounding points which lie on the line, but not safe to use for truncated points. This function is non-robust, since it may compute the square of large numbers. Currently not sure how to improve this. The indexes of the endpoints of the intersection lines, in order along the corresponding line If MakePrecise is true, computed intersection coordinates will be made precise using Coordinate.MakePrecise. Gets an endpoint of an input segment. the index of the input segment (0 or 1) the index of the endpoint (0 or 1) The specified endpoint Compute the intersection of a point p and the line p1-p2. This function computes the bool value of the hasIntersection test. The actual value of the intersection (if there is one) is equal to the value of p. Computes the intersection of the lines p1-p2 and p3-p4. This function computes both the bool value of the hasIntersection test and the (approximate) value of the intersection point itself (if there is one). Returns the intIndex'th intersection point. is 0 or 1. The intIndex'th intersection point. Test whether a point is a intersection point of two line segments. Note that if the intersection is a line segment, this method only tests for equality with the endpoints of the intersection segment. It does not return true if the input point is internal to the intersection segment. true if the input point is one of the intersection points. Tests whether either intersection point is an interior point of one of the input segments. true if either intersection point is in the interior of one of the input segment. Tests whether either intersection point is an interior point of the specified input segment. true if either intersection point is in the interior of the input segment. Computes the intIndex'th intersection point in the direction of a specified input line segment. is 0 or 1. is 0 or 1. The intIndex'th intersection point in the direction of the specified input line segment. Computes the index (order) of the intIndex'th intersection point in the direction of a specified input line segment. is 0 or 1. is 0 or 1. The index of the intersection point along the segment (0 or 1). Computes the intersection line index The segment index Computes the "edge distance" of an intersection point along the specified input line segment. is 0 or 1. is 0 or 1. The edge distance of the intersection point. Alias the [0] for ease of reference Alias the [1] for ease of reference Force computed intersection to be rounded to a given precision model Force computed intersection to be rounded to a given precision model. No getter is provided, because the precision model is not required to be specified. Tests whether the input geometries intersect. true if the input geometries intersect. Returns the number of intersection points found. This will be either 0, 1 or 2. The number of intersection points found (0, 1, or 2) Tests whether an intersection is proper. The intersection between two line segments is considered proper if they intersect in a single point in the interior of both segments (e.g. the intersection is a single point and is not equal to any of the endpoints). The intersection between a point and a line segment is considered proper if the point lies in the interior of the segment (e.g. is not equal to either of the endpoints). true if the intersection is proper. Determines the location of s relative to a geometry, using indexing for efficiency. This algorithm is suitable for use in cases where many points will be tested against a given area. Thread-safe and immutable. Martin Davis An interface for classes which determine the of points in areal geometries. Martin Davis Determines the of a point in an areal . The point to test The location of the point in the geometry Creates a new locator for a given . the Geometry to locate in Determines the of a point in an areal . The point to test The location of the point in the geometry A visitor for items in an index. Static methods for classes Convenience method to test a point for intersection with a geometry The geometry is wrapped in a class. The locator to use. The coordinate to test. true if the point is in the interior or boundary of the geometry. Computes the location of points relative to an areal , using a simple O(n) algorithm. This algorithm is suitable for use in cases where only one or a few points will be tested against a given area. The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry. Determines the of a point in an areal . Currently this will never return a value of . The point to test The areal geometry to test The Location of the point in the geometry Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible. The point to test A linear ring true if the point lies inside the ring Measures the degree of similarity between two s using the area of intersection between the geometries. The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. NOTE: Currently experimental and incomplete. mbdavis An interface for classes which measures the degree of similarity between two {@link Geometry}s. The computed measure lies in the range [0, 1]. Higher measures indicate a great degree of similarity. A measure of 1.0 indicates that the input geometries are identical A measure of 0.0 indicates that the geometries have essentially no similarity. The precise definition of "identical" and "no similarity" may depend on the exact algorithm being used. mbdavis Function to measure the similarity between two s. A geometry A geometry The similarity value between two s Measures the degree of similarity between two s using the Hausdorff distance metric. The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing this by dividing it by the diagonal distance across the envelope of the combined geometries. mbdavis Provides methods to mathematically combine values. Martin Davis Implements IPointInRing using a MonotoneChains and a BinTree index to increase performance. An interface for classes which test whether a Coordinate lies inside a ring. The action for the internal iterator for performing envelope select queries on a MonotoneChain. These envelopes are used during the MonotoneChain search process. This method is overridden to process a segment in the context of the parent chain. The parent chain The index of the start vertex of the segment being processed This is a convenience method which can be overridden to obtain the actual line segment which is selected. Computes the Minimum Bounding Circle (MBC) for the points in a . The MBC is the smallest circle which covers all the input points (this is also sometimes known as the Smallest Enclosing Circle). This is equivalent to computing the Maximum Diameter of the input point set. The computed circle can be specified in two equivalent ways, both of which are provide as output by this class: As a centre point and a radius By the set of points defining the circle. Depending on the number of points in the input and their relative positions, this will be specified by anywhere from 0 to 3 points. 0 or 1 points indicate an empty or trivial input point arrangment. 2 or 3 points define a circle which contains all the input points. The class can also output a which approximates the shape of the MBC (although as an approximation it is not guaranteed to cover all the input points.) Martin Davis The algorithm used is based on the one by Jon Rokne in the article "An Easy Bounding Circle" in Graphic Gems II. Creates a new object for computing the minimum bounding circle for the point set defined by the vertices of the given geometry. The geometry to use to obtain the point set Gets a geometry which represents the Minimum Bounding Circle. If the input is degenerate (empty or a single unique point), this method will return an empty geometry or a single Point geometry. Otherwise, a Polygon will be returned which approximates the Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.) A Geometry representing the Minimum Bounding Circle. Gets a geometry representing a line between the two farthest points in the input. These points will be two of the extremal points of the Minimum Bounding Circle. They also lie on the convex hull of the input. A LineString between the two farthest points of the input An empty LineString if the input is empty A Point if the input is a point Gets a geometry representing the diameter of the computed Minimum Bounding Circle. the diameter line of the Minimum Bounding Circle an empty line if the input is empty a Point if the input is a point Gets the extremal points which define the computed Minimum Bounding Circle. There may be zero, one, two or three of these points, depending on the number of points in the input and the geometry of those points. The points defining the Minimum Bounding Circle Gets the centre point of the computed Minimum Bounding Circle. the centre point of the Minimum Bounding Circle, null if the input is empty Gets the radius of the computed Minimum Bounding Circle. The radius of the Minimum Bounding Circle Computes the minimum diameter of a . The minimum diameter is defined to be the width of the smallest band that contains the point, where a band is a strip of the plane defined by two parallel lines. This can be thought of as the smallest hole that the point can be moved through, with a single rotation. The first step in the algorithm is computing the convex hull of the Geometry. If the input Geometry is known to be convex, a hint can be supplied to avoid this computation. This class can also be used to compute a line segment representing the minimum diameter, the supporting line segment of the minimum diameter, and a minimum rectangle enclosing the input geometry. This rectangle will have width equal to the minimum diameter, and have one side parallel to the supporting segment. Gets the minimum rectangle enclosing a geometry. The geometry The minimum rectangle enclosing the geometry Gets the minimum diameter enclosing a geometry. The geometry The length of the minimum diameter of the geometry Compute a minimum diameter for a given . a Geometry. Compute a minimum diameter for a giver Geometry, with a hint if the Geometry is convex (e.g. a convex Polygon or LinearRing, or a two-point LineString, or a Point). a Geometry which is convex. true if the input point is convex. Compute the width information for a ring of Coordinates. Leaves the width information in the instance variables. Gets the minimum rectangular which encloses the input geometry. The rectangle has width equal to the minimum diameter, and a longer length. If the convex hull of the input is degenerate (a line or point) a or is returned. The minimum rectangle can be used as an extremely generalized representation for the given geometry. The minimum rectangle enclosing the input (or a line or point if degenerate) Gets the length of the minimum diameter of the input Geometry. The length of the minimum diameter. Gets the Coordinate forming one end of the minimum diameter. A coordinate forming one end of the minimum diameter. Gets the segment forming the base of the minimum diameter. The segment forming the base of the minimum diameter. Gets a LineString which is a minimum diameter. A LineString which is a minimum diameter. Non-robust versions of various fundamental Computational Geometric algorithms, FOR TESTING PURPOSES ONLY!. The non-robustness is due to rounding error in floating point computation. Computes whether a ring defined by an array of Coordinate is oriented counter-clockwise. This will handle coordinate lists which contain repeated points. an array of coordinates forming a ring. true if the ring is oriented counter-clockwise. throws ArgumentException if the ring is degenerate (does not contain 3 different points) Computes the orientation of a point q to the directed line segment p1-p2. The orientation of a point relative to a directed line segment indicates which way you turn to get to q after travelling from p1 to p2. 1 if q is counter-clockwise from p1-p2 -1 if q is clockwise from p1-p2 0 if q is collinear with p1-p2 Returns the index of the direction of the point q relative to a vector specified by p1-p2. the origin point of the vector the final point of the vector the point to compute the direction to 1 if q is counter-clockwise (left) from p1-p2 -1 if q is clockwise (right) from p1-p2 0 if q is collinear with p1-p2 Computes the distance from a line segment AB to a line segment CD. Note: NON-ROBUST! A point of one line. The second point of the line (must be different to A). One point of the line. Another point of the line (must be different to A). The distance from line segment AB to line segment CD. A non-robust version of LineIntersector. true if both numbers are positive or if both numbers are negative, false if both numbers are zero. RParameter computes the parameter for the point p in the parameterized equation of the line from p1 to p2. This is equal to the 'distance' of p along p1-p2. Computes the topological relationship () of a single point to a Geometry. A may be specified to control the evaluation of whether the point lies on the boundary or not The default rule is to use the the SFS Boundary Determination Rule Notes: s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring. Instances of this class are not reentrant. Initializes a new instance of the class. Convenience method to test a point for intersection with a Geometry The coordinate to test. The Geometry to test. true if the point is in the interior or boundary of the Geometry. Computes the topological relationship ({Location}) of a single point to a Geometry. It handles both single-element and multi-element Geometries. The algorithm for multi-part Geometries takes into account the boundaryDetermination rule. The Location of the point relative to the input Geometry. Counts the number of segments crossed by a horizontal ray extending to the right from a given point, in an incremental fashion. This can be used to determine whether a point lies in a geometry. The class determines the situation where the point lies exactly on a segment. When being used for Point-In-Polygon determination, this case allows short-circuiting the evaluation. This class handles polygonal geometries with any number of shells and holes. The orientation of the shell and hole rings is unimportant. In order to compute a correct location for a given polygonal geometry, it is essential that all segments are counted which touch the ray lie in in any ring which may contain the point The only exception is when the point-on-segment situation is detected, in which case no further processing is required. The implication of the above rule is that segments which can be a priori determined to not touch the ray (i.e. by a test of their bounding box or Y-extent) do not need to be counted. This allows for optimization by indexing. Martin Davis Determines the of a point in a ring. This method is an exemplar of how to use this class. The point to test An array of Coordinates forming a ring The location of the point in the ring Determines the of a point in a ring. The point to test A coordinate sequence forming a ring The location of the point in the ring Counts a segment An endpoint of the segment Another endpoint of the segment Reports whether the point lies exactly on one of the supplied segments. This method may be called at any time as segments are processed. If the result of this method is true, no further segments need be supplied, since the result will never change again. Gets the of the point relative to the ring, polygon or multipolygon from which the processed segments were provided. This property only determines the correct location if all relevant segments have been processed Tests whether the point lies in or on the ring, polygon This property only determines the correct location if all relevant segments have been processed Computes whether a rectangle intersects line segments. Rectangles contain a large amount of inherent symmetry (or to put it another way, although they contain four coordinates they only actually contain 4 ordinates worth of information). The algorithm used takes advantage of the symmetry of the geometric situation to optimize performance by minimizing the number of line intersection tests. Martin Davis Creates a new intersector for the given query rectangle, specified as an . The query rectangle, specified as an Envelope Tests whether the query rectangle intersects a given line segment. The first endpoint of the segment The second endpoint of the segment true if the rectangle intersects the segment Implements an algorithm to compute the sign of a 2x2 determinant for double precision values robustly. It is a direct translation of code developed by Olivier Devillers. The original code carries the following copyright notice: ************************************************************************ Author : Olivier Devillers Olivier.Devillers@sophia.inria.fr http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html Olivier Devillers has allowed the code to be distributed under the LGPL (2012-02-16) saying "It is ok for LGPL distribution." ************************************************************************* ************************************************************************* Copyright (c) 1995 by INRIA Prisme Project BP 93 06902 Sophia Antipolis Cedex, France. All rights reserved ************************************************************************* Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way. -1 if the determinant is negative, 1 if the determinant is positive, 0 if the determinant is null. Returns the index of the direction of the point q relative to a vector specified by p1-p2. The origin point of the vector The final point of the vector the point to compute the direction to 1 if q is counter-clockwise (left) from p1-p2 -1 if q is clockwise (right) from p1-p2 0 if q is collinear with p1-p2 A robust version of . This method computes the actual value of the intersection point. To obtain the maximum precision from the intersection calculation, the coordinates are normalized by subtracting the minimum ordinate values (in absolute value). This has the effect of removing common significant digits from the calculation to maintain more bits of precision. Computes a segment intersection using homogeneous coordinates. Round-off error can cause the raw computation to fail, (usually due to the segments being approximately parallel). If this happens, a reasonable approximation is computed instead. Normalize the supplied coordinates to so that the midpoint of their intersection envelope lies at the origin. Tests whether a point lies in the envelopes of both input segments. A correctly computed intersection point should return true for this test. Since this test is for debugging purposes only, no attempt is made to optimize the envelope test. true if the input point lies within both input segment envelopes. Finds the endpoint of the segments P and Q which is closest to the other segment. This is a reasonable surrogate for the true intersection points in ill-conditioned cases (e.g. where two segments are nearly coincident, or where the endpoint of one segment lies almost on the other segment). This replaces the older CentralEndpoint heuristic, which chose the wrong endpoint in some cases where the segments had very distinct slopes and one endpoint lay almost on the other segment. an endpoint of segment P an endpoint of segment P an endpoint of segment Q an endpoint of segment Q the nearest endpoint to the other segment Tests whether a Coordinate lies inside a ring, using a linear-time algorithm. Implements PointInRing using a SIRtree index to increase performance. Base class for all ICRSObject implementing types Base Interface for CRSBase Object types. Gets the CRS type. Gets the type of the CRSBase object. Gets the properties. Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the geojson.org v1.0 spec. Defines the Named CRS type. Defines the Linked CRS type. Defines the Linked CRS type. Initializes a new instance of the class. The mandatory href member must be a dereferenceable URI. The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. Initializes a new instance of the class. The mandatory href member must be a dereferenceable URI. The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. Defines the Named CRS type. Initializes a new instance of the class. The mandatory name member must be a string identifying a coordinate reference system. OGC CRS URNs such as 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'. A graph containing s. A graph comprised of s. It supports tracking the vertices in the graph via edges incident on them, to allow efficient lookup of edges and vertices. This class may be subclassed to use a different subclass of HalfEdge, by overriding . If additional logic is required to initialize edges then can be overridden as well. Creates a single HalfEdge. Override to use a different HalfEdge subclass. the origin location a new with the given origin Adds an edge between the coordinates orig and dest to this graph. Only valid edges can be added (in particular, zero-length segments cannot be added) the edge origin location the edge destination location The created edge null if the edge was invalid and not added Test if an the coordinates for an edge form a valid edge (with non-zero length) The start coordinate The end coordinate true of the edge formed is valid Inserts an edge not already present into the graph. the edge origin location the edge destination location an existing edge with same orig (if any) the created edge Finds an edge in this graph with the given origin and destination, if one exists. the origin location the destination location an edge with the given orig and dest, or null if none exists A HalfEdge which carries information required to support . A which supports marking edges with a boolean flag. Useful for algorithms which perform graph traversals. Represents a directed component of an edge in an . HalfEdges link vertices whose locations are defined by s. HalfEdges start at an origin vertex, and terminate at a destination vertex. HalfEdges always occur in symmetric pairs, with the method giving access to the oppositely-oriented component. HalfEdges and the methods on them form an edge algebra, which can be used to traverse and query the topology of the graph formed by the edges. By design HalfEdges carry minimal information about the actual usage of the graph they represent. They can be subclassed to carry more information if required. HalfEdges form a complete and consistent data structure by themselves, but an is useful to allow retrieving edges by vertex and edge location, as well as ensuring edges are created and linked appropriately. Creates a HalfEdge pair representing an edge between two vertices located at coordinates p0 and p1. a vertex coordinate a vertex coordinate the HalfEdge with origin at p0 Initialize a symmetric pair of HalfEdges. Intended for use by subclasses. The edges are initialized to have each other as the edge, and to have pointers which point to edge other. This effectively creates a graph containing a single edge. a HalfEdge a symmetric HalfEdge the initialized edge e0 Creates an edge originating from a given coordinate. the origin coordinate Finds the edge starting at the origin of this edge with the given dest vertex, if any. the dest vertex to search for the edge with the required dest vertex, if it exists, or null Tests whether this edge has the given orig and dest vertices. the origin vertex to test the destination vertex to test true if the vertices are equal to the ones of this edge Inserts an edge into the ring of edges around the origin vertex of this edge. The inserted edge must have the same origin as this edge. the edge to insert Insert an edge with the same origin after this one. Assumes that the inserted edge is in the correct position around the ring. the edge to insert (with same origin) Compares edges which originate at the same vertex based on the angle they make at their origin vertex with the positive X-axis. This allows sorting edges around their origin vertex in CCW order. Implements the total order relation. The angle of edge a is greater than the angle of edge b, where the angle of an edge is the angle made by the first segment of the edge with the positive x-axis. When applied to a list of edges originating at the same point, this produces a CCW ordering of the edges around the point. Using the obvious algorithm of computing the angle is not robust, since the angle calculation is susceptible to roundoff error. A robust algorithm is: 1. compare the quadrants the edge vectors lie in. If the quadrants are different, it is trivial to determine which edge has a greater angle. 2. If the vectors lie in the same quadrant, the function can be used to determine the relative orientation of the vectors. Computes a string representation of a HalfEdge. Computes the degree of the origin vertex. The degree is the number of edges originating from the vertex. the degree of the origin vertex Finds the first node previous to this edge, if any. If no such node exists (i.e the edge is part of a ring) then null is returned. an edge originating at the node prior to this edge, if any, or null if no node exists Gets the origin coordinate of this edge. Gets the destination coordinate of this edge. Gets the symmetric pair edge of this edge. Gets the next edge CCW around the destination vertex of this edge. If the vertex has degree 1 then this is the sym edge. Returns the edge previous to this one (with dest being the same as this orig). The X component of the distance between the orig and dest vertices. The Y component of the distance between the orig and dest vertices. Sets the mark for the given edge pair to a boolean value. an edge of the pair to update the mark value to set Marks the edges in a pair. an edge of the pair to mark Creates a new marked edge. the coordinate of the edge origin Marks this edge. Sets this edge to be the start segment of an input LineString. Tests whether this edge is the starting segment in a LineString being dissolved. true if this edge is a start segment Dissolves the linear components from a collection of s. into a set of maximal-length s in which every unique segment appears once only. The output linestrings run between node vertices of the input, which are vertices which have either degree 1, or degree 3 or greater. Use cases for dissolving linear components include generalization (in particular, simplifying polygonal coverages), and visualization (in particular, avoiding symbology conflicts when depicting shared polygon boundaries). This class does NOT node the input lines. If there are line segments crossing in the input, they will still cross in the output. Dissolves the linear components in a geometry. the geometry to dissolve the dissolved lines Adds a to be dissolved. Any number of geometries may be adde by calling this method multiple times. Any type of Geometry may be added. The constituent linework will be extracted to be dissolved. geometry to be line-merged Adds a collection of Geometries to be processed. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted. the geometries to be line-merged Gets the dissolved result as a . the dissolved lines For each edge in stack (which must originate at a node) extracts the line it initiates. Updates the tracked ringStartEdge if the given edge has a lower origin (using the standard ordering). Identifying the lowest starting node meets two goals: * It ensures that isolated input rings are created using the original node and orientation. * For isolated rings formed from multiple input linestrings, it provides a canonical node and orientation for the output (rather than essentially random, and thus hard to test). Builds a line starting from the given edge. The start edge origin is a node (valence = 1 or >= 3), unless it is part of a pure ring. A pure ring has no other incident lines. In this case the start edge may occur anywhere on the ring. The line is built up to the next node encountered, or until the start edge is re-encountered (which happens if the edges form a ring). Adds edges around this node to the stack. Builds an edge graph from geometries containing edges. Adds the edges of a Geometry to the graph. May be called multiple times. Any dimension of Geometry may be added; the constituent edges are extracted. geometry to be added Adds the edges in a collection of s to the graph. May be called multiple times. Any dimension of may be added. the geometries to be added Represents a feature collection. Initializes a new instance of the class. The features. Initializes a new instance of the class. Adds the specified feature. The feature. Removes the specified feature. The feature. true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the collection. Removes the element at the specified index of the collection. The index. Gets the features. The features. Gets the (mandatory) type of the GeoJSON Object. The type of the object. Gets or sets the (optional) Coordinate Reference System Object. The Coordinate Reference System Objects. Returns the indexTh element in the collection. Returns the number of features contained by this . A representation of a planar, linear vector geometry.

Binary Predicates:

Because it is not clear at this time what semantics for spatial analysis methods involving GeometryCollections would be useful, GeometryCollections are not supported as arguments to binary predicates or the Relate method.

Overlay Methods:

The spatial analysis methods will return the most specific class possible to represent the result. If the result is homogeneous, a Point, LineString, or Polygon will be returned if the result contains a single element; otherwise, a MultiPoint, MultiLineString, or MultiPolygon will be returned. If the result is heterogeneous a GeometryCollection will be returned.
Representation of Computed Geometries: The SFS states that the result of a set-theoretic method is the "point-set" result of the usual set-theoretic definition of the operation (SFS 3.2.21.1). However, there are sometimes many ways of representing a point set as a Geometry. The SFS does not specify an unambiguous representation of a given point set returned from a spatial analysis method. One goal of NTS is to make this specification precise and unambiguous. NTS uses a canonical form for Geometrys returned from overlay methods. The canonical form is a Geometry which is simple and noded: Simple means that the Geometry returned will be simple according to the NTS definition of IsSimple. Noded applies only to overlays involving LineStrings. It means that all intersection points on LineStrings will be present as endpoints of LineStrings in the result. This definition implies that non-simple geometries which are arguments to spatial analysis methods must be subjected to a line-dissolve process to ensure that the results are simple. Constructed Points And The Precision Model: The results computed by the set-theoretic methods may contain constructed points which are not present in the input Geometrys. These new points arise from intersections between line segments in the edges of the input Geometrys. In the general case it is not possible to represent constructed points exactly. This is due to the fact that the coordinates of an intersection point may contain twice as many bits of precision as the coordinates of the input line segments. In order to represent these constructed points explicitly, NTS must truncate them to fit the PrecisionModel. Unfortunately, truncating coordinates moves them slightly. Line segments which would not be coincident in the exact result may become coincident in the truncated representation. This in turn leads to "topology collapses" -- situations where a computed element has a lower dimension than it would in the exact result. When NTS detects topology collapses during the computation of spatial analysis methods, it will throw an exception. If possible the exception will report the location of the collapse.

Geometry Equality

There are two ways of comparing geometries for equality: structural equality and topological equality.

Structural Equality

Structural Equality is provided by the method. This implements a comparison based on exact, structural pointwise equality. The is a synonym for this method, to provide structural equality semantics for use in collections. It is important to note that structural pointwise equality is easily affected by things like ring order and component order. In many situations it will be desirable to normalize geometries before comparing them (using the or methods). is provided as a convenience method to compute equality over normalized geometries, but it is expensive to use. Finally, allows using a tolerance value for point comparison.

Topological Equality

Topological Equality is provided by the method. It implements the SFS definition of point-set equality defined in terms of the DE-9IM matrix. To support the SFS naming convention, the method is also provided as a synonym. However, due to the potential for confusion with its use is discouraged. Since and are overridden, Geometries can be used effectively in .Net collections.
An object reference which can be used to carry ancillary data defined by the client. The bounding box of this Geometry. Creates a new Geometry via the specified GeometryFactory. The factory Returns true if the array contains any non-empty Geometrys. an array of Geometrys; no elements may be null true if any of the Geometrys IsEmpty methods return false. Returns true if the array contains any null elements. an array to validate. true if any of arrays elements are null. Gets an array of ordinate values The ordinate index An array of ordinate values Returns an element Geometry from a GeometryCollection, or this, if the geometry is not a collection. The index of the geometry element. The n'th geometry contained in this geometry. Returns the minimum distance between this Geometry and another Geometry g. The Geometry from which to compute the distance. The distance between the geometries 0 if either input geometry is empty if g is null Tests whether the distance from this Geometry to another is less than or equal to a specified value. the Geometry to check the distance to. the distance value to compare. true if the geometries are less than distance apart. Notifies this geometry that its coordinates have been changed by an external party (for example, via a ). When this method is called the geometry will flush and/or update any derived information it has cached (such as its ). The operation is applied to all component Geometries. Notifies this Geometry that its Coordinates have been changed by an external party. When GeometryChanged is called, this method will be called for this Geometry and its component Geometries. Tests whether this geometry is disjoint from the argument geometry. The Disjoint predicate has the following equivalent definitions: The DE-9IM intersection matrix for the two geometries matches FF*FF****. !g.intersects(this) == true
(Disjoint is the inverse of Intersects)
The Geometry with which to compare this Geometry. true if the two Geometrys are disjoint.
Tests whether this geometry touches the argument geometry The Touches predicate has the following equivalent definitions: The geometries have at least one point in common, but their interiors do not intersect The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns FT*******, F**T***** or F***T****. If both geometries have dimension 0, the predicate returns false, since points have only interiors. This predicate is symmetric. The Geometry with which to compare this Geometry. true if the two Geometrys touch; Returns false if both Geometrys are points. Tests whether this geometry intersects the argument geometry. The Intersects predicate has the following equivalent definitions: The two geometries have at least one point in common The DE-9IM Intersection Matrix for the two geometries matches
[T********] or
[*T*******] or
[***T*****] or
[****T****]
!g.disjoint(this)
(Intersects is the inverse of Disjoint)
The Geometry with which to compare this Geometry. true if the two Geometrys intersect.
Tests whether this geometry crosses the specified geometry. The Crosses predicate has the following equivalent definitions: The geometries have some but not all interior points in common. The DE-9IM Intersection Matrix for the two geometries matches one of the following patterns: CodeDescription [T*T******]for P/L, P/A, and L/A situations [T*****T**]for L/P, A/P, and A/L situations) [0********]for L/L situations For any other combination of dimensions this predicate returns false. The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. In order to make the relation symmetric, NTS extends the definition to apply to L/P, A/P and A/L situations as well. The Geometry with which to compare this Geometry true if the two Geometrys cross. Tests whether this geometry is within the specified geometry. The within predicate has the following equivalent definitions: Every point of this geometry is a point of the other geometry, and the interiors of the two geometries have at least one point in common. The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***] g.contains(this) == true
(Within is the converse of )
An implication of the definition is that "The boundary of a geometry is not within the Polygon". In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) For a predicate with similar behaviour but avoiding this subtle limitation, see .
The Geometry with which to compare this Geometry. true if this Geometry is within other.
Tests whether this geometry overlaps the specified geometry. The Overlaps predicate has the following equivalent definitions: The geometries have at least one point each not shared by the other (or equivalently neither covers the other), they have the same dimension, and the intersection of the interiors of the two geometries has the same dimension as the geometries themselves. The DE-9IM Intersection Matrix for the two geometries matches [T*T***T**] (for two points or two surfaces) or [1*T***T**] (for two curves) If the geometries are of different dimension this predicate returns false. The Geometry with which to compare this Geometry. true if the two Geometrys overlap. For this function to return true, the Geometry s must be two points, two curves or two surfaces. Tests whether this geometry covers the argument geometry The covers predicate has the following equivalent definitions: Every point of the other geometry is a point of this geometry. The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns: [T*****FF*] or
[*T****FF*] or
[***T**FF*] or
[****T*FF*]
g.CoveredBy(this) == true
(covers is the converse of )
If either geometry is empty, the value of this predicate is false. This predicate is similar to , but is more inclusive (i.e. returns true for more cases). In particular, unlike Contains it does not distinguish between points in the boundary and in the interior of geometries. For most situations, Covers should be used in preference to Contains. As an added benefit, Covers is more amenable to optimization, and hence should be more performant.
The Geometry with which to compare this Geometry true if this Geometry covers
Tests whether this geometry is covered by the specified geometry. The CoveredBy predicate has the following equivalent definitions: Every point of this geometry is a point of the other geometry. The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns: [T*F**F***] [*TF**F***] [**FT*F***] [**F*TF***] g.Covers(this) == true
(CoveredBy is the converse of )
If either geometry is empty, the value of this predicate is false. This predicate is similar to , but is more inclusive (i.e. returns true for more cases).
the Geometry with which to compare this Geometry true if this Geometry is covered by g
Tests whether the elements in the DE-9IM for the two Geometrys match the elements in intersectionPattern. The pattern is a 9-character string, with symbols drawn from the following set: 0 (dimension 0) 1 (dimension 1) 2 (dimension 2) T ( matches 0, 1 or 2) F ( matches FALSE) * ( matches any value) For more information on the DE-9IM, see the OpenGIS Simple Features Specification. the Geometry with which to compare this Geometry the pattern against which to check the intersection matrix for the two Geometrys true if the DE-9IM intersection matrix for the two Geometrys match intersectionPattern Returns the DE-9IM intersection matrix for the two Geometrys. The Geometry with which to compare this Geometry A matrix describing the intersections of the interiors, boundaries and exteriors of the two Geometrys. Tests whether this geometry is topologically equal to the argument geometry. This method is included for backward compatibility reasons. It has been superseded by the method, which has been named to clearly denote its functionality. This method should NOT be confused with the method , which implements an exact equality comparison. The Geometry with which to compare this Geometry true if the two Geometrys are topologically equal. Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS Equals predicate. The SFS equals predicate has the following equivalent definitions: The two geometries have at least one point in common, and no point of either geometry lies in the exterior of the other geometry. The DE-9IM Intersection Matrix for the two geometries matches the pattern T*F**FFF*
            T*F
            **F
            FF*
            
Note that this method computes topologically equality. For structural equality, see {@link #equalsExact(Geometry)}.
the Geometry with which to compare this Geometry true if the two Geometrys are topologically equal
Tests whether this geometry is structurally and numerically equal to a given Object. If the argument Object is not a Geometry, the result is false. Otherwise, the result is computed using . This method is provided to fulfill the Java contract for value-based object equality. In conjunction with it provides semantics which are most useful for using Geometrys as keys and values in Java collections. Note that to produce the expected result the input geometries should be in normal form. It is the caller's responsibility to perform this where required (using or as appropriate). The object to compare true if this geometry is exactly equal to the argument Gets a hash code for the Geometry. An integer value suitable for use as a hashcode Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text format, see the OpenGIS Simple Features Specification. The Well-known Text representation of this Geometry. Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text format, see the OpenGIS Simple Features Specification. The Well-known Text representation of this Geometry. Returns the Well-known Binary representation of this Geometry. For a definition of the Well-known Binary format, see the OpenGIS Simple Features Specification. The Well-known Binary representation of this Geometry. Returns the feature representation as GML 2.1.1 XML document. This XML document is based on Geometry.xsd schema. NO features or XLink are implemented here! Computes a buffer area around this geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance). Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The buffer geometry is constructed using 8 segments per quadrant to approximate the circular arcs. The end cap style is BufferStyle.CapRound. The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty . This is also the result for the buffers of degenerate (zero-area) polygons. The width of the buffer (may be positive, negative or 0), interpreted according to the PrecisionModel of the Geometry. a polygonal geometry representing the buffer region (which may be empty) If a robustness error occurs Computes a buffer region around this Geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance). The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
  • - (default) a semi-circle
  • - a straight line perpendicular to the end segment
  • - a half-square
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty .
The width of the buffer, interpreted according to the PrecisionModel of the Geometry. Cap Style to use for compute buffer. a polygonal geometry representing the buffer region (which may be empty) If a robustness error occurs
Computes a buffer region around this Geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance). The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
  • - (default) a semi-circle
  • - a straight line perpendicular to the end segment
  • - a half-square
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty .
The width of the buffer, interpreted according to the PrecisionModel of the Geometry. Cap Style to use for compute buffer. a polygonal geometry representing the buffer region (which may be empty) If a robustness error occurs
Computes a buffer region around this Geometry having the given width and with a specified accuracy of approximation for circular arcs. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance. Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation. Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The quadrantSegments argument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circle The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty . This is also the result for the buffers of degenerate (zero-area) polygons. The width of the buffer (may be positive, negative or 0), interpreted according to the PrecisionModel of the Geometry. The number of segments to use to approximate a quadrant of a circle. a polygonal geometry representing the buffer region (which may be empty) If a robustness error occurs Computes a buffer region around this Geometry having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance. Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation. Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The quadrantSegments argument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circle The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
  • - (default) a semi-circle
  • - a straight line perpendicular to the end segment
  • - a half-square
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty . This is also the result for the buffers of degenerate (zero-area) polygons.
The width of the buffer, interpreted according to the PrecisionModel of the Geometry. The number of segments to use to approximate a quadrant of a circle. Cap Style to use for compute buffer. a polygonal geometry representing the buffer region (which may be empty) If a robustness error occurs
Computes a buffer region around this Geometry having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance. Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation. Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The quadrantSegments argument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circle The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
  • - (default) a semi-circle
  • - a straight line perpendicular to the end segment
  • - a half-square
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty . This is also the result for the buffers of degenerate (zero-area) polygons.
The width of the buffer, interpreted according to the PrecisionModel of the Geometry. The number of segments to use to approximate a quadrant of a circle. Cap Style to use for compute buffer. a polygonal geometry representing the buffer region (which may be empty) If a robustness error occurs
Returns the smallest convex Polygon that contains all the points in the Geometry. This obviously applies only to Geometry s which contain 3 or more points. the minimum-area convex polygon containing this Geometry's points. Computes a new geometry which has all component coordinate sequences in reverse order (opposite orientation) to this one. A reversed geometry Computes a Geometry representing the point-set which is common to both this Geometry and the other Geometry. The intersection of two geometries of different dimension produces a result geometry of dimension less than or equal to the minimum dimension of the input geometries. The result geometry may be a heterogenous . If the result is empty, it is an atomic geometry with the dimension of the lowest input dimension. Intersection of s is supported only for homogeneous collection types. Non-empty heterogeneous arguments are not supported. The Geometry with which to compute the intersection. A geometry representing the point-set common to the two Geometrys. if a robustness error occurs. if the argument is a non-empty heterogenous GeometryCollection Computes a Geometry representing the point-set which is contained in both this Geometry and the other Geometry. The method may be used on arguments of different dimension, but it does not support arguments. The union of two geometries of different dimension produces a result geometry of dimension equal to the maximum dimension of the input geometries. The result geometry may be a heterogenous . If the result is empty, it is an atomic geometry with the dimension of the highest input dimension. Unioning s has the effect of noding and dissolving the input linework. In this context "noding" means that there will be a node or endpoint in the result for every endpoint or line segment crossing in the input. "Dissolving" means that any duplicate (i.e. coincident) line segments or portions of line segments will be reduced to a single line segment in the result. If merged linework is required, the class can be used. Non-empty arguments are not supported. the Geometry with which to compute the union A point-set combining the points of this Geometry and the points of other Thrown if a robustness error occurs Thrown if either input is a non-empty GeometryCollection Computes a Geometry representing the closure of the point-set of the points contained in this Geometry that are not contained in the other Geometry. If the result is empty, it is an atomic geometry with the dimension of the left-hand input. Non-empty arguments are not supported. The Geometry with which to compute the difference. A Geometry representing the point-set difference of this Geometry with other. Computes a Geometry representing the closure of the point-set which is the union of the points in this Geometry which are not contained in the other Geometry, with the points in the other Geometry not contained in this Geometry. If the result is empty, it is an atomic geometry with the dimension of the highest input dimension. Non-empty arguments are not supported. The Geometry with which to compute the symmetric difference. a Geometry representing the point-set symmetric difference of this Geometry with other. Computes the union of all the elements of this geometry. This method supports s (which the other overlay operations currently do not). The result obeys the following contract: Unioning a set of s has the effect of fully noding and dissolving the linework. Unioning a set of s always returns a geometry (unlike ), which may return geometries of lower dimension if a topology collapse occurred). Thrown if a robustness error occurs Returns true if the two Geometrys are exactly equal, up to a specified tolerance. Two Geometries are exactly within a tolerance equal if: they have the same class, they have the same values of Coordinates, within the given tolerance distance, in their internal Coordinate lists, in exactly the same order. This method does not test the values of the GeometryFactory, the SRID, or the UserData fields. To properly test equality between different geometries, it is usually necessary to them first. The Geometry with which to compare this Geometry have identical structure and point values, up to the distance tolerance. Distance at or below which two Coordinates will be considered equal. true if this and the other Geometry are of the same class and have equal internal data. Returns true if the two Geometrys are exactly equal. Two Geometries are exactly equal if: they have the same class, they have the same values of Coordinates in their internal Coordinate lists, in exactly the same order. This provides a stricter test of equality than , which is more useful in certain situations (such as using geometries as keys in collections). This method does not test the values of the GeometryFactory, the SRID, or the UserData fields. To properly test equality between different geometries, it is usually necessary to them first. The Geometry with which to compare this Geometry. true if this and the other Geometry have identical structure and point values. Tests whether two geometries are exactly equal in their normalized forms. This is a convenience method which creates normalized versions of both geometries before computing . This method is relatively expensive to compute. For maximum performance, the client should instead perform normalization on the individual geometries at an appropriate point during processing. A geometry true if the input geometries are exactly equal in their normalized form Performs an operation with or on this Geometry's coordinates. If this method modifies any coordinate values, must be called to update the geometry state. Note that you cannot use this method to modify this Geometry if its underlying CoordinateSequence's #get method returns a copy of the Coordinate, rather than the actual Coordinate stored (if it even stores Coordinate objects at all). The filter to apply to this Geometry's coordinates Performs an operation on the coordinates in this Geometry's s. If the filter reports that a coordinate value has been changed, will be called automatically. The filter to apply Performs an operation with or on this Geometry and its subelement Geometrys (if any). Only GeometryCollections and subclasses have subelement Geometry's. The filter to apply to this Geometry (and its children, if it is a GeometryCollection). Performs an operation with or on this Geometry and its component Geometry's. Only GeometryCollections and Polygons have component Geometry's; for Polygons they are the LinearRings of the shell and holes. The filter to apply to this Geometry. Converts this Geometry to normal form (or canonical form ). Normal form is a unique representation for Geometrys. It can be used to test whether two Geometrys are equal in a way that is independent of the ordering of the coordinates within them. Normal form equality is a stronger condition than topological equality, but weaker than pointwise equality. The definitions for normal form use the standard lexicographical ordering for coordinates. "Sorted in order of coordinates" means the obvious extension of this ordering to sequences of coordinates. NOTE that this method mutates the value of this geometry in-place. If this is not safe and/or wanted, the geometry should be cloned prior to normalization. Creates a new Geometry which is a normalized copy of this Geometry. A normalized copy of this geometry. Returns whether this Geometry is greater than, equal to, or less than another Geometry. If their classes are different, they are compared using the following ordering: Point (lowest), MultiPoint, LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, GeometryCollection (highest). If the two Geometrys have the same class, their first elements are compared. If those are the same, the second elements are compared, etc. A Geometry with which to compare this Geometry A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the NTS Technical Specifications. Returns whether this Geometry is greater than, equal to, or less than another Geometry. If their classes are different, they are compared using the following ordering: Point (lowest), MultiPoint, LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, GeometryCollection (highest). If the two Geometrys have the same class, their first elements are compared. If those are the same, the second elements are compared, etc. A Geometry with which to compare this Geometry A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the NTS Technical Specifications. Returns whether this Geometry is greater than, equal to, or less than another Geometry, using the given . If their classes are different, they are compared using the following ordering: Point (lowest), MultiPoint, LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, GeometryCollection (highest). If the two Geometrys have the same class, their first elements are compared. If those are the same, the second elements are compared, etc. A Geometry with which to compare this Geometry A IComparer<ICoordinateSequence> A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the NTS Technical Specifications. Returns whether the two Geometrys are equal, from the point of view of the EqualsExact method. Called by EqualsExact . In general, two Geometry classes are considered to be "equivalent" only if they are the same class. An exception is LineString , which is considered to be equivalent to its subclasses. The Geometry with which to compare this Geometry for equality. true if the classes of the two Geometry s are considered to be equal by the equalsExact method. Throws an exception if g's class is GeometryCollection. (its subclasses do not trigger an exception). The Geometry to check. if g is a GeometryCollection, but not one of its subclasses. Returns true if g's class is GeometryCollection. (its subclasses do not trigger an exception). The Geometry to check. If g is a GeometryCollection, but not one of its subclasses. Returns the minimum and maximum x and y values in this Geometry, or a null Envelope if this Geometry is empty. Unlike EnvelopeInternal, this method calculates the Envelope each time it is called; EnvelopeInternal caches the result of this method. This Geometrys bounding box; if the Geometry is empty, Envelope.IsNull will return true. Returns whether this Geometry is greater than, equal to, or less than another Geometry having the same class. A Geometry having the same class as this Geometry. A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the NTS Technical Specifications. Returns whether this Geometry is greater than, equal to, or less than another Geometry of the same class. using the given . A Geometry having the same class as this Geometry The comparer A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the JTS Technical Specifications Returns the first non-zero result of CompareTo encountered as the two Collections are iterated over. If, by the time one of the iterations is complete, no non-zero result has been encountered, returns 0 if the other iteration is also complete. If b completes before a, a positive number is returned; if a before b, a negative number. A Collection of IComparables. A Collection of IComparables. The first non-zero compareTo result, if any; otherwise, zero. A predefined with == . Gets the factory which contains the context in which this point was created. The factory for this point. Gets/Sets the user data object for this point, if any. A simple scheme for applications to add their own custom data to a Geometry. An example use might be to add an object representing a Coordinate Reference System. Note that user data objects are not present in geometries created by construction methods. Sets the ID of the Spatial Reference System used by the Geometry. NOTE: This method should only be used for exceptional circumstances or for backwards compatibility. Normally the SRID should be set on the used to create the geometry. SRIDs set using this method will not be propagated to geometries returned by constructive methods. Returns the name of this Geometry's actual class. The name of this Geometrys actual class. Gets the OGC geometry type Returns the PrecisionModel used by the Geometry. the specification of the grid of allowable points, for this Geometry and all other Geometrys. Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. a Coordinate which is a vertex of this Geometry. null if this Geometry is empty. Returns an array containing the values of all the vertices for this geometry. If the geometry is a composite, the array will contain all the vertices for the components, in the order in which the components occur in the geometry. In general, the array cannot be assumed to be the actual internal storage for the vertices. Thus modifying the array may not modify the geometry itself. Use the method (possibly on the components) to modify the underlying data. If the coordinates are modified, must be called afterwards. The vertices of this Geometry. Returns the count of this Geometrys vertices. The Geometry s contained by composite Geometrys must be Geometry's; that is, they must implement NumPoints. The number of vertices in this Geometry. Returns the number of Geometryes in a GeometryCollection, or 1, if the geometry is not a collection. Tests whether this is simple. The SFS definition of simplicity follows the general rule that a Geometry is simple if it has no points of self-tangency, self-intersection or other anomalous points. Simplicity is defined for each subclass as follows: Valid polygonal geometries are simple, since their rings must not self-intersect. IsSimple tests for this condition and reports false if it is not met. (This is a looser test than checking for validity). Linear rings have the same semantics. Linear geometries are simple iff they do not self-intersect at points other than boundary points. Zero-dimensional geometries (points) are simple iff they have no repeated points. Empty Geometrys are always simple. true if this Geometry is simple Tests whether this Geometry is topologically valid, according to the OGC SFS specification. For validity rules see the documentation for the specific geometry subclass. true if this Geometry is valid. Tests whether the set of points covered in this Geometry is empty. true if this Geometry does not cover any points. Returns the area of this Geometry. Areal Geometries have a non-zero area. They override this function to compute the area. Others return 0.0 The area of the Geometry. Returns the length of this Geometry. Linear geometries return their length. Areal geometries return their perimeter. They override this function to compute the length. Others return 0.0 The length of the Geometry. Computes the centroid of this Geometry. The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid). The centroid of an empty geometry is POINT EMPTY. A Point which is the centroid of this Geometry. Computes an interior point of this Geometry. An interior point is guaranteed to lie in the interior of the Geometry, if it possible to calculate such a point exactly. Otherwise, the point may lie on the boundary of the point. The interior point of an empty geometry is POINT EMPTY. A Point which is in the interior of this Geometry. Returns the dimension of this geometry. The dimension of a geometry is is the topological dimension of its embedding in the 2-D Euclidean plane. In the NTS spatial model, dimension values are in the set {0,1,2}. Note that this is a different concept to the dimension of the vertex s. The geometry dimension can never be greater than the coordinate dimension. For example, a 0-dimensional geometry (e.g. a Point) may have a coordinate dimension of 3 (X,Y,Z). The topological dimensions of this geometry Returns the boundary, or an empty geometry of appropriate dimension if this Geometry is empty. For a discussion of this function, see the OpenGIS Simple Features Specification. As stated in SFS Section 2.1.13.1, "the boundary of a Geometry is a set of Geometries of the next lower dimension." The closure of the combinatorial boundary of this Geometry. NOTE: make abstract, remove setter and change geoapi Returns the dimension of this Geometrys inherent boundary. The dimension of the boundary of the class implementing this interface, whether or not this object is the empty point. Returns Dimension.False if the boundary is the empty point. NOTE: make abstract, remove setter and change geoapi Gets a geometry representing the envelope (bounding box) of this Geometry. If this Geometry is empty, returns an empty Point a point, returns a Point a line parallel to an axis, a two-vertex LineString, otherwise, returns a Polygon whose vertices are (minx, miny), (maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny). A Geometry representing the envelope of this Geometry Gets an containing the minimum and maximum x and y values in this Geometry. If the geometry is empty, an empty Envelope is returned. The returned object is a copy of the one maintained internally, to avoid aliasing issues. For best performance, clients which access this envelope frequently should cache the return value. the envelope of this Geometry. An empty Envelope if this Geometry is empty Extension Methods for geometries Function to encode to an array of s. If assigned, is used. The geometry to encode The writer to use An array of s, that represent Delegate function declaration to handle filter operation The geometry to filter An implementation that applies filtering with the provided Creates an instance of this class The filter method to be used OGC compliant geometry factory Supplies a set of utility methods for building Geometry objects from lists of Coordinates. Note that the factory constructor methods do not change the input coordinates in any way. In particular, they are not rounded to the supplied PrecisionModel. It is assumed that input Coordinates meet the given precision. A predefined with == . A predefined with == . A shortcut for . A predefined with == . A predefined with == . Constructs a GeometryFactory that generates Geometries having the given PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision floating PrecisionModel and a spatial-reference ID of 0. Constructs a GeometryFactory that generates Geometries having the given {PrecisionModel} and the default CoordinateSequence implementation. The PrecisionModel to use. Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and spatial-reference ID, and the default CoordinateSequence implementation. The PrecisionModel to use. The SRID to use. Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0. Converts the ICollection to an array. The ICollection of Points to convert. The ICollection in array format. Converts the ICollection to an array. The ICollection of Geometry's to convert. The ICollection in array format. Converts the ICollection to an array. The ICollection of LineStrings to convert. The ICollection in array format. Converts the ICollection to an array. The ICollection of LinearRings to convert. The ICollection in array format. Converts the ICollection to an array. The ICollection of Polygons to convert. The ICollection in array format. Converts the ICollection to an array. The ICollection of MultiPoints to convert. The ICollection in array format. Converts the ICollection to an array. The ICollection of MultiLineStrings to convert. The ICollection in array format. Converts the ICollection to an array. The ICollection of MultiPolygons to convert. The ICollection in array format. Creates a with the same extent as the given envelope. The Geometry returned is guaranteed to be valid. To provide this behaviour, the following cases occur: If the Envelope is:
  • null returns an empty
  • a point returns a non-empty
  • a line returns a two-point
  • a rectangle returns a whose points are (minx, maxy), (minx, maxy), (maxx, maxy), (maxx, miny).
The Envelope An empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases)
Creates a Point using the given Coordinate. A null coordinate creates an empty Geometry. a Coordinate, or null A object Creates a Point using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty Point. a CoordinateSequence (possibly empty), or null A object Creates a LineString using the given Coordinates. A null or empty array creates an empty LineString. An array without null elements, or an empty array, or null. A object Creates a LineString using the given CoordinateSequence. A null or empty CoordinateSequence creates an empty LineString. A CoordinateSequence (possibly empty), or null. A object Creates a LinearRing using the given Coordinates; a null or empty array creates an empty LinearRing. The points must form a closed and simple linestring. Consecutive points must not be equal. An array without null elements, or an empty array, or null. A object If the ring is not closed, or has too few points Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence creates an empty LinearRing. The points must form a closed and simple linestring. Consecutive points must not be equal. A CoordinateSequence (possibly empty), or null. A object If the ring is not closed, or has too few points Constructs a Polygon with the given exterior boundary and interior boundaries. The outer boundary of the new Polygon, or null or an empty LinearRing if the empty point is to be created. The inner boundaries of the new Polygon, or null or empty LinearRing s if the empty point is to be created. A object Constructs a Polygon with the given exterior boundary. the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created. A object If the boundary ring is invalid Constructs a Polygon with the given exterior boundary. the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created. A object If the boundary ring is invalid Constructs a Polygon with the given exterior boundary. the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created. the created Polygon If the boundary ring is invalid Creates a using the given Points. A null or empty array will create an empty MultiPoint. An array (without null elements), or an empty array, or null. A object Creates a using the given Coordinates. A null or empty array will create an empty MultiPoint. An array (without null elements), or an empty array, or null A object Creates a using the given CoordinateSequence. A null or empty CoordinateSequence will create an empty MultiPoint. A CoordinateSequence (possibly empty), or null. A object Creates a MultiLineString using the given LineStrings; a null or empty array will create an empty MultiLineString. LineStrings, each of which may be empty but not null- A object Creates a MultiPolygon using the given Polygons; a null or empty array will create an empty Polygon. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL. Polygons, each of which may be empty but not null. A object Creates a GeometryCollection using the given Geometries; a null or empty array will create an empty GeometryCollection. an array of Geometries, each of which may be empty but not null, or null A object Build an appropriate Geometry, MultiGeometry, or GeometryCollection to contain the Geometrys in it. If geomList contains a single Polygon, the Polygon is returned.
If geomList contains several Polygons, a MultiPolygon is returned.
If geomList contains some Polygons and some LineStrings, a GeometryCollection is returned.
If geomList is empty, an empty GeometryCollection is returned. Note that this method does not "flatten" Geometries in the input, and hence if any MultiGeometries are contained in the input a GeometryCollection containing them will be returned.
The Geometry to combine. A of the "smallest", "most type-specific" class that can contain the elements of geomList.
Creates a deep copy of the input . The defined for this factory is used to copy the s of the input geometry. This is a convenient way to change the CoordinateSequence used to represent a geometry, or to change the factory used for a geometry. can also be used to make a deep copy, but it does not allow changing the CoordinateSequence type. The geometry A deep copy of the input geometry, using the CoordinateSequence type of this factory Returns the PrecisionModel that Geometries created by this factory will be associated with. The SRID value defined for this factory. Creates an instance of this class using the default values for , and . Creates an instance of this class using the default values for , , but the specified . Creates an instance of this class using the default values for , but the specified . The is guaranteed to be orientated counter-clockwise. The is guaranteed to be orientated counter-clockwise. The is guaranteed to be orientated counter-clockwise. The is guaranteed to be orientated counter-clockwise.
The are guaranteed to be orientated clockwise.
Methods to map various collections of s via defined mapping functions. Martin Davis Maps the members of a (which may be atomic or composite) into another Geometry of most specific type. null results are skipped. In the case of hierarchical s, only the first level of members are mapped. The input atomic or composite geometry The mapping operation delegate A result collection or geometry of most specific type Maps the members of a (which may be atomic or composite) into another Geometry of most specific type. null results are skipped. In the case of hierarchical s, only the first level of members are mapped. The input atomic or composite geometry The mapping operation A result collection or geometry of most specific type An interface for geometry functions used for mapping. Martin Davis Computes a new geometry value. The input geometry A result geometry Represents an (1-dimensional) closed interval on the Real number line. Creates a new interval instance, setting ==0d; Creates a new interval instance, setting = and =; The minimum value The maximum value Creates a new interval instance, setting = and =. Method to initialize the interval with the given and values.
If < , their values are exchanged.
The minimum value The maximum value
Method to expand this interval to contain . The interval to contain. Function to test if this overlaps . The interval to test true if this interval overlaps Function to test if this overlaps the interval R[, ]. The mimimum value of the interval The maximum value of the interval true if this interval overlaps the interval R[, ] Function to test if this contains . This is more rigid than The interval to test true if this interval contains Function to test if this contains the interval R[, ]. This is more rigid than The mimimum value of the interval The maximum value of the interval true if this interval contains the interval R[, ] Function to test if this contains the value . The value to test true if this interval contains the value Gets or sets a value indicating the minimum value of the closed interval. Gets or sets a value indicating the maximum value of the closed interval. Gets the width of the interval ( - ) Gets the centre of the interval ( + * 0.5d) A visitor for s in a index. 1.7 Visits a node. The node to visit A contiguous portion of 1D-space. Used internally by SIRtree. this this Writes a formatted string containing the KML representation of a JTS . The output is KML fragments which can be substituted wherever the KML abstract element can be used. Output elements are indented to provide a nicely-formatted representation. An output line prefix and maximum number of coordinates per line can be specified. The Z ordinate value output can be forced to be a specific value. The and modes can be set. If set, the corresponding sub-elements will be output. The KML standard value clampToGround for use in . The KML standard value relativeToGround for use in . The KML standard value absolute for use in . Writes a Geometry as KML to a string, using a specified Z value. the geometry to write the Z value to use a string containing the KML geometry representation Writes a Geometry as KML to a string, using a specified Z value, precision, extrude flag, and altitude mode code. the geometry to write the Z value to use the maximum number of decimal places to write the extrude flag to write the altitude model code to write a string containing the KML geometry representation Writes a in KML format as a string. the geometry to write a string containing the KML geometry representation Writes the KML representation of a to a . the geometry to write the writer to write to Appends the KML representation of a to a . the geometry to write the buffer to write into Takes a list of coordinates and converts it to KML. 2D and 3D aware. Terminates the coordinate output with a newline. A tag string which is prefixed to every emitted text line. This can be used to indent the geometry text in a containing document. The maximum number of coordinates to output per line. The Z value to be output for all coordinates. This overrides any Z value present in the Geometry coordinates. The flag to be output in the extrude element. The flag to be output in the tesselate element. The value output in the altitudeMode element. The maximum number of decimal places to output in ordinate values. Useful for limiting output size. negative values set the precision to , like standard behavior. Reads a sequence of {@link Geometry}s in WKBHex format from a text file. Each WKBHex geometry must be on a single line The geometries in the file may be separated by any amount of whitespace and newlines. Martin Davis Creates a new given the to use to parse the geometries. The geometry reader to use Reads a sequence of geometries.
If an is specified, geometries read up to the offset count are skipped. If a is specified, no more than geometries are read.
The path to the file Thrown if no filename was specified Thrown if the filename specified does not exist Thrown if an I/O exception was encountered Thrown if an error occured reading a geometry
Reads a sequence of geometries.
If an is specified, geometries read up to the offset count are skipped. If a is specified, no more than geometries are read.
The path to the file Thrown if no stream was passed Thrown if passed stream is not readable or seekable Thrown if an I/O exception was encountered Thrown if an error occured reading a geometry
Reads a sequence of geometries.
If an is specified, geometries read up to the offset count are skipped. If a is specified, no more than geometries are read.
The stream reader to use. Thrown if an I/O exception was encountered Thrown if an error occured reading a geometry
Tests if reader has reached limit A collection of already read geometries true if number of geometries has been read. Tests if reader is at EOF. Gets or sets a value indicating the maximum number of geometries to read Gets or sets the number of geometries to skip before storing. Enumeration for the 3 coordinate planes Models a plane in 3-dimensional Cartesian space. Martin Davis Computes the oriented distance from a point to the plane.
The distance is: positive if the point lies above the plane (relative to the plane normal) zero if the point is on the plane negative if the point lies below the plane (relative to the plane normal)
The point to compute the distance for The oriented distance to the plane
Computes the axis plane that this plane lies closest to. Geometries lying in this plane undergo least distortion (and have maximum area) when projected to the closest axis plane. This provides optimal conditioning for computing a Point-in-Polygon test. The index of the closest axis plane Represents a vector in 3-dimensional Cartesian space. Martin Davis Computes the dot product of the 3D vectors AB and CD. A coordinate A coordinate A coordinate A coordinate The dot product Creates a new vector with given , and components. The x component The y component The z component A new vector Creates a new vector from a . The coordinate to copy A new vector Computes the 3D dot-product of two s The 1st vector The 2nd vector The dot product of the (coordinate) vectors Creates a vector, that is the difference of and The origin coordinate The destination coordinate Creates a vector with the ordinates , and The x-ordinate The y-ordinate The z-ordinate Computes the dot-product of this and The 2nd vector The dot product of the vectors Function to compute the length of this vector The length of this vector Function to compute the length of vector . A coordinate, treated as vector The length of Function to compute a normalized form of this vector A normalized form of this vector Function to devide all dimensions of this vector by . The divisor A new (divided) vector Function to compute a normalized form of vector . A coordinate vector A normalized form of Gets a value indicating the x-ordinate Gets a value indicating the y-ordinate Gets a value indicating the z-ordinate Finds interior intersections between line segments in s, and adds them as nodes using . This class is used primarily for Snap-Rounding. For general-purpose noding, use . Processes possible intersections detected by a . The is passed to a . The method is called whenever the detects that two s might intersect. This class may be used either to find all intersections, or to detect the presence of an intersection. In the latter case, Noders may choose to short-circuit their computation by calling the property. This class is an example of the Strategy pattern. This class may be used either to find all intersections, or to detect the presence of an intersection. In the latter case, Noders may choose to short-circuit their computation by calling the property. This method is called by clients of the interface to process intersections for two segments of the s being intersected. Reports whether the client of this class needs to continue testing all intersections in an arrangement. if there is no need to continue testing segments Creates an intersection finder which finds all proper intersections. The to use. This method is called by clients of the class to process intersections for two segments of the s being intersected.
Note that some clients (such as MonotoneChains) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).
Always process all intersections Intersects two sets of s using brute-force comparison. An intersector for the red-blue intersection problem. In this class of line arrangement problem, two disjoint sets of linestrings are intersected. Implementing classes must provide a way of supplying the base set of segment strings to test against (e.g. in the constructor, for straightforward thread-safety). In order to allow optimizing processing, the following condition is assumed to hold for each set: the only intersection between any two linestrings occurs at their endpoints. Implementations can take advantage of this fact to optimize processing (i.e by avoiding testing for intersections between linestrings belonging to the same set). Computes the intersections with a given set of s, using the supplied . A collection of s to node The intersection detector to either record intersection occurences or add intersection nodes to the input segment strings. Constructs a new intersector for a given set of s. The base segment strings to intersect Calls for all candidate intersections between the given collection of SegmentStrings and the set of base segments. A collection of s to node The intersection detector to either record intersection occurences or add intersection nodes to the input segment strings. Processes all of the segment pairs in the given segment strings using the given SegmentIntersector. A segment string A segment string The segment intersector to use A geometry service provider class Creates an instance of this class, using the as default and a precision model. No is specified Creates an instance of this class, using the provided , and spatial reference Id (. The coordinate sequence factory to use. The precision model. The default spatial reference ID Creates a precision model based on given precision model type The precision model type Creates a precision model based on given precision model. The precision model Creates a precision model based on the given scale factor. The scale factor The precision model. Gets or sets the current instance Gets the default spatial reference id Gets or sets the coordiate sequence factory to use Gets or sets the default precision model Gets a value representing the number of geometry factories that have been stored in the cache A pair of s, whose leaf items support a distance metric between them. Used to compute the distance between the members, and to expand a member relative to the other in order to produce new branches of the Branch-and-Bound evaluation tree. Provides an ordering based on the distance between the members, which allows building a priority queue by minimum distance. Martin Davis Creates an instance of this class with the given s and the function. The first boundable The second boundable The item distance function Gets one of the member s in the pair (indexed by [0, 1]). The index of the member to return (0 or 1) The chosen member Computes the distance between the s in this pair. The boundables are either composites or leaves. If either is composite, the distance is computed as the minimum distance between the bounds. If both are leaves, the distance is computed by . The distance between the s in this pair. Compares two pairs based on their minimum distances For a pair which is not a leaf (i.e. has at least one composite boundable) computes a list of new pairs from the expansion of the larger boundable. Gets the minimum possible distance between the Boundables in this pair. If the members are both items, this will be the exact distance between them. Otherwise, this distance will be a lower bound on the distances between the items in the members. The exact or lower bound distance for this pair Tests if both elements of the pair are leaf nodes An function for items which are using the method. Martin Davis A function method which computes the distance between two s in an . Used for Nearest Neighbour searches. Martin Davis Computes the distance between two items. The first item. The second item. If the metric is not applicable to the arguments The distance between and . Computes the distance between two items, using the method. An item which is a geometry. An item which is a geometry. if either item is not a Geometry The distance between the two items. Implements extended-precision floating-point numbers which maintain 106 bits (approximately 30 decimal digits) of precision. A DoubleDouble uses a representation containing two double-precision values. A number x is represented as a pair of doubles, x.hi and x.lo, such that the number represented by x is x.hi + x.lo, where
                |x.lo| <= 0.5*ulp(x.hi)
            
and ulp(y) means "unit in the last place of y". The basic arithmetic operations are implemented using convenient properties of IEEE-754 floating-point arithmetic. The range of values which can be represented is the same as in IEEE-754. The precision of the representable numbers is twice as great as IEEE-754 double precision. The correctness of the arithmetic algorithms relies on operations being performed with standard IEEE-754 double precision and rounding. This is the Java standard arithmetic model, but for performance reasons Java implementations are not constrained to using this standard by default. Some processors (notably the Intel Pentium architecure) perform floating point operations in (non-IEEE-754-standard) extended-precision. A JVM implementation may choose to use the non-standard extended-precision as its default arithmetic mode. To prevent this from happening, this code uses the Java strictfp modifier, which forces all operations to take place in the standard IEEE-754 rounding model. The API provides both a set of value-oriented operations and a set of mutating operations. Value-oriented operations treat DoubleDouble values as immutable; operations on them return new objects carrying the result of the operation. This provides a simple and safe semantics for writing DoubleDouble expressions. However, there is a performance penalty for the object allocations required. The mutable interface updates object values in-place. It provides optimum memory performance, but requires care to ensure that aliasing errors are not created and constant values are not changed. This implementation uses algorithms originally designed variously by Knuth, Kahan, Dekker, and Linnainmaa. Douglas Priest developed the first C implementation of these techniques. Other more recent C++ implementation are due to Keith M. Briggs and David Bailey et al.

References

Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic, in P. Kornerup and D. Matula, Eds., Proc. 10th Symposium on Computer Arithmetic, IEEE Computer Society Press, Los Alamitos, Calif., 1991. Yozo Hida, Xiaoye S. Li and David H. Bailey, Quad-Double Arithmetic: Algorithms, Implementation, and Application, manuscript, Oct 2000; Lawrence Berkeley National Laboratory Report BNL-46996. David Bailey, High Precision Software Directory; http://crd.lbl.gov/~dhbailey/mpdist/index.html
Martin Davis
The value to split a double-precision value on during multiplication The value nearest to the constant Pi. The value nearest to the constant 2 * Pi. The value nearest to the constant Pi / 2. The value nearest to the constant e (the natural logarithm base). A value representing the result of an operation which does not return a valid number. The smallest representable relative difference between two values Converts the string argument to a DoubleDouble number. A string containing a representation of a numeric value The extended precision version of the value Thrown if is not a valid representation of a number Converts the double argument to a DoubleDouble number. @param x a numeric value @return the extended precision version of the value The high-order component of the double-double precision value. The low-order component of the double-double precision value. Creates a new with value x. The initial value Creates a new with value (hi, lo). The high order component The low order component Creates a with a value equal to the argument The initial value Creates a new DoubleDouble with value equal to the argument. @param str the value to initialize by @throws NumberFormatException if str is not a valid representation of a number Creates a new with the value of the argument. The value to copy A copy of Creates and returns a copy of this value. Acopy of this value Returns a whose value is (this + ) The addende"/> (this + ) Returns the sum of and . The left hand side The right hand side The sum of and Returns the sum of and . The left hand side The right hand side The sum of and Returns the difference of and . The left hand side The right hand side The difference of and Returns the difference of and . The left hand side The right hand side The difference of and Returns a whose value is (this + y). The addend (this + y) Computes a new object whose value is (this - y). The subtrahend (this - y) Computes a new object whose value is (this - y). The subtrahend (this - y) Returns a whose value is -this. -this Returns a new DoubleDouble whose value is (this * y). @param y the multiplicand @return (this * y) Returns a new DoubleDouble whose value is (this * y). @param y the multiplicand @return (this * y) ** Computes a new whose value is (this / y). The divisor A new with the value (this / y) Computes a new whose value is (this / y). The divisor A new with the value (this / y) ** Returns a DoubleDouble whose value is 1 / this. @return the reciprocal of this value Computes the minimum of this and another DD number. A DD number The minimum of the two numbers Computes the maximum of this and another DD number. A DD number The maximum of the two numbers Returns an integer indicating the sign of this value. if this value is > 0, returns 1 if this value is < 0, returns -1 if this value is = 0, returns 0 if this value is NaN, returns 0 An integer indicating the sign of this value Rounds this value to the nearest integer. The value is rounded to an integer by adding 1/2 and taking the floor of the result. Special cases: If this value is NaN, returns NaN. This value rounded to the nearest integer Returns the integer which is largest in absolute value and not further from zero than this value. Special cases: If this value is NaN, returns NaN. The integer which is largest in absolute value and not further from zero than this value Returns the absolute value of this value. Special cases: if this value is NaN, it is returned. The absolute value of this value Computes the square of this value. The square of this value Computes the square of this value. The square of this value. Computes the positive square root of this value. If the number is NaN or negative, NaN is returned. @return the positive square root of this number. If the argument is NaN or less than zero, the result is NaN. Computes the value of this number raised to an integral power. Follows semantics of .Net Math.Pow as closely as possible. The integer exponent x raised to the integral power exp Converts this value to the nearest double-precision number. @return the nearest double-precision number to this value Converts this value to the nearest integer. @return the nearest integer to this value Gets a value indicating whether this object is positive or not Gets a value indicating whether this object is positive or not Tests whether this value is equal to another DoubleDouble value. @param y a DoubleDouble value @return true if this value = y Tests whether this value is greater than another DoubleDouble value. @param y a DoubleDouble value @return true if this value > y Tests whether this value is greater than or equals to another DoubleDouble value. @param y a DoubleDouble value @return true if this value >= y Tests whether this value is less than another DoubleDouble value. A DoubleDouble value true if this value is < Compares two DoubleDouble objects numerically. @return -1,0 or 1 depending on whether this value is less than, equal to or greater than the value of o Dumps the components of this number to a string. A string showing the components of the number Returns a string representation of this number, in either standard or scientific notation. If the magnitude of the number is in the range [ 10-3, 108 ] standard notation will be used. Otherwise, scientific notation will be used. A string representation of this number Returns the string representation of this value in standard notation. The string representation in standard notation Returns the string representation of this value in scientific notation. The string representation in scientific notation Extracts the significant digits in the decimal representation of the argument. A decimal point may be optionally inserted in the string of digits (as long as its position lies within the extracted digits - if not, the caller must prepend or append the appropriate zeroes and decimal point). @param y the number to extract ( >= 0) @param decimalPointPos the position in which to insert a decimal point @return the string containing the significant digits and possibly a decimal point Returns the string for this value if it has a known representation (e.g. NaN or 0.0). The string for this special number
or null if the number is not a special number
Determines the decimal magnitude of a number. The magnitude is the exponent of the greatest power of 10 which is less than or equal to the number. The number to find the magnitude of The decimal magnitude of Converts a string representation of a real number into a DoubleDouble value. The format accepted is similar to the standard Java real number syntax. It is defined by the following regular expression:
            [+|-] {digit} [ . {digit} ] [ ( e | E ) [+|-] {digit}+
            
The string to parse The value of the parsed number Thrown if str is not a valid representation of a number
Gets a value indicating whether this object is zero (0) or not Gets a value indicating whether this object is negative or not Various utility functions for mathematical and numerical operations. Clamps a double value to a given range. The value to clamp The minimum value of the range The maximum value of the range The clamped value Clamps a int value to a given range. The value to clamp The minimum value of the range The maximum value of the range The clamped value Computes the base-10 logarithm of a double value. If the argument is NaN or less than zero, then the result is NaN. If the argument is positive infinity, then the result is positive infinity. If the argument is positive zero or negative zero, then the result is negative infinity. A positive number The value log a, the base-10 logarithm of the input value Computes the average of two numbers. A number A number The average of the inputs Computes the maximum fo three values A number A number A number The maximum value of , and Computes the maximum of four values A number A number A number A number The maximum value of , , and Computes the minimum of four values A number A number A number The minimum value of , and Computes the minimum of four values A number A number A number A number The minimum value of , , and Implements some 2D matrix operations (in particular, solving systems of linear equations). Martin Davis Solves a system of equations using Gaussian Elimination. In order to avoid overhead the algorithm runs in-place on - if should not be modified the client must supply a copy. An nxn matrix in row/column order )modified by this method) A vector of length n A vector containing the solution (if any)
or null if the system has no or no unique solution
If the matrix has the wrong size
A 2-dimensional mathematical vector represented by double-precision X and Y components. mbdavis Creates a new vector with given X and Y components. The x component The y component A new vector Creates a new vector from an existing one. The vector to copy A new vector Creates a vector from a . The coordinate to copy A new vector Creates a vector with the direction and magnitude of the difference between the and s. The origin coordinate The destination coordinate A new vector The X component of this vector. The Y component of this vector. Creates an new vector instance Creates a new vector instance using the provided and ordinates The x-ordinate value The y-ordinate value Creates a new vector instance based on . The vector Creates a new vector with the direction and magnitude of the difference between the and s. The origin coordinate The destination coordinate Creates a vector from a . The coordinate A new vector Adds to this vector instance. The vector to add The result vector Subtracts from this vector instance The vector to subtract The result vector Multiplies the vector by a scalar value. The value to multiply by A new vector with the value v * d Divides the vector by a scalar value. The value to divide by A new vector with the value v / d Negates this vector A new vector with [-_x, -_y] Normalizes the vector A new normalized vector Computes the weighted sum of this vector with another vector, with this vector contributing a fraction of frac to the total. In other words,
            sum = frac * this + (1 - frac) * v
            
The vector to sum The fraction of the total contributed by this vector The weighted sum of the two vectors
Computes the distance between this vector and another one. A vector The distance between the vectors Computes the dot-product of two vectors A vector The dot product of the vectors Computes the angle this vector describes to the horizontal axis The angle Rotates this vector by The angle The rotated vector Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 degrees or Pi/2 radians). A positive number rotates counter-clockwise, a negative number rotates clockwise. Under this operation the magnitude of the vector and the absolute values of the ordinates do not change, only their sign and ordinate index. The number of quarter-circles to rotate by The rotated vector. Gets a made of this vector translated by . The translation coordinate A coordinate Gets a from this vector A coordinate Creates a copy of this vector A copy of this vector Gets a string representation of this vector A string representing this vector Tests if a vector has the same values for the x and y components. A with which to do the comparison. true if is a with the same values for the X and Y components. Gets a hashcode for this vector. A hashcode for this vector Gets the x-ordinate value Gets the y-ordinate value Functions for performing vector mathematics. Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each triangle coordinate must have a Z value. If this is not the case, the returned Coordinate will have NaN values. The returned vector has unit length. A point A point A point The normal vector to the triangle -- Normalizes the vector The normalized Computes the cross product of and A vector A vector The cross product of and Computes the dot product of and A vector A vector The dot product of and Computes the determinant of a 2x2 matrix The m[0,0] value The m[0,1] value The m[1,0] value The m[1,1] value The determinant Helper class for transforming objects. Transforms a object. Transforms a object. Transforms a object. Transforms a object. Transforms a object. Transforms a object. Transforms a object. Transforms a object. Transforms a object. The factory to create the new The input The A transformed Transforms a object. The factory to create the new The input The A transformed Densifies a geometry by inserting extra vertices along the line segments contained in the geometry. All segments in the created densified geometry will be no longer than than the given distance tolerance. Densified polygonal geometries are guaranteed to be topologically correct. The coordinates created during densification respect the input geometry's . Note: At some future point this class will offer a variety of densification strategies. Martin Davis Densifies a geometry using a given distance tolerance, and respecting the input geometry's . The geometry densify The distance tolerance () The densified geometry Densifies a coordinate sequence. The coordinate sequence to densify The distance tolerance () The precision model to apply on the new coordinates The densified coordinate sequence Creates a new densifier instance The geometry to densify Gets the densified geometry. The densified geometry Gets or sets the distance tolerance for the densification. All line segments in the densified geometry will be no longer than the distance tolereance. Simplified geometry will be within this distance of the original geometry. The distance tolerance must be positive. A framework for processes which transform an input Geometry into an output , possibly changing its structure and type(s). This class is a framework for implementing subclasses which perform transformations on various different Geometry subclasses. It provides an easy way of applying specific transformations to given point types, while allowing unhandled types to be simply copied. Also, the framework handles ensuring that if subcomponents change type the parent geometries types change appropriately to maintain valid structure. Subclasses will override whichever TransformX methods they need to to handle particular Geometry types. A typically usage would be a transformation that may transform Polygons into Polygons, LineStrings or Points, depending on the geometry of the input (For instance, a simplification operation). This class would likely need to override the method to ensure that if input Polygons change type the result is a GeometryCollection, not a MultiPolygon. The default behaviour of this class is simply to recursively transform each Geometry component into an identical object by deep copying down to the level of, but not including, coordinates. Note that all TransformXXX methods may return null, to avoid creating empty point objects. This will be handled correctly by the transformer. TransformXXX methods should always return valid geometry - if they cannot do this they should return null (for instance, it may not be possible for a transformLineString implementation to return at least two points - in this case, it should return null). The method itself will always return a non-null Geometry object (but this may be empty). > true if empty geometries should not be included in the result. true if a homogenous collection result from a GeometryCollection should still be a general GeometryCollection. true if the type of the input should be preserved. Convenience method which provides standard way of creating a CoordinateSequence. The coordinate array to copy. A coordinate sequence for the array. Convenience method which provides statndard way of copying {CoordinateSequence}s The sequence to copy. A deep copy of the sequence. Transforms a . This method should always return a valid coordinate list for the desired result type. (E.g. a coordinate list for a LineString must have 0 or at least 2 points). If this is not possible, return an empty sequence - this will be pruned out. The coordinates to transform The parent geometry The transformed coordinates Makes the input geometry available Creates a valid area geometry from one that possibly has bad topology (i.e. self-intersections). Since buffer can handle invalid topology, but always returns valid geometry, constructing a 0-width buffer "corrects" the topology. Note this only works for area geometries, since buffer always returns areas. This also may return empty geometries, if the input has no actual area. An area geometry possibly containing self-intersections A valid area geometry Stores all attributes associated with a single Geometry feature. Gets the names Returns a string array containing all names of present attributes. Returns a object array containing all values of present attributes. Verifies if attribute specified already exists. Build a field with the given value and add it to attributes table. Name of the new attribute. Value for attribute (can be null). If attribute already exists. Delete the specified attribute from the table. Return the System.Type of the specified attribute, useful for casting values retrieved with GetValue methods. Get the value of the specified attribute. Set the value of the specified attribute. Get / Set the value of the specified attribute. Feature class Geometry representation of the feature. Attributes table of the feature. Angle orientation Constant representing no orientation Constant representing straight orientation Constant representing counterclockwise orientation Constant representing left orientation Constant representing clockwise orientation Constant representing right orientation Utility functions for working with angles. Unless otherwise noted, methods in this class express angles in radians. Converts from radians to degrees. An angle in radians The angle in degrees Converts from degrees to radians. An angle in degrees The angle in radians Returns the angle of the vector from p0 to p1, relative to the positive X-axis. The angle is normalized to be in the range [ -Pi, Pi ]. The start-point The end-point The normalized angle (in radians) that p0-p1 makes with the positive X-axis Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. The angle is normalized to be in the range ( -Pi, Pi ]. The point The normalized angle (in radians) that (0,0)-p makes with the positive X-axis. Tests whether the angle between p0-p1-p2 is acute. An angle is acute if it is less than 90 degrees. Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. An endpoint of the angle The base of the angle Another endpoint of the angle Tests whether the angle between p0-p1-p2 is obtuse An angle is obtuse if it is greater than 90 degrees. Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. An endpoint of the angle The base of the angle Another endpoint of the angle Returns the unoriented smallest angle between two vectors. The computed angle will be in the range [0, Pi). The tip of one vector The tail of each vector The tip of the other vector Returns the oriented smallest angle between two vectors. The computed angle will be in the range (-Pi, Pi]. A positive result corresponds to a rotation (CCW) from v1 to v2; a negative result corresponds to a (CW) rotation; a zero result corresponds to no rotation. The tip of v1 The tail of each vector The tip of v2 The angle between v1 and v2, relative to v1 Computes the interior angle between two segments of a ring. The ring is assumed to be oriented in a clockwise direction. The computed angle will be in the range [0, 2Pi] A point of the ring The next point of the ring The next point of the ring The interior angle based at p1 Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. An angle (in radians) An angle (in radians) Whether a1 must turn , or to overlap a2. Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. The angle to normalize An equivalent angle in the range (-Pi, Pi] Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). E.g. NormalizePositive(0.0) = 0.0 NormalizePositive(-PI) = NormalizePositive(-2PI) = 0.0 NormalizePositive(-3PI) = NormalizePositive(-4PI) = 0 NormalizePositive(PI) = NormalizePositive(2PI) = 0.0 NormalizePositive(3PI) = NormalizePositive(4PI) = 0.0 The angle to normalize, in radians. An equivalent positive angle Computes the unoriented smallest difference between two angles. The angles are assumed to be normalized to the range [-Pi, Pi]. The result will be in the range [0, Pi]. The angle of one vector (in [-Pi, Pi] ) The angle of the other vector (in range [-Pi, Pi] ) The angle (in radians) between the two vectors (in range [0, Pi] ) Useful utility functions for handling Coordinate arrays. Tests whether an array of s forms a ring, by checking length and closure. Self-intersection is not checked. An array of Coordinates true if the coordinate form a ring. Finds a in a list of s which is not contained in another list of s. The s to test. An array of s to test the input points against. A from which is not in , or null. Compares two arrays in the forward direction of their coordinates, using lexicographic ordering. Determines which orientation of the array is (overall) increasing. In other words, determines which end of the array is "smaller" (using the standard ordering on ). Returns an integer indicating the increasing direction. If the sequence is a palindrome, it is defined to be oriented in a positive direction. The array of Coordinates to test. 1 if the array is smaller at the start or is a palindrome, -1 if smaller at the end. Determines whether two arrays of equal length are equal in opposite directions. Creates a deep copy of the argument Coordinate array. Array of Coordinates. Deep copy of the input. Creates a deep copy of a given section of a source array into a destination Coordinate array. The destination array must be an appropriate size to receive the copied coordinates. An array of Coordinates The index to start copying from The array to receive the deep-copied coordinates The destination index to start copying to The number of items to copy Converts the given of s into a array. of coordinates. If contains not only s. Converts the given of s into a array. of coordinates. Returns whether Equals returns true for any two consecutive coordinates in the given array. Array of Coordinates. true if coord has repeated points; false otherwise. Returns either the given coordinate array if its length is greater than the given amount, or an empty coordinate array. Length amount. Array of Coordinates. New Coordinate array. If the coordinate array argument has repeated points, constructs a new array containing no repeated points. Otherwise, returns the argument. Collapses a coordinate array to remove all null elements. The coordinate array to collapse An Array containing only non-null elements Reverses the coordinates in an array in-place. Array of Coordinates. Returns true if the two arrays are identical, both null, or pointwise equal (as compared using Coordinate.Equals). First array of Coordinates. Second array of Coordinates. true if two Coordinates array are equals; false otherwise Returns true if the two arrays are identical, both null, or pointwise equal, using a user-defined for s. An array of s. Another array of s. A for s. Returns the minimum coordinate, using the usual lexicographic comparison. Array to search. The minimum coordinate in the array, found using CompareTo. Shifts the positions of the coordinates until firstCoordinate is first. Array to rearrange. Coordinate to make first. Returns the index of in . The first position is 0; the second is 1; etc. A to search for. A array to search. The position of coordinate, or -1 if it is not found. Extracts a subsequence of the input array from indices to (inclusive). The input indices are clamped to the array size; If the end index is less than the start index, the extracted array will be empty. The input array. The index of the start of the subsequence to extract. The index of the end of the subsequence to extract. A subsequence of the input array. Computes the of the coordinates. the array to scan. the of the . Extracts the coordinates which intersect an {@link Envelope}. @param coordinates the coordinates to scan @param env the envelope to intersect with @return an array of the coordinates which intersect the envelope Compares two arrays in the forward direction of their coordinates, using lexicographic ordering. Compares the specified s arrays. A comparator for arrays modulo their directionality. E.g. if two coordinate arrays are identical but reversed they will compare as equal under this ordering. If the arrays are not equal, the ordering returned is the ordering in the forward direction. A backed by an array of s. This is the implementation that s use by default. Coordinates returned by , and are live -- modifications to them are actually changing the CoordinateSequence's underlying data. A dimension may be specified for the coordinates in the sequence, which may be 2 or 3. The actual coordinates will always have 3 ordinates, but the dimension is useful as metadata in some situations. The actual dimension of the coordinates in the sequence. Allowable values are 2 or 3. Constructs a sequence based on the given array of s. The coordinate dimension is 3 The array is not copied. The coordinate array that will be referenced. Constructs a sequence based on the given array of s. The Array is not copied The coordinate array that will be referenced. The dimension of the coordinates Constructs a sequence of a given size, populated with new Coordinates. The size of the sequence to create. Constructs a sequence of a given , populated with new s of the given . The size of the sequence to create. the dimension of the coordinates Creates a new sequence based on a deep copy of the given . The coordinate sequence that will be copied Get the Coordinate with index i. The index of the coordinate. The requested Coordinate instance. Get a copy of the Coordinate with index i. The index of the coordinate. A copy of the requested Coordinate. Copies the i'th coordinate in the sequence to the supplied Coordinate. The index of the coordinate to copy. A Coordinate to receive the value. Returns ordinate X (0) of the specified coordinate. The value of the X ordinate in the index'th coordinate. Returns ordinate Y (1) of the specified coordinate. The value of the Y ordinate in the index'th coordinate. Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinate indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values). The coordinate index in the sequence. The ordinate index in the coordinate (in range [0, dimension-1]). Creates a deep copy of the object. The deep copy. Sets the value for a given ordinate of a coordinate in this sequence. The coordinate index in the sequence. The ordinate index in the coordinate (in range [0, dimension-1]). The new ordinate value. This method exposes the internal Array of Coordinate Objects. Expands the given Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values. The envelope to expand. A reference to the expanded envelope. Returns the string representation of the coordinate array. Returns the dimension (number of ordinates in each coordinate) for this sequence. Returns the length of the coordinate sequence. Creates CoordinateSequences represented as an array of Coordinates. Returns a CoordinateArraySequence based on the given array (the array is not copied). the coordinates, which may not be null nor contain null elements. Returns the singleton instance of CoordinateArraySequenceFactory. A list of Coordinates, which may be set to prevent repeated coordinates from occuring in the list. Constructs a new list without any coordinates Constructs a new list from an array of Coordinates, allowing repeated points. (I.e. this constructor produces a with exactly the same set of points as the input array.) Initial coordinates Constructs a new list from a collection of Coordinates, allows repeated points. Collection of coordinates to load into the list. Constructs a new list from a collection of Coordinates, allowing caller to specify if repeated points are to be removed. Collection of coordinates to load into the list. If false, repeated points are removed. Constructs a new list from an array of Coordinates, allowing caller to specify if repeated points are to be removed. Array of coordinates to load into the list. If false, repeated points are removed. Returns the coordinate at specified index. Coordinate index. Coordinate specified. Adds a section of an array of coordinates to the list. The coordinates If set to false, repeated coordinates are collapsed The index to start from The index to add up to but not including true (as by general collection contract) Adds an array of coordinates to the list. Coordinates to be inserted. If set to false, repeated coordinates are collapsed. If false, the array is added in reverse order. Return true. Adds an array of coordinates to the list. Coordinates to be inserted. If set to false, repeated coordinates are collapsed. Return true. Adds a coordinate to the list. Coordinate to be inserted, as object. If set to false, repeated coordinates are collapsed. Return true. Adds a coordinate to the end of this list. Coordinate to be inserted. If set to false, repeated coordinates are collapsed. Return true if all ok. Inserts the specified coordinate at the specified position in this list. The position at which to insert the coordinate to insert if set to false, repeated coordinates are collapsed Add an array of coordinates. Coordinates collection to be inserted. If set to false, repeated coordinates are collapsed. Return true if at least one element has added (IList not empty). Ensure this coordList is a ring, by adding the start point if necessary. Returns the Coordinates in this collection. Coordinater as Coordinate[] array. Returns a deep copy of this collection. The copied object. Compares two s. For sequences of the same dimension, the ordering is lexicographic. Otherwise, lower dimensions are sorted before higher. The dimensions compared can be limited; if this is done ordinate dimensions above the limit will not be compared. If different behaviour is required for comparing size, dimension, or coordinate values, any or all methods can be overridden. Compare two doubles, allowing for NaN values. NaN is treated as being less than any valid number. A double A double -1, 0, or 1 depending on whether a is less than, equal to or greater than b The number of dimensions to test Creates a comparator which will test all dimensions. @param dimensionLimit Creates a comparator which will test only the specified number of dimensions. The number of dimensions to test Compares two s for relative order. A coordinate sequence A coordinate sequence -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 Compares the same coordinate of two s A coordinate sequence A coordinate sequence The index of the coordinate to test the number of dimensiosn to test Compares two s for relative order. A coordinate sequence A coordinate sequence -1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2 Utility functions for manipulating s. Reverses the coordinates in a sequence in-place. Swaps two coordinates in a sequence. seq the sequence to modify the index of a coordinate to swap the index of a coordinate to swap Copies a section of a to another . The sequences may have different dimensions; in this case only the common dimensions are copied. The sequence to copy coordinates from The starting index of the coordinates to copy The sequence to which the coordinates should be copied to The starting index of the coordinates in The number of coordinates to copy Copies a coordinate of a to another . The sequences may have different dimensions; in this case only the common dimensions are copied. The sequence to copy coordinate from The index of the coordinate to copy The sequence to which the coordinate should be copied to The index of the coordinate in Tests whether a forms a valid , by checking the sequence length and closure (whether the first and last points are identical in 2D). Self-intersection is not checked. The sequence to test True if the sequence is a ring Ensures that a CoordinateSequence forms a valid ring, returning a new closed sequence of the correct length if required. If the input sequence is already a valid ring, it is returned without modification. If the input sequence is too short or is not closed, it is extended with one or more copies of the start point. The CoordinateSequenceFactory to use to create the new sequence The sequence to test The original sequence, if it was a valid ring, or a new sequence which is valid. Tests whether two s are equal. To be equal, the sequences must be the same length. They do not need to be of the same dimension, but the ordinate values for the smallest dimension of the two must be equal. Two NaN ordinates values are considered to be equal. a CoordinateSequence a CoordinateSequence true if the sequences are equal in the common dimensions Creates a string representation of a . The format is: ( ord0,ord1.. ord0,ord1,... ... ) the sequence to output the string representation of the sequence The CoordinateSequence implementation that Geometries use by default. In this implementation, Coordinates returned by ToArray and GetCoordinates are live -- parties that change them are actually changing the DefaultCoordinateSequence's underlying data. Constructs a DefaultCoordinateSequence based on the given array (the array is not copied). Coordinate array that will be assimilated. Creates a new sequence based on a deep copy of the given . The coordinate sequence that will be copied Constructs a sequence of a given size, populated with new Coordinates. The size of the sequence to create. Returns the coordinate at specified index. Coordinate index. Coordinate specified. Returns a copy of the coordinate at specified index. Coordinate index. The copy of the coordinate specified. Copies the i'th coordinate in the sequence to the supplied Coordinate. Only the first two dimensions are copied. The index of the coordinate to copy. A Coordinate to receive the value. Returns ordinate X (0) of the specified coordinate. The value of the X ordinate in the index'th coordinate. Returns ordinate Y (1) of the specified coordinate. The value of the Y ordinate in the index'th coordinate. Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinate indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values). The coordinate index in the sequence. The ordinate index in the coordinate (in range [0, dimension-1]). Sets the value for a given ordinate of a coordinate in this sequence. The coordinate index in the sequence. The ordinate index in the coordinate (in range [0, dimension-1]). The new ordinate value. Expands the given Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values. The envelope to expand. A reference to the expanded envelope. Creates a reversed version of this coordinate sequence with cloned s A reversed version of this sequence Returns a deep copy of the object passed. The copied object. This method exposes the internal Array of Coordinate Objects. Coordinate[] array. Returns the string Representation of the coordinate array A string. Returns the dimension (number of ordinates in each coordinate) for this sequence. Returns the coordinate at specified index. Coordinate index. Coordinate specified. Returns the elements number of the coordinate sequence. Returns the elements number of the coordinate sequence. The length. Creates CoordinateSequences internally represented as an array of x's and an array of y's. Returns a DefaultCoordinateSequence based on the given array (the array is not copied). Coordinates array, which may not be null nor contain null elements Singleton instance of DefaultCoordinateSequenceFactory. Returns the singleton instance of DefaultCoordinateSequenceFactory. Singleton instance of DefaultCoordinateSequenceFactory. A coordinate sequence that follows the dotspatial shape range Creates an instance of this class The Constructs a sequence of a given size, populated with new Coordinates. The size of the sequence to create. The number of dimensions. Constructs a sequence of a given size, populated with new Coordinates. The size of the sequence to create. The kind of ordinates. Creates a sequence based on the given coordinate sequence. The coordinate sequence. Creates a reversed version of this coordinate sequence with cloned s A reversed version of this sequence Releases the weak reference to the weak referenced coordinate array This is necessary if you modify the values of the , , arrays externally. Gets the vector with x- and y-ordinate values; If you modify the values of this vector externally, you need to call ! Gets the vector with z-ordinate values If you modify the values of this vector externally, you need to call ! Gets the vector with measure values If you modify the values of this vector externally, you need to call ! A coordinate sequence factory class that creates DotSpatial's Shape/ShapeRange like coordinate sequences. Returns a CoordinateArraySequence based on the given array (the array is not copied). the coordinates, which may not be null nor contain null elements. Creates a which is a copy of the given . This method must handle null arguments by creating an empty sequence. A coordinate sequence Creates a of the specified size and dimension. For this to be useful, the implementation must be mutable. the dimension of the coordinates in the sequence (if user-specifiable, otherwise ignored) A coordinate sequence Creates a of the specified size and ordinates. For this to be useful, the implementation must be mutable. The number of coordinates. The ordinates each coordinate has. is fix, and can be set. A coordinate sequence. Returns the singleton instance of DotSpatialAffineCoordinateSequenceFactory. Gets the Ordinate flags that sequences created by this factory can cope with. Basic implementation of GeometryCollection. Represents an empty GeometryCollection. Internal representation of this GeometryCollection. The Geometrys for this GeometryCollection, or null or an empty array to create the empty point. Elements may be empty Geometrys, but not nulls. For create this is used a standard with == . The Geometrys for this GeometryCollection, or null or an empty array to create the empty point. Elements may be empty Geometrys, but not nulls. Returns a GeometryCollectionEnumerator: this IEnumerator returns the parent geometry as first element. In most cases is more useful the code geometryCollectionInstance.Geometries.GetEnumerator(): this returns an IEnumerator over geometries composing GeometryCollection. Creates a with every component reversed. The order of the components in the collection are not reversed. A in the reverse order Collects all coordinates of all subgeometries into an Array. Note that while changes to the coordinate objects themselves may modify the Geometries in place, the returned Array as such is only a temporary container which is not synchronized back. The collected coordinates. Returns the name of this object's interface. "GeometryCollection" Gets the OGC geometry type Returns the area of this GeometryCollection. Returns the length of this GeometryCollection. Return true if all features in collection are of the same type. Returns the iTh element in the collection. Returns the number of geometries contained by this . Iterates over all Geometry's in a GeometryCollection. Implements a pre-order depth-first traversal of the GeometryCollection (which may be nested). The original GeometryCollection is returned as well (as the first object), as are all sub-collections. It is simple to ignore the GeometryCollection objects if they are not needed. The GeometryCollection being iterated over. Indicates whether or not the first element (the GeometryCollection) has been returned. The number of Geometrys in the the GeometryCollection. The index of the Geometry that will be returned when next is called. The iterator over a nested GeometryCollection, or null if this GeometryCollectionIterator is not currently iterating over a nested GeometryCollection. Constructs an iterator over the given GeometryCollection. The collection over which to iterate; also, the first element returned by the iterator. Gibt einen Enumerator zurück, der die Auflistung durchläuft. Ein , der zum Durchlaufen der Auflistung verwendet werden kann. 1 Gibt einen Enumerator zurück, der eine Auflistung durchläuft. Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. 2 The parent GeometryCollection is the first object returned! Models an OGC SFS LinearRing. A LinearRing is a which is both closed and simple. In other words, the first and last coordinate in the ring must be equal, and the interior of the ring must not self-intersect. Either orientation of the ring is allowed. A ring must have either 0 or 4 or more points. The first and last points must be equal (in 2D). If these conditions are not met, the constructors throw an Models an OGC-style LineString A LineString consists of a sequence of two or more vertices, along with all points along the linearly-interpolated curves (line segments) between each pair of consecutive vertices. Consecutive vertices may be equal. The line segments in the line may intersect each other (in other words, the linestring may "curl back" in itself and self-intersect. Linestrings with exactly two identical points are invalid. A linestring must have either 0 or 2 or more points. If these conditions are not met, the constructors throw an . Represents an empty LineString. The points of this LineString. Creates a whose coordinates are in the reverse order of this objects. A with coordinates in the reverse order. Returns true if the given point is a vertex of this LineString. The Coordinate to check. true if pt is one of this LineString's vertices. Normalizes a LineString. A normalized linestring has the first point which is not equal to it's reflected point less than the reflected point. Initializes a new instance of the class. For create this is used a standard with == . The coordinates used for create this . If too few points are provided Initializes a new instance of the class. The points of the linestring, or null to create the empty point. Consecutive points may not be equal. If too few points are provided Returns the name of this object's interface. "LineString" Returns the length of this LineString The length of the polygon. Returns the value of the angle between the and the . The minimum number of vertices allowed in a valid non-empty ring (= 4). Empty rings with 0 vertices are also valid. Constructs a LinearRing with the given points. Points forming a closed and simple linestring, or null or an empty array to create the empty point. This array must not contain null elements. If the ring is not closed, or has too few points Initializes a new instance of the class. The points used for create this instance. For create this is used a standard with == . If the ring is not closed, or has too few points Returns Dimensions.False, since by definition LinearRings do not have a boundary. Returns the name of this object's interface. "LinearRing" Represents a line segment defined by two Coordinates. Provides methods to compute various geometric properties and relationships of line segments. This class is designed to be easily mutable (to the extent of having its contained points public). This supports a common pattern of reusing a single LineSegment object as a way of computing segment properties on the segments defined by arrays or lists of Coordinates. Creates an instance of this class using two coordinates The start-point The end-point Creates an instance of this class using another instance Creates an instance of this class Determines the orientation of a LineSegment relative to this segment. The concept of orientation is specified as follows: Given two line segments A and L, A is to the left of a segment L if A lies wholly in the closed half-plane lying to the left of L A is to the right of a segment L if A lies wholly in the closed half-plane lying to the right of L otherwise, A has indeterminate orientation relative to L. This happens if A is collinear with L or if A crosses the line determined by L. The LineSegment to compare. 1 if seg is to the left of this segment, -1 if seg is to the right of this segment, 0 if seg is collinear to or crosses this segment. Determines the orientation index of a relative to this segment. The orientation index is as defined in . 1 if p is to the left of this segment -1 if p is to the right of this segment 0 if p is collinear with this segment " Reverses the direction of the line segment. Puts the line segment into a normalized form. This is useful for using line segments in maps and indexes when topological equality rather than exact equality is desired. Computes the distance between this line segment and another one. Computes the distance between this line segment and a point. Computes the perpendicular distance between the (infinite) line defined by this line segment and a point. Computes the that lies a given fraction along the line defined by this segment. A fraction of 0.0 returns the start point of the segment; A fraction of 1.0 returns the end point of the segment. If the fraction is < 0.0 or > 1.0 the point returned will lie before the start or beyond the end of the segment. the fraction of the segment length along the line the point at that distance Computes the that lies a given A fraction along the line defined by this segment and offset from the segment by a given distance. A fraction of 0.0 offsets from the start point of the segment; A fraction of 1.0 offsets from the end point of the segment. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative. the fraction of the segment length along the line the distance the point is offset from the segment (positive is to the left, negative is to the right) the point at that distance and offset if the segment has zero length Computes the Projection Factor for the projection of the point p onto this LineSegment. The Projection Factor is the constant r by which the vector for this segment must be multiplied to equal the vector for the projection of p on the line defined by this segment. The projection factor will lie in the range (-inf, +inf), or be NaN if the line segment has zero length. The point to compute the factor for The projection factor for the point Computes the fraction of distance (in [0.0, 1.0]) that the projection of a point occurs along this line segment. If the point is beyond either ends of the line segment, the closest fractional value (0.0 or 1.0) is returned. Essentially, this is the clamped to the range [0.0, 1.0]. the point the fraction along the line segment the projection of the point occurs Compute the projection of a point onto the line determined by this line segment. Note that the projected point may lie outside the line segment. If this is the case, the projection factor will lie outside the range [0.0, 1.0]. Project a line segment onto this line segment and return the resulting line segment. The returned line segment will be a subset of the target line line segment. This subset may be null, if the segments are oriented in such a way that there is no projection. Note that the returned line may have zero length (i.e. the same endpoints). This can happen for instance if the lines are perpendicular to one another. The line segment to project. The projected line segment, or null if there is no overlap. Computes the closest point on this line segment to another point. The point to find the closest point to. A Coordinate which is the closest point on the line segment to the point p. Computes the closest points on a line segment. A pair of Coordinates which are the closest points on the line segments. Computes an intersection point between two segments, if there is one. There may be 0, 1 or many intersection points between two segments. If there are 0, null is returned. If there is 1 or more, a single one is returned (chosen at the discretion of the algorithm). If more information is required about the details of the intersection, the {RobustLineIntersector} class should be used. A line segment An intersection point, or null if there is none. Computes the intersection point of the lines defined by two segments, if there is one. There may be 0, 1 or an infinite number of intersection points between two lines. If there is a unique intersection point, it is returned. Otherwise, null is returned. If more information is required about the details of the intersection, the class should be used. A line segment defining a straight line An intersection point, or null if there is none or an infinite number Creates a LineString with the same coordinates as this segment the geometery factory to use A LineString with the same geometry as this segment Returns true if o has the same values for its points. A LineSegment with which to do the comparison. true if o is a LineSegment with the same values for the x and y ordinates. Compares this object with the specified object for order. Uses the standard lexicographic ordering for the points in the LineSegment. The LineSegment with which this LineSegment is being compared. A negative integer, zero, or a positive integer as this LineSegment is less than, equal to, or greater than the specified LineSegment. Returns true if other is topologically equal to this LineSegment (e.g. irrespective of orientation). A LineSegment with which to do the comparison. true if other is a LineSegment with the same values for the x and y ordinates. Return HashCode. The end-point The start-point Gets the minimum X ordinate Gets the maximum X ordinate Gets the minimum Y ordinate Gets the maximum Y ordinate Computes the length of the line segment. The length of the line segment. Tests whether the segment is horizontal. true if the segment is horizontal. Tests whether the segment is vertical. true if the segment is vertical. The angle this segment makes with the x-axis (in radians). The midpoint of the segment Basic implementation of MultiLineString. Represents an empty MultiLineString. Constructs a MultiLineString. The LineStrings for this MultiLineString, or null or an empty array to create the empty point. Elements may be empty LineStrings, but not nulls. Constructs a MultiLineString. The LineStrings for this MultiLineString, or null or an empty array to create the empty point. Elements may be empty LineStrings, but not nulls. For create this is used a standard with == . Creates a in the reverse order to this object. Both the order of the component LineStrings and the order of their coordinate sequences are reversed. a in the reverse order. Returns the name of this object's interface. "MultiLineString" Gets the OGC geometry type Gets a value indicating whether this instance is closed. true if this instance is closed; otherwise, false. Models a collection of Points. Represents an empty MultiPoint. Constructs a MultiPoint. The Points for this MultiPoint , or null or an empty array to create the empty point. Elements may be empty Points, but not nulls. Constructs a MultiPoint. The Points for this MultiPoint , or null or an empty array to create the empty point. Elements may be empty Points, but not nulls. For create this is used a standard with == . Returns the Coordinate at the given position. The index of the Coordinate to retrieve, beginning at 0. The nth Coordinate. Returns the name of this object's interface. "MultiPoint" Gets the boundary of this geometry. Zero-dimensional geometries have no boundary by definition, so an empty GeometryCollection is returned. Basic implementation of MultiPolygon. Represents an empty MultiPolygon. Constructs a MultiPolygon. The Polygons for this MultiPolygon , or null or an empty array to create the empty point. Elements may be empty Polygons, but not null s. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL. For create this is used a standard with == . Constructs a MultiPolygon. The Polygons for this MultiPolygon , or null or an empty array to create the empty point. Elements may be empty Polygons, but not null s. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL. Creates a {@link MultiPolygon} with every component reversed. The order of the components in the collection are not reversed. An in the reverse order Returns the name of this object's interface. "MultiPolygon" A bounding container for a which is in the shape of a general octagon. The OctagonalEnvelope of a geometric object is a geometry which is tight bound along the (up to) four extremal rectilineal parallels and along the (up to) four extremal diagonal parallels. Depending on the shape of the contained geometry, the octagon may be degenerate to any extreme (e.g. it may be a rectangle, a line, or a point). Gets the octagonal envelope of a geometry The geometry The octagonal envelope of the geometry Creates a new null bounding octagon Creates a new null bounding octagon bounding a The coordinate to bound Creates a new null bounding octagon bounding a pair of s A coordinate to bound A coordinate to bound Creates a new null bounding octagon bounding an Creates a new null bounding octagon bounding an (the copy constructor). Creates a new null bounding octagon bounding a Sets the value of this object to the null value Tests if the extremal values for this octagon are valid. @return true if this object has valid values A CoordinateSequence implementation based on a packed arrays. A CoordinateSequence implementation based on a packed arrays. A soft reference to the Coordinate[] representation of this sequence. Makes repeated coordinate array accesses more efficient. The dimensions of the coordinates hold in the packed array The ordinates Returns (possibly a copy of) the ith Coordinate in this collection. Whether or not the Coordinate returned is the actual underlying Coordinate or merely a copy depends on the implementation. Note that in the future the semantics of this method may change to guarantee that the Coordinate returned is always a copy. Callers are advised not to assume that they can modify a CoordinateSequence by modifying the Coordinate returned by this method. Returns a copy of the i'th coordinate in this sequence. This method optimizes the situation where the caller is going to make a copy anyway - if the implementation has already created a new Coordinate object, no further copy is needed. The index of the coordinate to retrieve. A copy of the i'th coordinate in the sequence Copies the i'th coordinate in the sequence to the supplied Coordinate. Only the first two dimensions are copied. The index of the coordinate to copy. A Coordinate to receive the value. Returns (possibly copies of) the Coordinates in this collection. Whether or not the Coordinates returned are the actual underlying Coordinates or merely copies depends on the implementation. Note that if this implementation does not store its data as an array of Coordinates, this method will incur a performance penalty because the array needs to be built from scratch. Returns ordinate X (0) of the specified coordinate. The value of the X ordinate in the index'th coordinate. Returns ordinate Y (1) of the specified coordinate. The value of the Y ordinate in the index'th coordinate. Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinate indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values). The coordinate index in the sequence. The ordinate index in the coordinate (in range [0, dimension-1]). Sets the first ordinate of a coordinate in this sequence. Sets the second ordinate of a coordinate in this sequence. Sets the ordinate of a coordinate in this sequence. The coordinate index. The ordinate index in the coordinate, 0 based, smaller than the number of dimensions. The new ordinate value. Warning: for performance reasons the ordinate index is not checked. If it is larger than the dimension a meaningless value may be returned. Returns a Coordinate representation of the specified coordinate, by always building a new Coordinate object. Creates a new object that is a copy of the current instance. A new object that is a copy of this instance. Expands the given Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values. The envelope to expand. A reference to the expanded envelope. Returns the dimension (number of ordinates in each coordinate) for this sequence. Returns the number of coordinates in this sequence. Packed coordinate sequence implementation based on doubles. The packed coordinate array Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Returns a Coordinate representation of the specified coordinate, by always building a new Coordinate object. Gets the underlying array containing the coordinate values. The array of coordinate values Creates a new object that is a copy of the current instance. A new object that is a copy of this instance. Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinate indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values). The coordinate index in the sequence. The ordinate index in the coordinate (in range [0, dimension-1]). Sets the ordinate of a coordinate in this sequence. The coordinate index. The ordinate index in the coordinate, 0 based, smaller than the number of dimensions. The new ordinate value. Warning: for performance reasons the ordinate index is not checked. If it is larger than the dimension a meaningless value may be returned. Expands the given Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values. The envelope to expand. A reference to the expanded envelope. Returns the number of coordinates in this sequence. Packed coordinate sequence implementation based on floats. The packed coordinate array Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Initializes a new instance of the class. Returns a Coordinate representation of the specified coordinate, by always building a new Coordinate object. Gets the underlying array containing the coordinate values. The array of coordinate values Creates a new object that is a copy of the current instance. A new object that is a copy of this instance. Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinate indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values). The coordinate index in the sequence. The ordinate index in the coordinate (in range [0, dimension-1]). Sets the ordinate of a coordinate in this sequence. The coordinate index. The ordinate index in the coordinate, 0 based, smaller than the number of dimensions. The new ordinate value. Warning: for performance reasons the ordinate index is not checked: if it is over dimensions you may not get an exception but a meaningless value. Expands the given Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values. The envelope to expand. A reference to the expanded envelope. Returns the number of coordinates in this sequence. Builds packed array coordinate sequences. The array data type can be either double or float, and defaults to double. Initializes a new instance of the class, using double values. Initializes a new instance of the class. The type. Initializes a new instance of the class. Returns a CoordinateSequence based on the given array; whether or not the array is copied is implementation-dependent. Coordinates array, which may not be null nor contain null elements Returns a CoordinateSequence based on the given coordinate sequence; whether or not the array is copied is implementation-dependent. Creates a of the specified size and ordinates. For this to be useful, the implementation must be mutable. The number of coordinates The ordinates each coordinate has. is fix, and can be set. Represents a single point. A Point is topologically valid if and only if: The coordinate which defines it if any) is a valid coordinate (i.e. does not have an NaN X- or Y-ordinate Represents an empty Point. The Coordinate wrapped by this Point. Initializes a new instance of the class. The coordinate used for create this . For create this is used a standard with == . Constructs a Point with the given coordinate. Contains the single coordinate on which to base this Point, or null to create the empty point. Initializes a new instance of the class. The x coordinate. The y coordinate. The z coordinate. /// For create this is used a standard with set to . Initializes a new instance of the class. The x coordinate. The y coordinate. /// For create this is used a standard with set to . Returns the name of this object's interface. "Point" Gets the OGC geometry type Gets the boundary of this geometry. Zero-dimensional geometries have no boundary by definition, so an empty GeometryCollection is returned. Represents a polygon with linear edges, which may include holes. The outer boundary (shell) and inner boundaries (holes) of the polygon are represented by {@link LinearRing}s. The boundary rings of the polygon may have any orientation. Polygons are closed, simple geometries by definition. The polygon model conforms to the assertions specified in the OpenGIS Simple Features Specification for SQL. A Polygon is topologically valid if and only if: the coordinates which define it are valid coordinates the linear rings for the shell and holes are valid (i.e. are closed and do not self-intersect) holes touch the shell or another hole at at most one point (which implies that the rings of the shell and holes must not cross) the interior of the polygon is connected, or equivalently no sequence of touching holes makes the interior of the polygon disconnected (i.e. effectively split the polygon into two pieces). Represents an empty Polygon. The exterior boundary, or null if this Polygon is the empty point. The interior boundaries, if any. Initializes a new instance of the class. The outer boundary of the new Polygon, or null or an empty LinearRing if the empty point is to be created. The inner boundaries of the new Polygon , or null or empty LinearRings if the empty point is to be created. For create this is used a standard with == . Constructs a Polygon with the given exterior boundary and interior boundaries. The outer boundary of the new Polygon, or null or an empty LinearRing if the empty point is to be created. The inner boundaries of the new Polygon , or null or empty LinearRings if the empty point is to be created. Gets an array of ordinate values The ordinate index An array of ordinate values Constructs a Polygon with the given exterior boundary. The outer boundary of the new Polygon, or null or an empty LinearRing if the empty polygon is to be created. Constructs a Polygon with the given exterior boundary. The outer boundary of the new Polygon, or null or an empty LinearRing if the empty polygon is to be created. Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. a Coordinate which is a vertex of this Geometry. null if this Geometry is empty. Returns an array containing the values of all the vertices for this geometry. If the geometry is a composite, the array will contain all the vertices for the components, in the order in which the components occur in the geometry. In general, the array cannot be assumed to be the actual internal storage for the vertices. Thus modifying the array may not modify the geometry itself. Use the method (possibly on the components) to modify the underlying data. If the coordinates are modified, must be called afterwards. The vertices of this Geometry. Returns the count of this Geometrys vertices. The Geometry s contained by composite Geometrys must be Geometry's; that is, they must implement NumPoints. The number of vertices in this Geometry. Returns the dimension of this geometry. The dimension of a geometry is is the topological dimension of its embedding in the 2-D Euclidean plane. In the NTS spatial model, dimension values are in the set {0,1,2}. Note that this is a different concept to the dimension of the vertex s. The geometry dimension can never be greater than the coordinate dimension. For example, a 0-dimensional geometry (e.g. a Point) may have a coordinate dimension of 3 (X,Y,Z). The topological dimensions of this geometry Returns the dimension of this Geometrys inherent boundary. The dimension of the boundary of the class implementing this interface, whether or not this object is the empty point. Returns Dimension.False if the boundary is the empty point. NOTE: make abstract, remove setter and change geoapi Returns the name of this object's interface. "Polygon" Returns the area of this Polygon Returns the perimeter of this Polygon. Specifies the precision model of the Coordinates in a Geometry. In other words, specifies the grid of allowable points for all Geometrys. The MakePrecise method allows rounding a coordinate to a "precise" value; that is, one whose precision is known exactly. Coordinates are assumed to be precise in geometries. That is, the coordinates are assumed to be rounded to the precision model given for the point. NTS input routines automatically round coordinates to the precision model before creating Geometries. All internal operations assume that coordinates are rounded to the precision model. Constructive methods (such as bool operations) always round computed coordinates to the appropriate precision model. Currently three types of precision model are supported: Floating: represents full double precision floating point. This is the default precision model used in NTS FloatingSingle: represents single precision floating point. Fixed: represents a model with a fixed number of decimal places. A Fixed Precision Model is specified by a scale factor. The scale factor specifies the size of the grid which numbers are rounded to. Input coordinates are mapped to fixed coordinates according to the following equations: jtsPt.x = round( (inputPt.x * scale ) / scale jtsPt.y = round( (inputPt.y * scale ) / scale For example, to specify 3 decimal places of precision, use a scale factor of 1000. To specify -3 decimal places of precision (i.e. rounding to the nearest 1000), use a scale factor of 0.001. Coordinates are represented internally as Java double-precision values. Since .NET uses the IEEE-394 floating point standard, this provides 53 bits of precision. (Thus the maximum precisely representable integer is 9,007,199,254,740,992 - or almost 16 decimal digits of precision). NTS binary methods currently do not handle inputs which have different precision models. The precision model of any constructed geometric value is undefined. The maximum precise value representable in a double. Since IEE754 double-precision numbers allow 53 bits of mantissa, the value is equal to 2^53 - 1. This provides almost 16 decimal digits of precision. Determines which of two s is the most precise A precision model A precision model The PrecisionModel which is most precise The type of PrecisionModel this represents. The scale factor which determines the number of decimal places in fixed precision. Creates a PrecisionModel with a default precision of Floating. Creates a PrecisionModel that specifies an explicit precision model type. If the model type is Fixed the scale factor will default to 1. The type of the precision model. Creates a PrecisionModel that specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor. Amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate Not used. Not used. Creates a PrecisionModel that specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor. Amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate. Copy constructor to create a new PrecisionModel from an existing one. Return HashCode. Sets internal to the precise representation of external. The original coordinate. The coordinate whose values will be changed to the precise representation of external. Returns the precise representation of external. The original coordinate. The coordinate whose values will be changed to the precise representation of external Returns the external representation of internal. The original coordinate. The coordinate whose values will be changed to the external representation of internal. Sets external to the external representation of internal. The original coordinate. The coordinate whose values will be changed to the external representation of internal. Rounds a numeric value to the PrecisionModel grid. Symmetric Arithmetic Rounding is used, to provide uniform rounding behaviour no matter where the number is on the number line. This method has no effect on NaN values Rounds a Coordinate to the PrecisionModel grid. Compares this PrecisionModel object with the specified object for order. A PrecisionModel is greater than another if it provides greater precision. The comparison is based on the value returned by the {getMaximumSignificantDigits) method. This comparison is not strictly accurate when comparing floating precision models to fixed models; however, it is correct when both models are either floating or fixed. The PrecisionModel with which this PrecisionModel is being compared. A negative integer, zero, or a positive integer as this PrecisionModel is less than, equal to, or greater than the specified PrecisionModel. Tests whether the precision model supports floating point. true if the precision model supports floating point. Returns the maximum number of significant digits provided by this precision model. Intended for use by routines which need to print out precise values. The maximum number of decimal places provided by this precision model. Returns the scale factor used to specify a fixed precision model. The number of decimal places of precision is equal to the base-10 logarithm of the scale factor. Non-integral and negative scale factors are supported. Negative scale factors indicate that the places of precision is to the left of the decimal point. The scale factor for the fixed precision model Gets the type of this PrecisionModel. Returns the x-offset used to obtain a precise coordinate. The amount by which to subtract the x-coordinate before multiplying by the scale. Returns the y-offset used to obtain a precise coordinate. The amount by which to subtract the y-coordinate before multiplying by the scale A base class containing the logic for computes the contains and covers spatial relationship predicates for a relative to all other classes. Uses short-circuit tests and indexing to improve performance. Contains and covers are very similar, and differ only in how certain cases along the boundary are handled. These cases require full topological evaluation to handle, so all the code in this class is common to both predicates. It is not possible to short-circuit in all cases, in particular in the case where line segments of the test geometry touches the polygon linework. In this case full topology must be computed. (However, if the test geometry consists of only points, this can be evaluated in an optimized fashion. Martin Davis A base class for predicate operations on s. mbdavis Creates an instance of this operation. the PreparedPolygon to evaluate Tests whether all components of the test Geometry are contained in the target geometry. Handles both linear and point components. A geometry to test true if all componenta of the argument are contained in the target geometry Tests whether all components of the test Geometry are contained in the interior of the target geometry. Handles both linear and point components. A geometry to test true if all componenta of the argument are contained in the target geometry interior Tests whether any component of the test Geometry intersects the area of the target geometry. Handles test geometries with both linear and point components. A geometry to test true if any component of the argument intersects the prepared area geometry Tests whether any component of the test Geometry intersects the interior of the target geometry. Handles test geometries with both linear and point components. A geometry to test true if any component of the argument intersects the prepared area geometry interior Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) The test geometry The representative points of the target geometry true if any component intersects the areal test geometry This flag controls a difference between contains and covers. For contains the value is true. For covers the value is false. Creates an instance of this operation. The PreparedPolygon to evaluate Evaluate the contains or covers relationship for the given geometry. the test geometry true if the test geometry is contained Tests whether a geometry consists of a single polygon with no holes. True if the geometry is a single polygon with no holes Computes the full topological predicate. Used when short-circuit tests are not conclusive. The test geometry true if this prepared polygon has the relationship with the test geometry A base class for subclasses. Contains default implementations for methods, which simply delegate to the equivalent methods. This class may be used as a "no-op" class for Geometry types which do not have a corresponding implementation. Martin Davis Tests whether any representative of the target geometry intersects the test geometry. This is useful in A/A, A/L, A/P, L/P, and P/P cases. The test geometry true if any component intersects the areal test geometry Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes. A geometry true if the envelopes intersect Determines whether the envelope of this geometry covers the Geometry g. A geometry true if g is contained in this envelope Tests whether the base contains a given geometry. The Geometry to test true if this Geometry contains the given Geometry Default implementation. Tests whether the base is covered by a given geometry. The geometry to test true if this geometry is covered by the given geometry Default implementation. Tests whether the base covers a given geometry. The geometry to test true if this geometry covers the given geometry Default implementation. Tests whether the base crosses a given geometry. The geometry to test true if this geometry crosses the given geometry Default implementation. Tests whether the base is disjoint from given geometry. The geometry to test true if this geometry is disjoint from the given geometry Default implementation. Tests whether the base intersects a given geometry. The geometry to test true if this geometry intersects the given geometry Default implementation. Tests whether the base overlaps a given geometry. The geometry to test true if this geometry overlaps the given geometry Default implementation. Tests whether the base touches a given geometry. The geometry to test true if this geometry touches the given geometry Default implementation. Tests whether the base is within a given geometry. The geometry to test true if this geometry is within the given geometry Default implementation. Gets the list of representative points for this geometry. One vertex is included for every component of the geometry (i.e. including one for every ring of polygonal geometries). Do not modify the returned list! A factory for creating s. It chooses an appropriate implementation of PreparedGeometry based on the geoemtric type of the input geometry. In the future, the factory may accept hints that indicate special optimizations which can be performed. Martin Davis Creates a new appropriate for the argument . The geometry to prepare the prepared geometry Creates a new appropriate for the argument . The geometry to prepare the prepared geometry A prepared version for geometries. Instances of this class are thread-safe. mbdavis Computes the intersects spatial relationship predicate for a target relative to other classes. Uses short-circuit tests and indexing to improve performance. Martin Davis Computes the intersects predicate between a and a . The prepared linestring A test geometry true if the linestring intersects the geometry Creates an instance of this operation. The target PreparedLineString Tests whether this geometry intersects a given geometry. The test geometry true if the test geometry intersects Tests whether any representative point of the test Geometry intersects the target geometry. Only handles test geometries which are Puntal (dimension 0) A Puntal geometry to test true if any point of the argument intersects the prepared geometry A prepared version for geometries. Instances of this class are thread-safe. Martin Davis Tests whether this point intersects a . The optimization here is that computing topology for the test geometry is avoided. This can be significant for large geometries. A prepared version for geometries. This class supports both s and s. This class does not support MultiPolygons which are non-valid (e.g. with overlapping elements). Instances of this class are thread-safe and immutable. mbdavis Computes the contains spatial relationship predicate for a relative to all other classes. Uses short-circuit tests and indexing to improve performance. It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. In this case full topology must be computed. Martin Davis Computes the contains spatial relationship predicate between a and a . The prepared polygon A test geometry true if the polygon contains the geometry Creates an instance of this operation. the PreparedPolygon to evaluate Tests whether this PreparedPolygon contains a given geometry. The test geometry true if the test geometry is contained Computes the full topological contains predicate.
Used when short-circuit tests are not conclusive.
The test geometry true if this prepared polygon contains the test geometry
Computes the containsProperly spatial relationship predicate for s relative to all other {@link Geometry} classes.
Uses short-circuit tests and indexing to improve performance.
A Geometry A containsProperly another Geometry B iff all points of B are contained in the Interior of A. Equivalently, B is contained in A AND B does not intersect the Boundary of A. The advantage to using this predicate is that it can be computed efficiently, with no need to compute topology at individual points. In a situation with many geometries intersecting the boundary of the target geometry, this can make a performance difference. Martin Davis
Computes the containsProperly predicate between a and a . The prepared polygon A test geometry true if the polygon properly contains the geometry Creates an instance of this operation. The PreparedPolygon to evaluate Tests whether this PreparedPolygon containsProperly a given geometry. The test geometry true if the polygon properly contains the geometry Computes the Covers spatial relationship predicate for a relative to all other classes. Uses short-circuit tests and indexing to improve performance. It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. In this case full topology must be computed. Martin Davis Computes the Covers spatial relationship predicate for a relative to all other classes. The prepared polygon A test geometry true if the polygon covers the geometry Creates an instance of this operation. The PreparedPolygon to evaluate Tests whether this PreparedPolygon covers a given geometry. The test geometry true if the test geometry is covered Computes the full topological covers predicate. Used when short-circuit tests are not conclusive. The test geometry true if this prepared polygon covers the test geometry Computes the intersects spatial relationship predicate for s relative to all other classes. Uses short-circuit tests and indexing to improve performance. Martin Davis Computes the intersects predicate between a and a . The prepared polygon A test geometry true if the polygon intersects the geometry Creates an instance of this operation. The prepared polygon Tests whether this PreparedPolygon intersects a given geometry. The test geometry true if the test geometry intersects Indicates an invalid or inconsistent topological situation encountered during processing Represents a planar triangle, and provides methods for calculating various properties of triangles. The coordinates of the vertices of the triangle The coordinates of the vertices of the triangle The coordinates of the vertices of the triangle Tests whether a triangle is acute. A triangle is acute iff all interior angles are acute. This is a strict test - right triangles will return false A triangle which is not acute is either right or obtuse. Note: this implementation is not robust for angles very close to 90 degrees. A vertex of the triangle A vertex of the triangle A vertex of the triangle True if the triangle is acute. Computes the line which is the perpendicular bisector of the A point Another point The perpendicular bisector, as an HCoordinate line segment a-b. Computes the circumcentre of a triangle. The circumcentre is the centre of the circumcircle, the smallest circle which encloses the triangle. It is also the common intersection point of the perpendicular bisectors of the sides of the triangle, and is the only point which has equal distance to all three vertices of the triangle. The circumcentre does not necessarily lie within the triangle. For example, the circumcentre of an obtuse isoceles triangle lies outside the triangle. This method uses an algorithm due to J.R.Shewchuk which uses normalization to the origin to improve the accuracy of computation. (See Lecture Notes on Geometric Robustness, Jonathan Richard Shewchuk, 1999). A vertex of the triangle A vertex of the triangle A vertex of the triangle The circumcentre of the triangle Computes the determinant of a 2x2 matrix. Uses standard double-precision arithmetic, so is susceptible to round-off error. the [0,0] entry of the matrix the [0,1] entry of the matrix the [1,0] entry of the matrix the [1,1] entry of the matrix The determinant Computes the incentre of a triangle. The InCentre of a triangle is the point which is equidistant from the sides of the triangle. It is also the point at which the bisectors of the triangle's angles meet. It is the centre of the triangle's InCircle, which is the unique circle that is tangent to each of the triangle's three sides. A vertex of the triangle A vertex of the triangle A vertex of the triangle The point which is the incentre of the triangle Computes the centroid (centre of mass) of a triangle. This is also the point at which the triangle's three medians intersect (a triangle median is the segment from a vertex of the triangle to the midpoint of the opposite side). The centroid divides each median in a ratio of 2:1. The centroid always lies within the triangle. A vertex of the triangle A vertex of the triangle A vertex of the triangle The centroid of the triangle Computes the length of the longest side of a triangle A vertex of the triangle A vertex of the triangle A vertex of the triangle The length of the longest side of the triangle Computes the point at which the bisector of the angle ABC cuts the segment AC. A vertex of the triangle A vertex of the triangle A vertex of the triangle The angle bisector cut point Computes the 2D area of a triangle. The area value is always non-negative. A vertex of the triangle A vertex of the triangle A vertex of the triangle The area of the triangle Computes the signed 2D area of a triangle. The area value is positive if the triangle is oriented CW, and negative if it is oriented CCW. The signed area value can be used to determine point orientation, but the implementation in this method is susceptible to round-off errors. Use for robust orientation calculation. A vertex of the triangle A vertex of the triangle A vertex of the triangle The area of the triangle Computes the 3D area of a triangle. The value computed is alway non-negative. A vertex of the triangle A vertex of the triangle A vertex of the triangle The 3D area of the triangle Computes the Z-value (elevation) of an XY point on a three-dimensional plane defined by a triangle whose vertices have Z-values. The defining triangle must not be degenerate (in other words, the triangle must enclose a non-zero area), and must not be parallel to the Z-axis. This method can be used to interpolate the Z-value of a point inside a triangle (for example, of a TIN facet with elevations on the vertices). The point to compute the Z-value of A vertex of a triangle, with a Z ordinate A vertex of a triangle, with a Z ordinate A vertex of a triangle, with a Z ordinate The computed Z-value (elevation) of the point Creates a new triangle with the given vertices. A vertex A vertex A vertex Computes the InCentre of this triangle The InCentre of a triangle is the point which is equidistant from the sides of the triangle. This is also the point at which the bisectors of the angles meet. It is the centre of the triangle's InCircle, which is the unique circle that is tangent to each of the triangle's three sides. The point which is the InCentre of the triangle. Tests whether this triangle is acute. A triangle is acute iff all interior angles are acute. This is a strict test - right triangles will return false A triangle which is not acute is either right or obtuse. Note: this implementation is not robust for angles very close to 90 degrees. true if this triangle is acute Computes the circumcentre of this triangle. The circumcentre is the centre of the circumcircle, the smallest circle which encloses the triangle. It is also the common intersection point of the perpendicular bisectors of the sides of the triangle, and is the only point which has equal distance to all three vertices of the triangle. The circumcentre does not necessarily lie within the triangle. This method uses an algorithm due to J.R.Shewchuk which uses normalization to the origin to improve the accuracy of computation. (See Lecture Notes on Geometric Robustness, Jonathan Richard Shewchuk, 1999). The circumcentre of this triangle Computes the centroid (centre of mass) of this triangle. This is also the point at which the triangle's three medians intersect (a triangle median is the segment from a vertex of the triangle to the midpoint of the opposite side). The centroid divides each median in a ratio of 2:1. The centroid always lies within the triangle. The centroid of this triangle Computes the length of the longest side of this triangle The length of the longest side of this triangle Computes the 2D area of this triangle. The area value is always non-negative. The area of this triangle Computes the signed 2D area of this triangle. The area value is positive if the triangle is oriented CW, and negative if it is oriented CCW. The signed area value can be used to determine point orientation, but the implementation in this method is susceptible to round-off errors. Use for robust orientation calculation. The signed 2D area of this triangle Computes the 3D area of this triangle. The value computed is alway non-negative. The 3D area of this triangle Computes the Z-value (elevation) of an XY point on a three-dimensional plane defined by this triangle (whose vertices must have Z-values). This triangle must not be degenerate (in other words, the triangle must enclose a non-zero area), and must not be parallel to the Z-axis. This method can be used to interpolate the Z-value of a point inside this triangle (for example, of a TIN facet with elevations on the vertices). The point to compute the Z-value of The computed Z-value (elevation) of the point A corner point of the triangle A corner point of the triangle A corner point of the triangle Represents an affine transformation on the 2D Cartesian plane. It can be used to transform a or . An affine transformation is a mapping of the 2D plane into itself via a series of transformations of the following basic types:
  • reflection (through a line)
  • rotation (around the origin)
  • scaling (relative to the origin)
  • shearing (in both the X and Y directions)
  • translation
In general, affine transformations preserve straightness and parallel lines, but do not preserve distance or shape. An affine transformation can be represented by a 3x3 matrix in the following form:
            T = | m00 m01 m02 |
                | m10 m11 m12 |
                |  0   0   1  |
            
A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') by representing it as a 3x1 matrix and using matrix multiplication to compute:
            | x' |  = T x | x |
            | y' |        | y |
            | 1  |        | 1 |
            

Transformation Composition

Affine transformations can be composed using the method. Composition is computed via multiplication of the transformation matrices, and is defined as:
            A.compose(B) = TB x TA
            
This produces a transformation whose effect is that of A followed by B. The methods , , , , and have the effect of composing a transformation of that type with the transformation they are invoked on. The composition of transformations is in general not commutative.

Transformation Inversion

Affine transformations may be invertible or non-invertible. If a transformation is invertible, then there exists an inverse transformation which when composed produces the identity transformation. The method computes the inverse of a transformation, if one exists. @author Martin Davis
Creates a transformation for a reflection about the line (x0,y0) - (x1,y1). the x-ordinate of a point on the reflection line the y-ordinate of a point on the reflection line the x-ordinate of a another point on the reflection line the y-ordinate of a another point on the reflection line a transformation for the reflection Creates a transformation for a reflection about the line (0,0) - (x,y). the x-ordinate of a point on the reflection line the y-ordinate of a point on the reflection line a transformation for the reflection Creates a transformation for a rotation about the origin by an angle theta. Positive angles correspond to a rotation in the counter-clockwise direction. the rotation angle, in radians a transformation for the rotation Creates a transformation for a rotation by an angle theta, specified by the sine and cosine of the angle. This allows providing exact values for sin(theta) and cos(theta) for the common case of rotations of multiples of quarter-circles. the sine of the rotation angle the cosine of the rotation angle a transformation for the rotation Creates a transformation for a rotation about the point (x,y) by an angle theta. Positive angles correspond to a rotation in the counter-clockwise direction. the rotation angle, in radians the x-ordinate of the rotation point the y-ordinate of the rotation point a transformation for the rotation Creates a transformation for a rotation about the point (x,y) by an angle theta, specified by the sine and cosine of the angle. This allows providing exact values for sin(theta) and cos(theta) for the common case of rotations of multiples of quarter-circles. the sine of the rotation angle the cosine of the rotation angle the x-ordinate of the rotation point the y-ordinate of the rotation point a transformation for the rotation Creates a transformation for a scaling relative to the origin. the value to scale by in the x direction the value to scale by in the y direction a transformation for the scaling Creates a transformation for a scaling relative to the point (x,y). The value to scale by in the x direction The value to scale by in the y direction The x-ordinate of the point to scale around The y-ordinate of the point to scale around A transformation for the scaling Creates a transformation for a shear. the value to shear by in the x direction the value to shear by in the y direction a tranformation for the shear Creates a transformation for a translation. the value to translate by in the x direction the value to translate by in the y direction a tranformation for the translation Constructs a new identity transformation Constructs a new transformation whose matrix has the specified values. an array containing the 6 values { m00, m01, m02, m10, m11, m12 } if matrix is null if matrix is too small Constructs a new transformation whose matrix has the specified values. the entry for the [0, 0] element in the transformation matrix the entry for the [0, 1] element in the transformation matrix the entry for the [0, 2] element in the transformation matrix the entry for the [1, 0] element in the transformation matrix the entry for the [1, 1] element in the transformation matrix the entry for the [1, 2] element in the transformation matrix Constructs a transformation which is a copy of the given one. the transformation to copy Constructs a transformation which maps the given source points into the given destination points. source point 0 source point 1 source point 2 the mapped point for source point 0 the mapped point for source point 1 the mapped point for source point 2 Sets this transformation to be the identity transformation. The identity transformation has the matrix:
            | 1 0 0 |
            | 0 1 0 |
            | 0 0 1 |
            
this transformation, with an updated matrix
Sets this transformation's matrix to have the given values. the entry for the [0, 0] element in the transformation matrix the entry for the [0, 1] element in the transformation matrix the entry for the [0, 2] element in the transformation matrix the entry for the [1, 0] element in the transformation matrix the entry for the [1, 1] element in the transformation matrix the entry for the [1, 2] element in the transformation matrix this transformation, with an updated matrix Sets this transformation to be a copy of the given one a transformation to copy this transformation, with an updated matrix Computes the inverse of this transformation, if one exists. * The inverse is the transformation which when * composed with this one produces the identity * transformation. * A transformation has an inverse if and only if it * is not singular (i.e. its * determinant is non-zero). * Geometrically, an transformation is non-invertible * if it maps the plane to a line or a point. * If no inverse exists this method * will throw a . * The matrix of the inverse is equal to the * inverse of the matrix for the transformation. * It is computed as follows: *
            *                 1
            * inverse(A)  =  ---   x  adjoint(A)
            *                det
            *
            *
            *             =   1       |  m11  -m01   m01*m12-m02*m11  |
            *                ---   x  | -m10   m00  -m00*m12+m10*m02  |
            *                det      |  0     0     m00*m11-m10*m01  |
            *
            *
            *
            *             = |  m11/det  -m01/det   m01*m12-m02*m11/det |
            *               | -m10/det   m00/det  -m00*m12+m10*m02/det |
            *               |   0           0          1               |
            *
            * 
A new inverse transformation
Explicitly computes the math for a reflection. May not work. The x-ordinate of one point on the reflection line The y-ordinate of one point on the reflection line The x-ordinate of another point on the reflection line The y-ordinate of another point on the reflection line This transformation with an updated matrix Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1). The x-ordinate of one point on the reflection line The y-ordinate of one point on the reflection line The x-ordinate of another point on the reflection line The y-ordinate of another point on the reflection line This transformation with an updated matrix Sets this transformation to be a reflection about the line defined by vector (x,y). The transformation for a reflection is computed by:
            d = sqrt(x2 + y2)
            sin = x / d;
            cos = x / d;
            Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
            
the x-component of the reflection line vector the y-component of the reflection line vector this transformation, with an updated matrix
Sets this transformation to be a rotation around the orign. A positive rotation angle corresponds to a counter-clockwise rotation. The transformation matrix for a rotation by an angle theta has the value:
            |  cos(theta)  -sin(theta)   0 |
            |  sin(theta)   cos(theta)   0 |
            |           0            0   1 |
            
the rotation angle, in radians this transformation, with an updated matrix
Sets this transformation to be a rotation around the origin by specifying the sin and cos of the rotation angle directly. The transformation matrix for the rotation has the value:
            |  cosTheta  -sinTheta   0 |
            |  sinTheta   cosTheta   0 |
            |         0          0   1 |
            
the sine of the rotation angle the cosine of the rotation angle this transformation, with an updated matrix
Sets this transformation to be a rotation around a given point (x,y). A positive rotation angle corresponds to a counter-clockwise rotation. The transformation matrix for a rotation by an angle has the value:
            |  cosTheta  -sinTheta   x-x*cos+y*sin |
            |  sinTheta   cosTheta   y-x*sin-y*cos |
            |           0            0   1 |
            
the rotation angle, in radians the x-ordinate of the rotation point the y-ordinate of the rotation point this transformation, with an updated matrix
Sets this transformation to be a rotation around a given point (x,y) by specifying the sin and cos of the rotation angle directly. The transformation matrix for the rotation has the value:
            |  cosTheta  -sinTheta   x-x*cos+y*sin |
            |  sinTheta   cosTheta   y-x*sin-y*cos |
            |         0          0         1       |
            
the sine of the rotation angle the cosine of the rotation angle the x-ordinate of the rotation point the y-ordinate of the rotation point this transformation, with an updated matrix
Sets this transformation to be a scaling. The transformation matrix for a scale has the value:
            |  xScale      0  dx |
            |  1      yScale  dy |
            |  0           0   1 |
            
the amount to scale x-ordinates by the amount to scale y-ordinates by this transformation, with an updated matrix
Sets this transformation to be a shear. The transformation matrix for a shear has the value:
            |  1      xShear  0 |
            |  yShear      1  0 |
            |  0           0  1 |
            
Note that a shear of (1, 1) is not equal to shear(1, 0) composed with shear(0, 1). Instead, shear(1, 1) corresponds to a mapping onto the line x = y.
the x component to shear by the y component to shear by this transformation, with an updated matrix
Sets this transformation to be a translation. For a translation by the vector (x, y) the transformation matrix has the value:
            |  1  0  dx |
            |  1  0  dy |
            |  0  0   1 |
            
the x component to translate by the y component to translate by this transformation, with an updated matrix
Updates the value of this transformation to that of a reflection transformation composed with the current value. the x-ordinate of a point on the line to reflect around the y-ordinate of a point on the line to reflect around the x-ordinate of a point on the line to reflect around the y-ordinate of a point on the line to reflect around this transformation, with an updated matrix Updates the value of this transformation to that of a reflection transformation composed with the current value. the x-ordinate of the line to reflect around the y-ordinate of the line to reflect around this transformation, with an updated matrix Updates the value of this transformation to that of a rotation transformation composed with the current value. Positive angles correspond to a rotation in the counter-clockwise direction. the angle to rotate by in radians this transformation, with an updated matrix Updates the value of this transformation to that of a rotation around the origin composed with the current value, with the sin and cos of the rotation angle specified directly. the sine of the angle to rotate by the cosine of the angle to rotate by this transformation, with an updated matrix Updates the value of this transformation to that of a rotation around a given point composed with the current value. Positive angles correspond to a rotation in the counter-clockwise direction. the angle to rotate by, in radians the x-ordinate of the rotation point the y-ordinate of the rotation point this transformation, with an updated matrix Updates the value of this transformation to that of a rotation around a given point composed with the current value, with the sin and cos of the rotation angle specified directly. the sine of the angle to rotate by the cosine of the angle to rotate by the x-ordinate of the rotation point the y-ordinate of the rotation point this transformation, with an updated matrix Updates the value of this transformation to that of a scale transformation composed with the current value. the value to scale by in the x direction the value to scale by in the y direction this transformation, with an updated matrix Updates the value of this transformation to that of a shear transformation composed with the current value. the value to shear by in the x direction the value to shear by in the y direction this transformation, with an updated matrix Updates the value of this transformation to that of a translation transformation composed with the current value. the value to translate by in the x direction the value to translate by in the y direction this transformation, with an updated matrix Updates this transformation to be the composition of this transformation with the given . This produces a transformation whose effect is equal to applying this transformation followed by the argument transformation. Mathematically,
            A.compose(B) = TB x TA
            
an affine transformation this transformation, with an updated matrix
Updates this transformation to be the composition of a given with this transformation. This produces a transformation whose effect is equal to applying the argument transformation followed by this transformation. Mathematically,
            A.composeBefore(B) = TA x TB
            
an affine transformation this transformation, with an updated matrix
Applies this transformation to the coordinate and places the results in the coordinate (which may be the same as the source). the coordinate to transform the coordinate to accept the results the dest coordinate Cretaes a new which is the result of this transformation applied to the input Geometry. A Geometry The transformed Geometry Applies this transformation to the i'th coordinate in the given CoordinateSequence. a CoordinateSequence the index of the coordinate to transform Transforms the i'th coordinate in the input sequence A CoordinateSequence The index of the coordinate to transform Tests if an object is an AffineTransformation and has the same matrix as this transformation. An object to test true if the given object is equal to this object Gets a text representation of this transformation. The string is of the form: AffineTransformation[[m00, m01, m02], [m10, m11, m12]] A string representing this transformation Clones this transformation A copy of this transformation Gets an array containing the entries of the transformation matrix. Only the 6 non-trivial entries are returned, in the sequence:
            m00, m01, m02, m10, m11, m12
            
an array of length 6
Computes the determinant of the transformation matrix. The determinant is computed as:
             | m00 m01 m02 |
             | m10 m11 m12 | = m00 * m11 - m01 * m10
             |  0   0   1  |
             
If the determinant is zero, the transform is singular (not invertible), and operations which attempt to compute an inverse will throw a .
the determinant of the transformation The determinant of the transformation
Reports that this filter should continue to be executed until all coordinates have been transformed. false Tests if this transformation is the identity transformation. Builds an defined by a set of control vectors. A control vector consists of a source point and a destination point, which is the image of the source point under the desired transformation. A transformation is well-defined by a set of three control vectors if and only if the source points are not collinear. (In particular, the degenerate situation where two or more source points are identical will not produce a well-defined transformation). A well-defined transformation exists and is unique. If the control vectors are not well-defined, the system of equations defining the transformation matrix entries is not solvable, and no transformation can be determined. No such restriction applies to the destination points. However, if the destination points are collinear or non-unique, a non-invertible transformations will be generated. This technique of recovering a transformation from its effect on known points is used in the Bilinear Interpolated Triangulation algorithm for warping planar surfaces. Martin Davis Constructs a new builder for the transformation defined by the given set of control point mappings. A control point A control point A control point The image of under the required transformation The image of under the required transformation The image of under the required transformation Computes the determined by the control point mappings, or null if the control vectors do not determine a well-defined transformation. An affine transformation null if the control vectors do not determine a well-defined transformation. Computes the transformation matrix by solving the two systems of linear equations defined by the control point mappings, if this is possible. True if the transformation matrix is solvable Solves the transformation matrix system of linear equations for the given right-hand side vector. The vector for the right-hand side of the system The solution vector, if it can be determinated, otherwise null Supports creating s defined by various kinds of inputs and transformation mapping rules. Martin Davis Creates a tranformation from a set of three control vectors. A control vector consists of a source point and a destination point, which is the image of the source point under the desired transformation. Three control vectors allows defining a fully general affine transformation. The computed transformation Creates an AffineTransformation defined by a pair of control vectors. A control vector consists of a source point and a destination point, which is the image of the source point under the desired transformation. The computed transformation is a combination of one or more of a uniform scale, a rotation, and a translation (i.e. there is no shear component and no reflection) The computed transformation null if the control vectors do not determine a well-defined transformation Creates an AffineTransformation defined by a single control vector. A control vector consists of a source point and a destination point, which is the image of the source point under the desired transformation. This produces a translation. The start point of the control vector The end point of the control vector The computed transformation Creates an AffineTransformation defined by a set of control vectors. Between one and three vectors must be supplied. The source points of the vectors The destination points of the vectors The computed transformation if the control vector arrays are too short, long or of different lengths Creates an AffineTransformation defined by a maping between two baselines. The computed transformation consists of: a translation from the start point of the source baseline to the start point of the destination baseline, a rotation through the angle between the baselines about the destination start point, and a scaling equal to the ratio of the baseline lengths. If the source baseline has zero length, an identity transformation is returned. The start point of the source baseline The end point of the source baseline The start point of the destination baseline The end point of the destination baseline Extracts a single representative from each connected component of a . 1.9 Extracts the linear components from a single geometry. If more than one geometry is to be processed, it is more efficient to create a single instance and pass it to multiple geometries. The Geometry from which to extract A list of Coordinates Constructs a LineExtracterFilter with a list in which to store LineStrings found. Maps the members of a into another GeometryCollection via a defined mapping function. Martin Davis Creates an instance of this class Combines s to produce a of the most appropriate type. Input geometries which are already collections will have their elements extracted first. No validation of the result geometry is performed. (The only case where invalidity is possible is where geometries are combined and result in a self-intersection). mbdavis Combines a collection of geometries. The geometries to combine The combined geometry Combines two geometries. A geometry to combine A geometry to combine The combined geometry Combines three geometries. A geometry to combine A geometry to combine A geometry to combine The combined geometry Creates a list from two items A list from two geometries Creates a list from three items A list from three geometries Creates a new combiner for a collection of geometries The geometries to combine Extracts the GeometryFactory used by the geometries in a collection a GeometryFactory Computes the combination of the input geometries to produce the most appropriate or A Geometry which is the combination of the inputs Value indicating whether empty geometries should be skipped A class which supports creating new s which are modifications of existing ones, maintaining the same type structure. Geometry objects are intended to be treated as immutable. This class allows you to "modifies" a Geometrys by traversing them, applying a user-defined , or and creating a new Geometrys with the same structure but (possibly) modified components. Examples of the kinds of modifications which can be made are: The values of the coordinates may be changed. The editor does not check whether changing coordinate values makes the result Geometry invalid The coordinate lists may be changed (e.g. by adding, deleting or modifying coordinates). The modifed coordinate lists must be consistent with their original parent component (e.g. a LinearRing must always have at least 4 coordinates, and the first and last coordinate must be equal). Components of the original point may be deleted (e.g. holes may be removed from a Polygon, or LineStrings removed from a MultiLineString). Deletions will be propagated up the component tree appropriately. All changes must be consistent with the original Geometry's structure (e.g. a Polygon cannot be collapsed into a LineString). If changing the structure is required, use a . This class supports creating an edited Geometry using a different via the constructor. Examples of situations where this is required is if the geometry is transformed to a new SRID and/or a new PrecisionModel. Usage notes The resulting Geometry is not checked for validity. If validity needs to be enforced, the new Geometry's method should be called. By default the UserData of the input geometry is not copied to the result. The factory used to create the modified Geometry. If null the GeometryFactory of the input is used. Creates a new GeometryEditor object which will create edited with the same as the input Geometry. Creates a new GeometryEditor object which will create edited s with the given . The GeometryFactory to create the edited Geometry with. Edit the input Geometry with the given edit operation. Clients can create subclasses of GeometryEditorOperation or CoordinateOperation to perform required modifications. The Geometry to edit. The edit operation to carry out. A new Geometry which is the result of the editing (which may be empty). Gets or sets a value indicating if the User Data is copied to the edit result. If so, only the object reference is copied. A interface which specifies an edit operation for Geometries. Edits a Geometry by returning a new Geometry with a modification. The returned Geometry may be the input geometry itself. It may be null if the geometry is to be deleted. The Geometry to modify. The factory with which to construct the modified Geometry (may be different to the factory of the input point). A new Geometry which is a modification of the input Geometry. null if the Geometry is to be deleted completely A GeometryEditorOperation which does not modify the input geometry. This can be used for simple changes of (including PrecisionModel and SRID). mbdavis A GeometryEditorOperation which edits the coordinate list of a Geometry. Operates on Geometry subclasses which contains a single coordinate list. Edits the array of Coordinates from a Geometry. The coordinate array to operate on. The point containing the coordinate list. An edited coordinate array (which may be the same as the input). A which edits the of a . Operates on Geometry subclasses which contains a single coordinate list. An edited coordinate sequence (which may be the same as the input) Extracts the components of a given type from a . Extracts the T components from an and adds them to the provided . the geometry from which to extract the list to add the extracted elements to The geometry type to extract Extracts the T elements from a single and returns them in a . the geometry from which to extract Extracts the components of type T from a . Constructs a filter with a list in which to store the elements found. The list to extract into Extracts all the 1-dimensional () components from a . For polygonal geometries, this will extract all the component s. If desired, s can be forced to be returned as s. Extracts the linear components from a and adds them to the provided . The geometry from which to extract linear components The Collection to add the extracted linear components to The Collection of linear components (LineStrings or LinearRings) Extracts the linear components from a and adds them to the provided . The geometry from which to extract linear components The Collection to add the extracted linear components to The Collection of linear components (LineStrings or LinearRings) Extracts the linear components from a single and adds them to the provided . The geometry from which to extract linear components The Collection to add the extracted linear components to The Collection of linear components (LineStrings or LinearRings) Extracts the linear components from a single and adds them to the provided . The geometry from which to extract linear components The Collection to add the extracted linear components to The Collection of linear components (LineStrings or LinearRings) Extracts the linear components from a single point. If more than one point is to be processed, it is more efficient to create a single LineExtracterFilter instance and pass it to multiple geometries. The point from which to extract linear components. The list of linear components. Extracts the linear components from a single geometry. If more than one geometry is to be processed, it is more efficient to create a single instance and pass it to multiple geometries. The geometry from which to extract linear components true if s should be converted to s The list of linear components Extracts the linear components from a single and returns them as either a or . The geometry from which to extract A linear geometry Extracts the linear components from a single and returns them as either a or . The geometry from which to extract true if s should be converted to s A linear geometry Constructs a LineExtracterFilter with a list in which to store LineStrings found. Constructs a LineExtracterFilter with a list in which to store LineStrings found. Extracts all the elements from a . Extracts the elements from a single and adds them to the. The geometry from which to extract The list to add the extracted elements to The list argument Extracts the elements from a single and returns them in a . The geometry from which to extract A list containing the linear elements Extracts the elements from a single and returns them as either a or . The geometry from which to extract A linear geometry Constructs a filter with a list in which to store the elements found. Implements some 2D matrix operations (in particular, solving systems of linear equations). Martin Davis Solves a system of equations using Gaussian Elimination.
In order to avoid overhead the algorithm runs in-place on A - if A should not be modified the client must supply a copy.
A an nxn matrix in row/column order )modified by this method) A vector of length n if the matrix is the wrong size A vector containing the solution (if any) null if the system has no or no unique solution
Indicates that an is non-invertible. Martin Davis Extracts all the 0-dimensional (Point) components from a Geometry. Extracts the elements from a single and adds them to the provided . The geometry from which to extract The list to add the extracted elements to Extracts the elements from a single and returns them in a . the geometry from which to extract Constructs a PointExtracterFilter with a list in which to store Points found. Extracts all the elements from a . Extracts the elements from a single and adds them to the provided . The geometry from which to extract The list to add the extracted elements to Extracts the elements from a single and returns them in a . The geometry from which to extract Constructs a PolygonExtracterFilter with a list in which to store Polygons found. A visitor to elements which componets, which allows short-circuiting when a defined condition holds. A Depth object records the topological depth of the sides of an Edge for up to two Geometries. A Depth object is null (has never been initialized) if all depths are null. Normalize the depths for each point, if they are non-null. A normalized depth has depth values in the set { 0, 1 }. Normalizing the depths involves reducing the depths by the same amount so that at least one of them is 0. If the remaining value is > 0, it is set to 1. Calls GetDepth and SetDepth. Models the end of an edge incident on a node. EdgeEnds have a direction determined by the direction of the ray from the initial point to the next point. EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". This ordering is used to sort EdgeEnds around a node. Implements the total order relation: a has a greater angle with the positive x-axis than b. Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is obviously susceptible to roundoff. A robust algorithm is: - first compare the quadrant. If the quadrants are different, it it trivial to determine which vector is "greater". - if the vectors lie in the same quadrant, the computeOrientation function can be used to decide the relative orientation of the vectors. Subclasses should override this if they are using labels Computes the factor for the change in depth when moving from one location to another. E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. The depth of each side (position) of this edge. The 0 element of the array is never used. Compute the label in the appropriate orientation for this DirEdge. Set both edge depths. One depth for a given side is provided. The other is computed depending on the Location transition and the depthDelta of the edge. Set both edge depths. One depth for a given side is provided. The other is computed depending on the Location transition and the depthDelta of the edge. VisitedEdge get property returns true if bot Visited and Sym.Visited are true. VisitedEdge set property marks both DirectedEdges attached to a given Edge. This is used for edges corresponding to lines, which will only appear oriented in a single direction in the result. This edge is a line edge if at least one of the labels is a line label any labels which are not line labels have all Location = Exterior. This is an interior Area edge if its label is an Area label for both Geometries and for each Geometry both sides are in the interior. true if this is an interior Area edge. A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node. It supports labelling the edges as well as linking the edges to form both MaximalEdgeRings and MinimalEdgeRings. A EdgeEndStar is an ordered list of EdgeEnds around a node. They are maintained in CCW order (starting with the positive x-axis) around the node for efficient lookup and topology building. A map which maintains the edges in sorted order around the node. A list of all outgoing edges in the result, in CCW order. The location of the point for this star in Geometry i Areas. Insert a EdgeEnd into this EdgeEndStar. Insert an EdgeEnd into the map, and clear the edgeList cache, since the list of edges has now changed. Iterator access to the ordered list of edges is optimized by copying the map collection to a list. (This assumes that once an iterator is requested, it is likely that insertion into the map is complete). The coordinate for the node this star is based at. A list of all outgoing edges in the result, in CCW order. Insert a directed edge in the list. Compute the labelling for all dirEdges in this star, as well as the overall labelling. For each dirEdge in the star, merge the label . Update incomplete dirEdge labels from the labelling for the node. Traverse the star of DirectedEdges, linking the included edges together. To link two dirEdges, the next pointer for an incoming dirEdge is set to the next outgoing edge. DirEdges are only linked if: they belong to an area (i.e. they have sides) they are marked as being in the result Edges are linked in CCW order (the order they are stored). This means that rings have their face on the Right (in other words, the topological location of the face is given by the RHS label of the DirectedEdge). PRECONDITION: No pair of dirEdges are both marked as being in the result. Traverse the star of edges, maintaing the current location in the result area at this node (if any). If any L edges are found in the interior of the result, mark them as covered. Compute the DirectedEdge depths for a subsequence of the edge array. The last depth assigned (from the R side of the last edge visited). A GraphComponent is the parent class for the objects' that form a graph. Each GraphComponent can carry a Label. Compute the contribution to an IM for this component. Update the IM with the contribution for this component. A component only contributes if it has a labelling for both parent geometries. IsInResult indicates if this component has already been included in the result. A coordinate in this component (or null, if there are none). An isolated component is one that does not intersect or touch any other component. This is the case if the label has valid locations for only a single Geometry. true if this component is isolated. Updates an IM from the label for an edge. Handles edges from both L and A geometries. Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge intersection list. Add an EdgeIntersection for intersection intIndex. An intersection that falls exactly on a vertex of the edge is normalized to use the higher of the two possible segmentIndexes. Update the IM with the contribution for this component. A component only contributes if it has a labelling for both parent geometries. Equals is defined to be: e1 equals e2 iff the coordinates of e1 are the same or the reverse of the coordinates in e2. Equals is defined to be: e1 equals e2 iff the coordinates of e1 are the same or the reverse of the coordinates in e2. true if the coordinate sequences of the Edges are identical. The depthDelta is the change in depth as an edge is crossed from R to L. The change in depth as the edge is crossed from R to L. An Edge is collapsed if it is an Area edge and it consists of two segments which are equal and opposite (eg a zero-width V). An EdgeIntersection represents a point on an edge which intersects with another edge. The intersection may either be a single point, or a line segment (in which case this point is the start of the line segment) The label attached to this intersection point applies to the edge from this point forwards, until the next intersection or the end of the edge. The intersection point must be precise. -1 this EdgeIntersection is located before the argument location, 0 this EdgeIntersection is at the argument location, 1 this EdgeIntersection is located after the argument location. The point of intersection. The index of the containing line segment in the parent edge. The edge distance of this point along the containing line segment. A list of edge intersections along an Edge. Adds an intersection into the list, if it isn't already there. The input segmentIndex and dist are expected to be normalized. The EdgeIntersection found or added. Returns an iterator of EdgeIntersections. Adds entries for the first and last points of the edge to the list. Creates new edges for all the edges that the intersections in this list split the parent edge into. Adds the edges to the input list (this is so a single list can be used to accumulate all split edges for a Geometry). Create a new "split edge" with the section of points between (and including) the two intersections. The label for the new edge is the same as the label for the parent edge. A EdgeList is a list of Edges. It supports locating edges that are pointwise equals to a target edge. Remove the selected Edge element from the list if present. Edge element to remove from list Insert an edge unless it is already in the list. If there is an edge equal to e already in the list, return it. Otherwise return null. equal edge, if there is one already in the list, null otherwise. If the edge e is already in the list, return its index. Index, if e is already in the list, -1 otherwise. Validates that a collection of is correctly noded. Throws an appropriate exception if an noding error is found. Checks whether the supplied s are correctly noded. an enumeration of Edges. If the SegmentStrings are not correctly noded Creates a new validator for the given collection of s. Checks whether the supplied edges are correctly noded. If the SegmentStrings are not correctly noded The directed edge which starts the list of edges for this EdgeRing. Compute a LinearRing from the point list previously collected. Test if the ring is a hole (i.e. if it is CCW) and set the hole flag accordingly. Collect all the points from the DirectedEdges of this ring into a contiguous list. Merge the RHS label from a DirectedEdge into the label for this EdgeRing. The DirectedEdge label may be null. This is acceptable - it results from a node which is NOT an intersection node between the Geometries (e.g. the end node of a LinearRing). In this case the DirectedEdge label does not contribute any information to the overall labelling, and is simply skipped. This method will cause the ring to be computed. It will also check any holes, if they have been assigned. Returns the list of DirectedEdges that make up this EdgeRing. A GeometryGraph is a graph that models a given Geometry. The computation of the IntersectionMatrix relies on the use of a structure called a "topology graph". The topology graph contains nodes and edges corresponding to the nodes and line segments of a Geometry. Each node and edge in the graph is labeled with its topological location relative to the source point. Note that there is no requirement that points of self-intersection be a vertex. Thus to obtain a correct topology graph, Geometrys must be self-noded before constructing their graphs. Two fundamental operations are supported by topology graphs: Computing the intersections between all the edges and nodes of a single graph Computing the intersections between the edges and nodes of two different graphs For nodes in the Collection, link the DirectedEdges at the node that are in the result. This allows clients to link only a subset of nodes in the graph, for efficiency (because they know that only a subset is of interest). The node if found; null otherwise Add a set of edges to the graph. For each edge two DirectedEdges will be created. DirectedEdges are NOT linked by this method. Link the DirectedEdges at the nodes of the graph. This allows clients to link only a subset of nodes in the graph, for efficiency (because they know that only a subset is of interest). Link the DirectedEdges at the nodes of the graph. This allows clients to link only a subset of nodes in the graph, for efficiency (because they know that only a subset is of interest). Returns the EdgeEnd which has edge e as its base edge (MD 18 Feb 2002 - this should return a pair of edges). The edge, if found null if the edge was not found. Returns the edge whose first two coordinates are p0 and p1. The edge, if found null if the edge was not found. Returns the edge which starts at p0 and whose first segment is parallel to p1. The edge, if found null if the edge was not found. The coordinate pairs match if they define line segments lying in the same direction. E.g. the segments are parallel and in the same quadrant (as opposed to parallel and opposite!). This method implements the Boundary Determination Rule for determining whether a component (node or edge) that appears multiple times in elements of a MultiGeometry is in the boundary or the interior of the Geometry. The SFS uses the "Mod-2 Rule", which this function implements. An alternative (and possibly more intuitive) rule would be the "At Most One Rule": isInBoundary = (componentCount == 1) The lineEdgeMap is a map of the linestring components of the parentGeometry to the edges which are derived from them. This is used to efficiently perform findEdge queries If this flag is true, the Boundary Determination Rule will used when deciding whether nodes are in the boundary or not Add a Point to the graph. Adds a polygon ring to the graph. Empty rings are ignored. The left and right topological location arguments assume that the ring is oriented CW. If the ring is in the opposite orientation, the left and right locations must be interchanged. Add an Edge computed externally. The label on the Edge is assumed to be correct. Add a point computed externally. The point is assumed to be a Point Geometry part, which has a location of INTERIOR. Compute self-nodes, taking advantage of the Geometry type to minimize the number of intersection tests. (E.g. rings are not tested for self-intersection, since they are assumed to be valid). The LineIntersector to use. If false, intersection checks are optimized to not test rings for self-intersection. The SegmentIntersector used, containing information about the intersections found. Adds candidate boundary points using the current . This is used to add the boundary points of dim-1 geometries (Curves/MultiCurves). Add a node for a self-intersection. If the node is a potential boundary node (e.g. came from an edge which is a boundary) then insert it as a potential boundary node. Otherwise, just add it as a regular node. Determines the of the given in this geometry. The point to test The location of the point in the geometry Gets the used with this geometry graph. An EdgeSetIntersector computes all the intersections between the edges in the set. It adds the computed intersections to each edge they are found on. It may be used in two scenarios: determining the internal intersections between a single set of edges determining the mutual intersections between two different sets of edges It uses a SegmentIntersector to compute the intersections between segments and to record statistics about what kinds of intersections were found. Computes all self-intersections between edges in a set of edges, allowing client to choose whether self-intersections are computed. A list of edges to test for intersections. The SegmentIntersector to use. true if self-intersections are to be tested as well. Computes all mutual intersections between two sets of edges. MonotoneChains are a way of partitioning the segments of an edge to allow for fast searching of intersections. They have the following properties: the segments within a monotone chain will never intersect each other, and the envelope of any contiguous subset of the segments in a monotone chain is simply the envelope of the endpoints of the subset. Property 1 means that there is no need to test pairs of segments from within the same monotone chain for intersection. Property 2 allows binary search to be used to find the intersection points of two monotone chains. For many types of real-world data, these properties eliminate a large number of segment comparisons, producing substantial speed gains. MonotoneChains are a way of partitioning the segments of an edge to allow for fast searching of intersections. Specifically, a sequence of contiguous line segments is a monotone chain iff all the vectors defined by the oriented segments lies in the same quadrant. Monotone Chains have the following useful properties: the segments within a monotone chain will never intersect each other, and the envelope of any contiguous subset of the segments in a monotone chain is simply the envelope of the endpoints of the subset. Property 1 means that there is no need to test pairs of segments from within the same monotone chain for intersection. Property 2 allows binary search to be used to find the intersection points of two monotone chains. For many types of real-world data, these properties eliminate a large number of segment comparisons, producing substantial speed gains. Note that due to the efficient intersection test, there is no need to limit the size of chains to obtain fast performance. The index of the last point in the monotone chain. Computes the intersection of line segments, and adds the intersection to the edges containing the segments. Testing only. A trivial intersection is an apparent self-intersection which in fact is simply the point shared by adjacent line segments. Note that closed edges require a special check for the point shared by the beginning and end segments. This method is called by clients of the EdgeIntersector class to test for and add intersections for two segments of the edges being intersected. Note that clients (such as MonotoneChainEdges) may choose not to intersect certain pairs of segments for efficiency reasons. The proper intersection point, or null if none was found. A proper intersection is an intersection which is interior to at least two line segments. Note that a proper intersection is not necessarily in the interior of the entire Geometry, since another edge may have an endpoint equal to the intersection, which according to SFS semantics can result in the point being on the Boundary of the Geometry. A proper interior intersection is a proper intersection which is not contained in the set of boundary nodes set for this SegmentIntersector. Finds all intersections in one or two sets of edges, using the straightforward method of comparing all segments. This algorithm is too slow for production use, but is useful for testing purposes. Performs a brute-force comparison of every segment in each Edge. This has n^2 performance, and is about 100 times slower than using monotone chains. Finds all intersections in one or two sets of edges, using an x-axis sweepline algorithm in conjunction with Monotone Chains. While still O(n^2) in the worst case, this algorithm drastically improves the average-case time. The use of MonotoneChains as the items in the index seems to offer an improvement in performance over a sweep-line alone. Because Delete Events have a link to their corresponding Insert event, it is possible to compute exactly the range of events which must be compared to a given Insert event object. Finds all intersections in one or two sets of edges, using a simple x-axis sweepline algorithm. While still O(n^2) in the worst case, this algorithm drastically improves the average-case time. Because DELETE events have a link to their corresponding INSERT event, it is possible to compute exactly the range of events which must be compared to a given INSERT event object. Creates an INSERT event. The edge set label for this object. The event location the object being inserted Creates a DELETE event. The event location The corresponding INSERT event Events are ordered first by their x-value, and then by their eventType. Insert events are sorted before Delete events, so that items whose Insert and Delete events occur at the same x-value will be correctly handled. A Label indicates the topological relationship of a component of a topology graph to a given Geometry. This class supports labels for relationships to two Geometrys, which is sufficient for algorithms for binary operations. Topology graphs support the concept of labeling nodes and edges in the graph. The label of a node or edge specifies its topological relationship to one or more geometries. (In fact, since NTS operations have only two arguments labels are required for only two geometries). A label for a node or edge has one or two elements, depending on whether the node or edge occurs in one or both of the input Geometrys. Elements contain attributes which categorize the topological location of the node or edge relative to the parent Geometry; that is, whether the node or edge is in the interior, boundary or exterior of the Geometry. Attributes have a value from the set {Interior, Boundary, Exterior}. In a node each element has a single attribute On. For an edge each element has a triplet of attributes Left, On, Right. It is up to the client code to associate the 0 and 1 TopologyLocations with specific geometries. Converts a Label to a Line label (that is, one with no side Location). Label to convert. Label as Line label. Construct a Label with a single location for both Geometries. Initialize the locations to Null. Construct a Label with a single location for both Geometries. Initialize the location for the Geometry index. Construct a Label with On, Left and Right locations for both Geometries. Initialize the locations for both Geometries to the given values. Construct a Label with On, Left and Right locations for both Geometries. Initialize the locations for the given Geometry index. Construct a Label with the same values as the argument Label. Merge this label with another one. Merging updates any null attributes of this label with the attributes from lbl. Converts one GeometryLocation to a Line location. Only non-null if this node is precise. Basic nodes do not compute IMs. Add the edge to the list of edges at this node. To merge labels for two nodes, the merged location for each LabelElement is computed. The location for the corresponding node LabelElement is set to the result, as long as the location is non-null. Updates the label of a node to BOUNDARY, obeying the mod-2 boundaryDetermination rule. The location for a given eltIndex for a node will be one of { Null, Interior, Boundary }. A node may be on both the boundary and the interior of a point; in this case, the rule is that the node is considered to be in the boundary. The merged location is the maximum of the two input values. The basic node constructor does not allow for incident edges. A map of nodes, indexed by the coordinate of the node. This method expects that a node has a coordinate value. Adds a node for the start point of this EdgeEnd (if one does not already exist in this map). Adds the EdgeEnd to the (possibly new) node. The node if found; null otherwise. An indicator that a Location is on a GraphComponent (0) An indicator that a Location is to the left of a GraphComponent (1) An indicator that a Location is to the right of a GraphComponent (2) An indicator that a Location is is parallel to x-axis of a GraphComponent (-1) /// A Position indicates the position of a Location relative to a graph component (Node, Edge, or Area). Returns Positions.Left if the position is Positions.Right, Positions.Right if the position is Left, or the position otherwise. Utility functions for working with quadrants, which are numbered as follows: 1 | 0 --+-- 2 | 3 North-East North-West South-West South-East Only static methods! Returns the quadrant of a directed line segment (specified as x and y displacements, which cannot both be 0). If the displacements are both 0 Returns the quadrant of a directed line segment from p0 to p1. if the points are equal Returns true if the quadrants are 1 and 3, or 2 and 4. Returns the right-hand quadrant of the halfplane defined by the two quadrants, or -1 if the quadrants are opposite, or the quadrant if they are identical. Returns whether the given quadrant lies within the given halfplane (specified by its right-hand quadrant). Returns true if the given quadrant is 0 or 1. A TopologyLocation is the labelling of a GraphComponent's topological relationship to a single Geometry. If the parent component is an area edge, each side and the edge itself have a topological location. These locations are named: Onon the edge Leftleft-hand side of the edge Rightright-hand side If the parent component is a line edge or node, there is a single topological relationship attribute, On. The possible values of a topological location are { , , , } The labelling is stored in an array _location[j] where where j has the values On, Left, Right. Constructs a TopologyLocation specifying how points on, to the left of, and to the right of some GraphComponent relate to some Geometry. Possible values for the parameters are Location.Null, Location.Exterior, Location.Boundary, and Location.Interior. Merge updates only the Null attributes of this object with the attributes of another. Get calls Get(Positions posIndex), Set calls SetLocation(Positions locIndex, Location locValue) true if all locations are Null. true if any locations are Null. An BinTree (or "Binary Interval Tree") is a 1-dimensional version of a quadtree. It indexes 1-dimensional intervals (which may be the projection of 2-D objects on an axis). It supports range searching (where the range may be a single point). This structure is dynamic - new items can be added at any time, and it will support deletion of items (although this is not currently implemented). This implementation does not require specifying the extent of the inserted items beforehand. It will automatically expand to accomodate any extent of dataset. This index is different to the Interval Tree of Edelsbrunner or the Segment Tree of Bentley. Ensure that the Interval for the inserted item has non-zero extents. Use the current minExtent to pad it, if necessary. Removes a single item from the tree. itemEnv the Envelope of the item to be removed the item to remove true if the item was found (and thus removed) Queries the tree to find all candidate items which may overlap the query interval. If the query interval is null, all items in the tree are found. min and max may be the same value. Adds items in the tree which potentially overlap the query interval to the given collection. If the query interval is null, add all items in the tree. A query interval, or null The candidate items found Compute the total number of nodes in the tree. The number of nodes in the tree. A Key is a unique identifier for a node in a tree. It contains a lower-left point and a level number. The level number is the power of two for the size of the node envelope. Return a square envelope containing the argument envelope, whose extent is a power of two and which is based at a power of 2. A node of a Bintree. The base class for nodes in a Bintree. Returns the index of the subnode that wholely contains the given interval. If none does, returns -1. Subnodes are numbered as follows: 0 | 1 . Adds items in the tree which potentially overlap the query interval to the given collection. If the query interval is null, add all items in the tree. A query interval, or null The candidate items found Removes a single item from this subtree. The envelope containing the item The item to remove true if the item was found and removed Gets whether this node is prunable Gets whether this node has any children Gets whether this node has any subnodes Creates a node The interval of the node item A new node Creates a larger node, that contains both and If is null, a node for is created. The original node The additional interval A new node Creates a new node instance The node's interval The node's level Returns the subnode containing the envelope. Creates the node if it does not already exist. Returns the smallest existing node containing the envelope. Get the subnode for the index. If it doesn't exist, create it. Gets the node's The root node of a single Bintree. It is centred at the origin, and does not have a defined extent. Insert an item into the tree this is the root of. Insert an item which is known to be contained in the tree rooted at the given Node. Lower levels of the tree will be created if necessary to hold the item. The root node matches all searches. MonotoneChains are a way of partitioning the segments of a linestring to allow for fast searching of intersections. They have the following properties: the segments within a monotone chain never intersect each other the envelope of any contiguous subset of the segments in a monotone chain is equal to the envelope of the endpoints of the subset. Property 1 means that there is no need to test pairs of segments from within the same monotone chain for intersection. Property 2 allows an efficient binary search to be used to find the intersection points of two monotone chains. For many types of real-world data, these properties eliminate a large number of segment comparisons, producing substantial speed gains. One of the goals of this implementation of MonotoneChains is to be as space and time efficient as possible. One design choice that aids this is that a MonotoneChain is based on a subarray of a list of points. This means that new arrays of points (potentially very large) do not have to be allocated. MonotoneChains support the following kinds of queries: Envelope selectdetermine all the segments in the chain which intersect a given envelope. Overlapdetermine all the pairs of segments in two chains whose envelopes overlap. This implementation of MonotoneChains uses the concept of internal iterators ( and ) to return the resultsets for the above queries. This has time and space advantages, since it is not necessary to build lists of instantiated objects to represent the segments returned by the query. Queries made in this manner are thread-safe. Gets the line segment starting at The index of the segment The line segment to extract to Determine all the line segments in the chain whose envelopes overlap the searchEnvelope, and process them. The monotone chain search algorithm attempts to optimize performance by not calling the select action on chain segments which it can determine are not in the search envelope. However, it *may* call the select action on segments which do not intersect the search envelope. This saves on the overhead of checking envelope intersection each time, since clients may be able to do this more efficiently. The search envelope The select action to execute on selected segments Determine all the line segments in two chains which may overlap, and process them. The monotone chain search algorithm attempts to optimize performance by not calling the overlap action on chain segments which it can determine do not overlap. However, it *may* call the overlap action on segments which do not actually interact. This saves on the overhead of checking intersection each time, since clients may be able to do this more efficiently. The monotone chain The overlap action to execute on selected segments Gets or sets the Id Gets the chain's context Gets the chain's envelope Gets the start index Gets the end index of the underlying linestring Return the subsequence of coordinates forming this chain. Allocates a new array to hold the Coordinates. Constructs s for sequences of s. Only static methods! Return a list of the MonotoneChains for the given list of coordinates. Return an array containing lists of start/end indexes of the monotone chains for the given list of coordinates. The last entry in the array points to the end point of the point array, for use as a sentinel. Finds the index of the last point in a monotone chain starting at a given point. Any repeated points (0-length segments) will be included in the monotone chain returned. The coordinates The start index The index of the last point in the monotone chain starting at start. The action for the internal iterator for performing overlap queries on a MonotoneChain. This envelope is used during the MonotoneChain search process. This envelope is used during the MonotoneChain search process. This function can be overridden if the original chains are needed. The index of the start of the overlapping segment from mc1. The index of the start of the overlapping segment from mc2. This is a convenience function which can be overridden to obtain the actual line segments which overlap. A visitor for nodes and items in an index. A static index on a set of 1-dimensional intervals, using an R-Tree packed based on the order of the interval midpoints. It supports range searching, where the range is an interval of the real line (which may be a single point). A common use is to index 1-dimensional intervals which are the projection of 2-D objects onto an axis of the coordinate system. This index structure is static - items cannot be added or removed once the first query has been made. The advantage of this characteristic is that the index performance can be optimized based on a fixed set of items. Martin Davis Adds an item to the index which is associated with the given interval The lower bound of the item interval The upper bound of the item interval The item to insert if the index has already been queried Search for intervals in the index which intersect the given closed interval and apply the visitor to them. The lower bound of the query interval The upper bound of the query interval The visitor to pass any matched items to The basic insertion and query operations supported by classes implementing spatial index algorithms. A spatial index typically provides a primary filter for range rectangle queries. A secondary filter is required to test for exact intersection. Of course, this secondary filter may consist of other tests besides intersection, such as testing other kinds of spatial relationships. Adds a spatial item with an extent specified by the given Envelope to the index. Queries the index for all items whose extents intersect the given search Envelope Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope. The envelope to query for. A list of the items found by the query. Queries the index for all items whose extents intersect the given search , and applies an to them. Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope. The envelope to query for. A visitor object to apply to the items found. Removes a single item from the tree. The Envelope of the item to remove. The item to remove. true if the item was found. A node of a , which represents one or more points in the same location. The type of the object dskea Creates a new KdNode. coordinate of point coordinate of point A data objects to associate with this node Creates a new KdNode. The point location of new node A data objects to associate with this node Gets x-ordinate of this node Gets y-ordinate of this node Gets the location of this node Gets the user data object associated with this node. Gets or sets the left node of the tree Gets or sets the right node of the tree Gets the number of inserted points that are coincident at this location. Gets whether more than one point with this value have been inserted (up to the tolerance) An implementation of a 2-D KD-Tree. KD-trees provide fast range searching on point data. This implementation supports detecting and snapping points which are closer than a given distance tolerance. If the same point (up to tolerance) is inserted more than once , it is snapped to the existing node. In other words, if a point is inserted which lies within the tolerance of a node already in the index, it is snapped to that node. When a point is snapped to a node then a new node is not created but the count of the existing node is incremented. If more than one node in the tree is within tolerance of an inserted point, the closest and then lowest node is snapped to. The type of the user data object David Skea Martin Davis Converts a collection of s to an array of s. A collection of nodes An array of the coordinates represented by the nodes Converts a collection of {@link KdNode}s to an array of s, specifying whether repeated nodes should be represented by multiple coordinates. a collection of nodes true if repeated nodes should be included multiple times An array of the coordinates represented by the nodes Creates a new instance of a KdTree with a snapping tolerance of 0.0. (I.e. distinct points will not be snapped) Creates a new instance of a KdTree with a snapping distance tolerance. Points which lie closer than the tolerance to a point already in the tree will be treated as identical to the existing point. The tolerance distance for considering two points equal Inserts a new point in the kd-tree, with no data. The point to insert The kdnode containing the point Inserts a new point into the kd-tree. The point to insert A data item for the point A new KdNode if a new point is inserted, else an existing node is returned with its counter incremented. This can be checked by testing returnedNode.getCount() > 1. Finds the node in the tree which is the best match for a point being inserted. The match is made deterministic by returning the lowest of any nodes which lie the same distance from the point. There may be no match if the point is not within the distance tolerance of any existing node. The point being inserted the best matching node null if no match was found Inserts a point known to be beyond the distance tolerance of any existing node. The point is inserted at the bottom of the exact splitting path, so that tree shape is deterministic. The point to insert The data for the point The created node Performs a range search of the points in the index. The range rectangle to query Performs a range search of the points in the index. The range rectangle to query A collection of the KdNodes found Performs a range search of the points in the index. The range rectangle to query A collection to accumulate the result nodes into Performs a nearest neighbor search of the points in the index. The point to search the nearset neighbor for Tests whether the index contains any items. DoubleBits manipulates Double numbers by using bit manipulation and bit-field extraction. For some operations (such as determining the exponent) this is more accurate than using mathematical operations (which suffer from round-off error). The algorithms and constants in this class apply only to IEEE-754 double-precision floating point format. This computes the number of common most-significant bits in the mantissa. It does not count the hidden bit, which is always 1. It does not determine whether the numbers have the same exponent - if they do not, the value computed by this function is meaningless. The number of common most-significant mantissa bits. A representation of the Double bits formatted for easy readability. Determines the exponent for the number. Determines the exponent for the number. Provides a test for whether an interval is so small it should be considered as zero for the purposes of inserting it into a binary tree. The reason this check is necessary is that round-off error can cause the algorithm used to subdivide an interval to fail, by computing a midpoint value which does not lie strictly between the endpoints. This value is chosen to be a few powers of 2 less than the number of bits available in the double representation (i.e. 53). This should allow enough extra precision for simple computations to be correct, at least for comparison purposes. Only static methods! Computes whether the interval [min, max] is effectively zero width. I.e. the width of the interval is so much less than the location of the interval that the midpoint of the interval cannot be represented precisely. A Key is a unique identifier for a node in a quadtree. It contains a lower-left point and a level number. The level number is the power of two for the size of the node envelope. Return a square envelope containing the argument envelope, whose extent is a power of two and which is based at a power of 2. Represents a node of a Quadtree. Nodes contain items which have a spatial extent corresponding to the node's position in the quadtree. The base class for nodes in a Quadtree. Gets the index of the subquad that wholly contains the given envelope. If none does, returns -1. The index of the subquad that wholly contains the given envelope
or -1 if no subquad wholly contains the envelope
subquads are numbered as follows: 2 | 3 --+-- 0 | 1 Removes a single item from this subtree. The envelope containing the item. The item to remove. true if the item was found and removed. Insert items in this into the parameter! IList for adding items. Parameter IList with this items. Returns the subquad containing the envelope . Creates the subquad if it does not already exist. The envelope to search for The subquad containing the search envelope. Returns the smallest existing node containing the envelope. Get the subquad for the index. If it doesn't exist, create it. A Quadtree is a spatial index structure for efficient range querying of items bounded by 2D rectangles.
s can be indexed by using their s.
Any type of object can also be indexed, as long as it has an extent that can be represented by an . This Quadtree index provides a primary filter for range rectangle queries. The various query methods return a list of all items which may intersect the query rectangle. Note that it may thus return items which do not in fact intersect the query rectangle. A secondary filter is required to test for actual intersection between the query rectangle and the envelope of each candidate item. The secondary filter may be performed explicitly, or it may be provided implicitly by subsequent operations executed on the items (for instance, if the index query is followed by computing a spatial predicate between the query geometry and tree items, the envelope intersection check is performed automatically. This implementation does not require specifying the extent of the inserted items beforehand. It will automatically expand to accomodate any extent of dataset. This data structure is also known as an MX-CIF quadtree following the terminology usage of Samet and others.
Ensure that the envelope for the inserted item has non-zero extents. Use the current minExtent to pad the envelope, if necessary. minExtent is the minimum envelope extent of all items inserted into the tree so far. It is used as a heuristic value to construct non-zero envelopes for features with zero X and/or Y extent. Start with a non-zero extent, in case the first feature inserted has a zero extent in both directions. This value may be non-optimal, but only one feature will be inserted with this value. Constructs a Quadtree with zero items. Removes a single item from the tree. The Envelope of the item to be removed. The item to remove. true if the item was found (and thus removed). Queries the tree and returns items which may lie in the given search envelope. Precisely, the items that are returned are all items in the tree whose envelope may intersect the search Envelope. Note that some items with non-intersecting envelopes may be returned as well; the client is responsible for filtering these out. In most situations there will be many items in the tree which do not intersect the search envelope and which are not returned - thus providing improved performance over a simple linear scan. The envelope of the desired query area. A List of items which may intersect the search envelope Queries the tree and visits items which may lie in the given search envelope. Precisely, the items that are visited are all items in the tree whose envelope may intersect the search Envelope. Note that some items with non-intersecting envelopes may be visited as well; the client is responsible for filtering these out. In most situations there will be many items in the tree which do not intersect the search envelope and which are not visited - thus providing improved performance over a simple linear scan. The envelope of the desired query area. A visitor object which is passed the visited items Return a list of all items in the Quadtree. Returns the number of levels in the tree. Tests whether the index contains any items. Returns the number of items in the tree. QuadRoot is the root of a single Quadtree. It is centred at the origin, and does not have a defined extent. Insert an item into the quadtree this is the root of. Insert an item which is known to be contained in the tree rooted at the given QuadNode root. Lower levels of the tree will be created if necessary to hold the item. A node of an . A node is one of: empty an interior node containing child s a leaf node containing data items (s). A node stores the bounds of its children, and its level within the index tree. Constructs an AbstractNode at the given level in the tree 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the root node will have the highest level. Returns a representation of space that encloses this Boundable, preferably not much bigger than this Boundable's boundary yet fast to test for intersection with the bounds of other Boundables. The class of object returned depends on the subclass of AbstractSTRtree. An Envelope (for STRtrees), an Interval (for SIRtrees), or other object (for other subclasses of AbstractSTRtree). Adds either an AbstractNode, or if this is a leaf node, a data object (wrapped in an ItemBoundable). Returns either child s, or if this is a leaf node, real data (wrapped in s). Gets the bounds of this node Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the root node will have the highest level. Gets the count of the s at this node. Tests whether there are any s at this node. Base class for STRtree and SIRtree. STR-packed R-trees are described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With Application To GIS. Morgan Kaufmann, San Francisco, 2002. This implementation is based on s rather than just s, because the STR algorithm operates on both nodes and data, both of which are treated as s. Set to null when index is built, to avoid retaining memory. Constructs an AbstractSTRtree with the specified maximum number of child nodes that a node may have. Creates parent nodes, grandparent nodes, and so forth up to the root node, for the data that has been inserted into the tree. Can only be called once, and thus can be called only after all of the data has been inserted into the tree. Sorts the childBoundables then divides them into groups of size M, where M is the node capacity. Creates the levels higher than the given level. The level to build on. the level of the Boundables, or -1 if the boundables are item boundables (that is, below level 0). The root, which may be a ParentNode or a LeafNode. Also builds the tree, if necessary. Gets a tree structure (as a nested list) corresponding to the structure of the items and nodes in this tree. The returned Lists contain either Object items, or Lists which correspond to subtrees of the tree Subtrees which do not contain any items are not included. Builds the tree if necessary. a List of items and/or Lists Removes an item from the tree. (Builds the tree, if necessary.) Returns the maximum number of child nodes that a node may have. Tests whether the index contains any items. This method does not build the index, so items can still be inserted after it has been called. Gets the number of elements in the tree A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have different implementations of bounds. A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have different implementations of bounds. For STRtrees, the bounds will be Envelopes; for SIRtrees, Intervals; for other subclasses of AbstractSTRtree, some other class. The bounds of one spatial object. The bounds of another spatial object. Whether the two bounds intersect. A spatial object in an AbstractSTRtree. Returns a representation of space that encloses this Boundable, preferably not much bigger than this Boundable's boundary yet fast to test for intersection with the bounds of other Boundables. The class of object returned depends on the subclass of AbstractSTRtree. An Envelope (for STRtrees), an Interval (for SIRtrees), or other object (for other subclasses of AbstractSTRtree). Boundable wrapper for a non-Boundable spatial object. Used internally by AbstractSTRtree. The bounds The item One-dimensional version of an STR-packed R-tree. SIR stands for "Sort-Interval-Recursive". STR-packed R-trees are described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With Application To GIS. Morgan Kaufmann, San Francisco, 2002. Constructs an SIRtree with the default (10) node capacity. Constructs an SIRtree with the given maximum number of child nodes that a node may have. Inserts an item having the given bounds into the tree. Returns items whose bounds intersect the given value. Returns items whose bounds intersect the given bounds. Possibly equal to x2. Possibly equal to x1. A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatial data. The STR packed R-tree is simple to implement and maximizes space utilization; that is, as many leaves as possible are filled to capacity. Overlap between nodes is far less than in a basic R-tree. However, once the tree has been built (explicitly or on the first call to #query), items may not be added or removed. Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With Application To GIS. Morgan Kaufmann, San Francisco, 2002. Constructs an STRtree with the default (10) node capacity. Constructs an STRtree with the given maximum number of child nodes that a node may have. The minimum recommended capacity setting is 4. Creates the parent level for the given child level. First, orders the items by the x-values of the midpoints, and groups them into vertical slices. For each slice, orders the items by the y-values of the midpoints, and group them into runs of size M (the node capacity). For each run, creates a new (parent) node. Must be sorted by the x-value of the envelope midpoints. Inserts an item having the given bounds into the tree. Returns items whose bounds intersect the given envelope. Returns items whose bounds intersect the given envelope. Removes a single item from the tree. The Envelope of the item to remove. The item to remove. true if the item was found. Finds the two nearest items in the tree, using as the distance metric. A Branch-and-Bound tree traversal algorithm is used to provide an efficient search. A distance metric applicable to the items in this tree The pair of the nearest items Finds the item in this tree which is nearest to the given , using as the distance metric. A Branch-and-Bound tree traversal algorithm is used to provide an efficient search. The query does not have to be contained in the tree, but it does have to be compatible with the distance metric. The envelope of the query item The item to find the nearest neighbour of A distance metric applicable to the items in this tree and the query item The nearest item in this tree Finds the two nearest items from this tree and another tree, using as the distance metric. A Branch-and-Bound tree traversal algorithm is used to provide an efficient search. The result value is a pair of items, the first from this tree and the second from the argument tree. Another tree A distance metric applicable to the items in the trees The pair of the nearest items, one from each tree ProjectionEvents are ordered first by their x-value, and then by their eventType. It is important that Insert events are sorted before Delete events, so that items whose Insert and Delete events occur at the same x-value will be correctly handled. A sweepline implements a sorted index on a set of intervals. It is used to compute all overlaps between the interval in the index. Because Delete Events have a link to their corresponding Insert event, it is possible to compute exactly the range of events which must be compared to a given Insert event object. Reads a sequence of s in WKT format from a text file. The geometries in the file may be separated by any amount of whitespace and newlines. Martin Davis Creates a new given the to read from and a to use to parse the geometries. the to read from the geometry reader to use Creates a new , given the name of the file to read from. The name of the file to read from The geometry reader to use Creates a new , given a to read with. The stream reader of the file to read from The geometry reader to use Reads a sequence of geometries. If an offset is specified, geometries read up to the offset count are skipped. If a limit is specified, no more than geometries are read. The list of geometries read Tests if reader is at EOF. Gets/Sets the maximum number of geometries to read. Gets/Sets the number of geometries to skip before reading. Finds if two sets of s intersect. Uses indexing for fast performance and to optimize repeated tests against a target set of lines. Short-circuited to return as soon an intersection is found. Immutable and thread-safe. Creates an intersection finder against a given set of segment strings. The segment strings to search for intersections Tests for intersections with a given set of target {@link SegmentString}s. The SegmentStrings to test true if an intersection was found Tests for intersections with a given set of target s. using a given SegmentIntersectionDetector. The SegmentStrings to test The intersection detector to use true if the detector reports intersections Gets the segment set intersector used by this class. This allows other uses of the same underlying indexed structure. Intersects two sets of s using a index based on s and a . Thread-safe and immutable. Constructs a new intersector for a given set of s. The base segment strings to intersect Calls for all candidate intersections between the given collection of SegmentStrings and the set of indexed segments. Gets the index constructed over the base segment strings NOTE: To retain thread-safety, treat returned value as immutable Segment overlap action class Creates an instance of this class using the provided The segment intersector to use Detects and records an intersection between two s, if one exists. Only a single intersection is recorded. This strategy can be configured to search for proper intersections. In this case, the presence of any intersection will still be recorded, but searching will continue until either a proper intersection has been found or no intersections are detected. Creates an intersection finder using a Creates an intersection finder using a given The LineIntersector to use This method is called by clients of the class to process intersections for two segments of the s being intersected. Note that some clients (such as MonotoneChains) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test). Gets or sets whether processing must continue until a proper intersection is found Gets or sets whether processing can terminate once any intersection is found. Tests whether an intersection was found. Tests whether a proper intersection was found. Tests whether a non-proper intersection was found. Gets the computed location of the intersection. Due to round-off, the location may not be exact. Gets the endpoints of the intersecting segments. An array of the segment endpoints (p00, p01, p10, p11) Tests whether processing can terminate, because all required information has been obtained (e.g. an intersection of the desired type has been detected). Utility methods for processing s Martin Davis Extracts all linear components from a given to s. The data item is set to be the source . The to extract from. a list of s. Extracts all linear components from a given to s. The data item is set to be the source . The to extract from. a list of s. Converts a collection of s into a . The geometry will be either a or a (possibly empty). A collection of . A geometry factory A or a . Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. These kinds of geometries are useful as a more complex geometry for testing algorithms. Martin Davis Computes various kinds of common geometric shapes. Allows various ways of specifying the location and extent of the shapes, as well as number of line segments used to form them. Create a shape factory which will create shapes using the default GeometryFactory. Create a shape factory which will create shapes using the given GeometryFactory. The factory to use. Creates a rectangular Polygon. A rectangular polygon. Creates a circular Polygon. A circular polygon. Creates an elliptical Polygon. If the supplied envelope is square the result will be a circle. An an ellipse or circle. Creates a squircular . a squircle Creates a supercircular of a given positive power. a supercircle Creates a elliptical arc, as a LineString. The arc is always created in a counter-clockwise direction. Start angle in radians Size of angle in radians Creates an elliptical arc polygon. The polygon is formed from the specified arc of an ellipse and the two radii connecting the endpoints to the centre of the ellipse. Start angle in radians Size of angle in radians An elliptical arc polygon Gets/Sets the location of the shape by specifying the base coordinate (which in most cases is the lower left point of the envelope containing the shape). Gets/Sets the location of the shape by specifying the centre of the shape's bounding box. Gets or sets the envelope of the shape Gets/Sets the total number of points in the created Geometry. Gets/Sets the size of the extent of the shape in both x and y directions. Gets/Sets the width of the shape. Gets/Sets the height of the shape. Gets/Sets the rotation angle, in radians, to use for the shape. The rotation is applied relative to the centre of the shape. Creates a factory which will create sine stars using the default Creates a factory which will create sine stars using the given The factory to use Generates the geometry for the sine star The geometry representing the sine star Gets/Sets the number of arms in the star Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. Value should be between 0.0 and 1.0 Extends the class to allow reading values in the BigEndian format. While extends adding methods for reading integer values () and double values () in the BigEndian format, this implementation overrides methods, such and and more, for reading values in the BigEndian format. Initializes a new instance of the class. The stream. Initializes a new instance of the class. The supplied stream. The character encoding. encoding is null. The stream does not support reading, the stream is null, or the stream is already closed. Reads a 2-byte signed integer from the current stream using big endian encoding and advances the current position of the stream by two bytes. A 2-byte signed integer read from the current stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads a 2-byte unsigned integer from the current stream using big endian encoding and advances the position of the stream by two bytes. A 2-byte unsigned integer read from this stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads a 4-byte signed integer from the current stream using big endian encoding and advances the current position of the stream by four bytes. A 4-byte signed integer read from the current stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads a 4-byte unsigned integer from the current stream using big endian encoding and advances the position of the stream by four bytes. A 4-byte unsigned integer read from this stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads an 8-byte signed integer from the current stream using big endian encoding and advances the current position of the stream by eight bytes. An 8-byte signed integer read from the current stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads an 8-byte unsigned integer from the current stream using big endian encoding and advances the position of the stream by eight bytes. An 8-byte unsigned integer read from this stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads a 4-byte floating point value from the current stream using big endian encoding and advances the current position of the stream by four bytes. A 4-byte floating point value read from the current stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads an 8-byte floating point value from the current stream using big endian encoding and advances the current position of the stream by eight bytes. An 8-byte floating point value read from the current stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads a string from the current stream. The string is prefixed with the length, encoded as an integer seven bits at a time. The string being read. The stream is closed. An I/O error occurs. The end of the stream is reached. Reads a decimal value from the current stream and advances the current position of the stream by sixteen bytes. A decimal value read from the current stream. The stream is closed. An I/O error occurs. The end of the stream is reached. Extends the class to allow writing values in the BigEndian format. While extends adding methods for writing integer values () and double values () in the BigEndian format, this implementation overrides methods, such and and more, for writing values in the BigEndian format. Initializes a new instance of the class. Initializes a new instance of the class. The supplied stream. output is null. The stream does not support writing, or the stream is already closed. Initializes a new instance of the class. The supplied stream. The character encoding. output or encoding is null. The stream does not support writing, or the stream is already closed. Writes a two-byte signed integer to the current stream using BigEndian encoding and advances the stream position by two bytes. The two-byte signed integer to write. The stream is closed. An I/O error occurs. Writes a two-byte unsigned integer to the current stream using BigEndian encoding and advances the stream position by two bytes. The two-byte unsigned integer to write. The stream is closed. An I/O error occurs. Writes a four-byte signed integer to the current stream using BigEndian encoding and advances the stream position by four bytes. The four-byte signed integer to write. The stream is closed. An I/O error occurs. Writes a four-byte unsigned integer to the current stream using BigEndian encoding and advances the stream position by four bytes. The four-byte unsigned integer to write. The stream is closed. An I/O error occurs. Writes an eight-byte signed integer to the current stream using BigEndian encoding and advances the stream position by eight bytes. The eight-byte signed integer to write. The stream is closed. An I/O error occurs. Writes an eight-byte unsigned integer to the current stream using BigEndian encoding and advances the stream position by eight bytes. The eight-byte unsigned integer to write. The stream is closed. An I/O error occurs. Writes a four-byte floating-point value to the current stream using BigEndian encoding and advances the stream position by four bytes. The four-byte floating-point value to write. The stream is closed. An I/O error occurs. Writes an eight-byte floating-point value to the current stream using BigEndian encoding and advances the stream position by eight bytes. The eight-byte floating-point value to write. The stream is closed. An I/O error occurs. Writes a length-prefixed string to this stream in the current encoding of the , and advances the current position of the stream in accordance with the encoding used and the specific characters being written to the stream. The value to write. The stream is closed. An I/O error occurs. value is null. Writes a decimal value to the current stream and advances the stream position by sixteen bytes. The decimal value to write. The stream is closed. An I/O error occurs. Reads a GML document and creates a representation of the features based on NetTopologySuite model. Uses GML 2.1.1 Geometry.xsd schema for base for features. Initialize reader with a standard . Initialize reader with the given . Read a GML document and returns relative . Reads the coordinate. The reader. Extract a from a x,y string value. Extract a from a pos entity string value. Extract a from a x,y string value. builder. Writes the GML representation of the features of NetTopologySuite model. Uses GML 2.1.1 Geometry.xsd schema for base for features. Thanks to rstuven for improvements :) Returns an XmlReader with feature informations. Use XmlDocument.Load(XmlReader) for obtain a XmlDocument to work. Writes a GML feature into a generic Stream, such a FileStream or other streams. Sets corrent length for Byte Stream. Sets corrent length for Byte Stream. Formatter for double values of coordinates Thrown by a WKTReader when a parsing problem occurs. Creates a ParseException with the given detail message. A description of this ParseException. Creates a ParseException with es detail message. An exception that occurred while a WKTReader was parsing a Well-known Text string. Converts a Well-Known Binary byte data to a Geometry. The reader repairs structurally-invalid input (specifically, LineStrings and LinearRings which contain too few points have vertices added, and non-closed rings are closed). s Converts a hexadecimal string to a byte array. The hexadecimal digit symbols are case-insensitive. A string containing hex digits An array of bytes with the value of the hex string true if structurally invalid input should be reported rather than repaired. At some point this could be made client-controllable. Initialize reader with a standard . Initialize reader with the given GeometryFactory. Reads a in binary WKB format from an array of s. The byte array to read from The geometry read if the WKB data is ill-formed. Reads a in binary WKB format from an . The stream to read from The geometry read if the WKB data is ill-formed. Function to read a coordinate sequence. The reader The number of ordinates The coordinate system The read coordinate sequence. Function to read a coordinate sequence that is supposed to form a ring. The reader The number of ordinates The coordinate system The read coordinate sequence. Function to read a coordinate sequence that is supposed to serve a line string. The reader The number of ordinates The coordinate system The read coordinate sequence. Function to convert from to The coordinate system The corresponding Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Reads a geometry. The reader The coordinate system The spatial reference id for the geometry. A geometry Function to determine whether an ordinate should be handled or not. The builder. Gets or sets whether invalid linear rings should be fixed WKB Geometry Types Point. LineString. Polygon. MultiPoint. MultiLineString. MultiPolygon. GeometryCollection. Point with Z coordinate. LineString with Z coordinate. Polygon with Z coordinate. MultiPoint with Z coordinate. MultiLineString with Z coordinate. MultiPolygon with Z coordinate. GeometryCollection with Z coordinate. Point with M ordinate value. LineString with M ordinate value. Polygon with M ordinate value. MultiPoint with M ordinate value. MultiLineString with M ordinate value. MultiPolygon with M ordinate value. GeometryCollection with M ordinate value. Point with Z coordinate and M ordinate value. LineString with Z coordinate and M ordinate value. Polygon with Z coordinate and M ordinate value. MultiPoint with Z coordinate and M ordinate value. MultiLineString with Z coordinate and M ordinate value. MultiPolygon with Z coordinate and M ordinate value. GeometryCollection with Z coordinate and M ordinate value. Writes a Well-Known Binary byte data representation of a Geometry. WKBWriter stores X,Y,Z values if is not , otherwise value is discarded and only X,Y are stored. Converts a byte array to a hexadecimal string. A byte array Converts a byte array to a hexadecimal string. A byte array Initializes writer with LittleIndian byte order. Initializes writer with the specified byte order. Encoding type Initializes writer with the specified byte order. Encoding type SRID values, present or not, should be emitted. Initializes writer with the specified byte order. Encoding type SRID values, present or not, should be emitted. Z values, present or not, should be emitted Initializes writer with the specified byte order. Encoding type SRID values, present or not, should be emitted. Z values, present or not, should be emitted M values, present or not, should be emitted Writes a WKB representation of a given point. Writes a WKB representation of a given point. Writes LittleIndian ByteOrder. Sets corrent length for Byte Stream. Sets corrent length for Byte Stream. Gets or sets whether the value should be emitted Gets or sets whether the values should be emitted Gets or sets whether the values should be emitted Standard byte size for each complex point. Each complex point (LineString, Polygon, ...) contains: 1 byte for ByteOrder and 4 bytes for WKBType. 4 bytes for SRID value Gets a value whether or not EWKB featues may be used. EWKB features are 0x80000000 flag if geometry's z-ordinate values are written 0x40000000 flag if geometry's m-ordinate values are written 0x20000000 flag if geometry's SRID value is written Converts a Well-Known Text string to a Geometry. The WKTReader allows extracting Geometry objects from either input streams or internal strings. This allows it to function as a parser to read Geometry objects from text blocks embedded in other data formats (e.g. XML). The Well-known Text format is defined in the OpenGIS Simple Features Specification for SQL . NOTE: There is an inconsistency in the SFS. The WKT grammar states that MultiPoints are represented by MULTIPOINT ( ( x y), (x y) ), but the examples show MultiPoints as MULTIPOINT ( x y, x y ). Other implementations follow the latter syntax, so NTS will adopt it as well. A WKTReader is parameterized by a GeometryFactory, to allow it to create Geometry objects of the appropriate implementation. In particular, the GeometryFactory will determine the PrecisionModel and SRID that is used. The WKTReader will convert the input numbers to the precise internal representation. reads also non-standard "LINEARRING" tags. Creates a WKTReader that creates objects using a basic GeometryFactory. Creates a WKTReader that creates objects using the given GeometryFactory. The factory used to create Geometrys. Converts a Well-known Text representation to a Geometry. one or more Geometry Tagged Text strings (see the OpenGIS Simple Features Specification) separated by whitespace. A Geometry specified by wellKnownText Converts a Well-known Text representation to a Geometry. one or more Geometry Tagged Text strings (see the OpenGIS Simple Features Specification) separated by whitespace. A Geometry specified by wellKnownText Converts a Well-known Text representation to a Geometry. A Reader which will return a "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification). A Geometry read from reader. Returns the next array of Coordinates in the stream. Tokenizer over a stream of text in Well-known Text format. The next element returned by the stream should be "(" (the beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY". if set to true skip extra parenthesis around coordinates. The next array of Coordinates in the stream, or an empty array if "EMPTY" is the next element returned by the stream. Returns the next number in the stream. Tokenizer over a stream of text in Well-known Text format. The next token must be a number. The next number in the stream. if the next token is not a valid number Returns the next "EMPTY" or "(" in the stream as uppercase text. Tokenizer over a stream of text in Well-known Text format. The next token must be "EMPTY" or "(". The next "EMPTY" or "(" in the stream as uppercase text. Returns the next ")" or "," in the stream. Tokenizer over a stream of text in Well-known Text format. The next token must be ")" or ",". The next ")" or "," in the stream. Returns the next ")" in the stream. Tokenizer over a stream of text in Well-known Text format. The next token must be ")". The next ")" in the stream. Returns the next word in the stream as uppercase text. Tokenizer over a stream of text in Well-known Text format. The next token must be a word. The next word in the stream as uppercase text. Creates a Geometry using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a <Geometry Tagged Text. A Geometry specified by the next token in the stream. Creates a Point using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a <Point Text. A Point specified by the next token in the stream. Creates a LineString using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a <LineString Text. A LineString specified by the next token in the stream. Creates a LinearRing using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a <LineString Text. A LinearRing specified by the next token in the stream. Creates a MultiPoint using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a <MultiPoint Text. A MultiPoint specified by the next token in the stream. Creates an array of Points having the given Coordinates. The Coordinates with which to create the Points The factory to create the points Points created using this WKTReader s GeometryFactory. Creates a Polygon using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a Polygon Text. A Polygon specified by the next token in the stream. Creates a MultiLineString using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a MultiLineString Text. A MultiLineString specified by the next token in the stream. Creates a MultiPolygon using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a MultiPolygon Text. A MultiPolygon specified by the next token in the stream, or if if the coordinates used to create the Polygon shells and holes do not form closed linestrings. Creates a GeometryCollection using the next token in the stream. Tokenizer over a stream of text in Well-known Text format. The next tokens must form a <GeometryCollection Text. A GeometryCollection specified by the next token in the stream. Gets or sets the factory to create geometries Gets or sets the default SRID Gets or sets whether invalid linear rings should be fixed Outputs the textual representation of a . The outputs coordinates rounded to the precision model. No more than the maximum number of necessary decimal places will be output. The Well-known Text format is defined in the OpenGIS Simple Features Specification for SQL. A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does not define a special tag for LinearRings. The standard tag to use is "LINESTRING". Generates the WKT for a Point specified by a . The point coordinate. The WKT Generates the WKT for a N-point LineString specified by a . The sequence to write. The WKT Generates the WKT for a LINESTRING specified by a {@link CoordinateSequence}. @param seq the sequence to write @return the WKT string Generates the WKT for a LineString specified by two s. The first coordinate. The second coordinate. The WKT Creates the NumberFormatInfo used to write doubles with a sufficient number of decimal places. The PrecisionModel used to determine the number of decimal places to write. A NumberFormatInfo that write doubles without scientific notation. Returns a String of repeated characters. The character to repeat. The number of times to repeat the character. A string of characters. Converts a Geometry to its Well-known Text representation. A Geometry to process. A Geometry Tagged Text string (see the OpenGIS Simple Features Specification). Converts a Geometry to its Well-known Text representation. A Geometry to process. A Stream to write into Converts a Geometry to its Well-known Text representation. A Geometry to process. A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification) Same as write, but with newlines and spaces to make the well-known text more readable. A Geometry to process A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification), with newlines and spaces. Same as write, but with newlines and spaces to make the well-known text more readable. A Geometry to process A Geometry Tagged Text string (see the OpenGIS Simple Features Specification), with newlines and spaces. Converts a Geometry to its Well-known Text representation. A Geometry to process A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification). Converts a Geometry to <Geometry Tagged Text format, then appends it to the writer. /he Geometry to process. /he output writer to append to. Converts a Coordinate to Point Tagged Text format, then appends it to the writer. The Coordinate to process. The output writer to append to. The PrecisionModel to use to convert from a precise coordinate to an external coordinate. Converts a LineString to <LineString Tagged Text format, then appends it to the writer. The LineString to process. The output writer to append to. Converts a LinearRing to <LinearRing Tagged Text format, then appends it to the writer. The LinearRing to process. The output writer to append to. Converts a Polygon to Polygon Tagged Text format, then appends it to the writer. The Polygon to process. The output writer to append to. Converts a MultiPoint to <MultiPoint Tagged Text format, then appends it to the writer. The MultiPoint to process. The output writer to append to. Converts a MultiLineString to MultiLineString Tagged Text format, then appends it to the writer. The MultiLineString to process. The output writer to append to. Converts a MultiPolygon to MultiPolygon Tagged Text format, then appends it to the writer. The MultiPolygon to process. The output writer to append to. Converts a GeometryCollection to GeometryCollection Tagged Text format, then appends it to the writer. The GeometryCollection to process. The output writer to append to. Converts a Coordinate to Point Text format, then appends it to the writer. The Coordinate to process. The output writer to append to. The PrecisionModel to use to convert from a precise coordinate to an external coordinate. Appends the i'th coordinate from the sequence to the writer the to process the index of the coordinate to write writer the output writer to append to Converts a Coordinate to Point format, then appends it to the writer. The Coordinate to process. The output writer to append to. The PrecisionModel to use to convert from a precise coordinate to an external coordinate. Converts a to a . The to convert. The as a . Converts a to <LineString Text> format, then appends it to the writer Converts a LineString to <LineString Text format, then appends it to the writer. The LineString to process. The output writer to append to. Converts a Polygon to Polygon Text format, then appends it to the writer. The Polygon to process. The output writer to append to. Converts a MultiPoint to <MultiPoint Text format, then appends it to the writer. The MultiPoint to process. The output writer to append to. Converts a MultiLineString to <MultiLineString Text format, then appends it to the writer. The MultiLineString to process. The output writer to append to. Converts a MultiPolygon to <MultiPolygon Text format, then appends it to the writer. The MultiPolygon to process. The output writer to append to. Converts a GeometryCollection to GeometryCollectionText format, then appends it to the writer. The GeometryCollection to process. The output writer to append to. Gets/sets whther the output woll be formatted Gets/sets the maximum number of coordinates per line written in formatted output. If the provided coordinate number is < 0, coordinates will be written all on one line. Gets/sets the tab size to use for indenting. If the size is non-positive Extracts the subline of a linear between two s on the line. Computes the subline of a between two s on the line. If the start location is after the end location, the computed linear geometry has reverse orientation to the input line. The line to use as the baseline. The start location. The end location. The extracted subline. Initializes a new instance of the class. Extracts a subline of the input. If is minor that , the linear geometry computed will be reversed. The start location. The end location. A linear geometry. Assumes input is valid (e.g. minor or equals to ). Supports linear referencing along a linear using the length along the line as the index. Negative length values are taken as measured in the reverse direction from the end of the geometry. Out-of-range index values are handled by clamping them to the valid range of values. Non-simple lines (i.e. which loop back to cross or touch themselves) are supported. Constructs an object which allows a linear to be linearly referenced using length as an index. The linear geometry to reference along. Computes the for the point on the line at the given index. If the index is out of range the first or last point on the line will be returned. The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. The index of the desired point. The at the given index. Computes the for the point on the line at the given index, offset by the given distance. If the index is out of range the first or last point on the line will be returned. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative. The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. The index of the desired point The distance the point is offset from the segment (positive is to the left, negative is to the right) The Coordinate at the given index Computes the for the interval on the line between the given indices. If the lies before the , the computed geometry is reversed. Computes the minimum index for a point on the line. If the line is not simple (i.e. loops back on itself) a single point may have more than one possible index. In this case, the smallest index is returned. The supplied point does not necessarily have to lie precisely on the line, but if it is far from the line the accuracy and performance of this function is not guaranteed. Use to compute a guaranteed result for points which may be far from the line. A point on the line. The minimum index of the point. Finds the index for a point on the line which is greater than the given index. If no such index exists, returns . This method can be used to determine all indexes for a point which occurs more than once on a non-simple line. It can also be used to disambiguate cases where the given point lies slightly off the line and is equidistant from two different points on the line. The supplied point does not necessarily have to lie precisely on the line, but if it is far from the line the accuracy and performance of this function is not guaranteed. Use to compute a guaranteed result for points which may be far from the line. A point on the line. The value the returned index must be greater than. The index of the point greater than the given minimum index. Computes the indices for a subline of the line. (The subline must conform to the line; that is, all vertices in the subline (except possibly the first and last) must be vertices of the line and occcur in the same order). A subLine of the line. A pair of indices for the start and end of the subline.. Computes the index for the closest point on the line to the given point. If more than one point has the closest distance the first one along the line is returned. (The point does not necessarily have to lie precisely on the line.) Tests whether an index is in the valid index range for the line. The index to test. true if the index is in the valid range. Computes a valid index for this line by clamping the given index to the valid range of index values A valid index value Returns the index of the start of the line. Returns the index of the end of the line. Initializes a new instance of the class. A linear geometry. Find the nearest location along a linear to a given point. The coordinate to locate. The location of the nearest point. Finds the nearest index along the linear to a given after the specified minimum index. If possible the location returned will be strictly greater than the . If this is not possible, the value returned will equal . (An example where this is not possible is when = [end of line] ). The coordinate to locate. The minimum location for the point location. The location of the nearest point. Computes the for a given length along a linear Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped. Computes the for a given length along a linear . The linear geometry to use. The length index of the location. The for the length. Computes the for a given length along a linear , with control over how the location is resolved at component endpoints. The linear geometry to use The length index of the location If true lengths are resolved to the lowest possible index Computes the length for a given on a linear . The linear geometry to use. The index of the location. The length for the . Initializes a new instance of the class. A linear geometry. Compute the corresponding to a length. Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped. Ambiguous indexes are resolved to the lowest possible location value. The length index. The corresponding . Compute the corresponding to a length. Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped. Ambiguous indexes are resolved to the lowest or highest possible location value, depending on the value of resolveLower The length index The corresponding . Builds a linear geometry ( or ) incrementally (point-by-point). Creates an instance of this class. The geometry factory to use. Adds a point to the current line. The to add. Adds a point to the current line. The to add. If true, allows the insertions of repeated points. Terminate the current . Builds and returns the . Allows invalid lines to be fixed rather than causing Exceptions. An invalid line is one which has only one unique point. Allows invalid lines to be ignored rather than causing Exceptions. An invalid line is one which has only one unique point. An iterator over the components and coordinates of a linear geometry (s and s. Invariant: currentLine <> null if the iterator is pointing at a valid coordinate Creates an iterator initialized to the start of a linear . The linear geometry to iterate over. if is not Creates an iterator starting at a on a linear . The linear geometry to iterate over. The location to start at. if is not Creates an iterator starting at a component and vertex in a linear . The linear geometry to iterate over. The component to start at. The vertex to start at. if is not Tests whether there are any vertices left to iterator over. Specifically, HasNext() returns true if the current state of the iterator represents a valid location on the linear geometry. true if there are more vertices to scan. Jump to the next element of the iteration. Checks whether the iterator cursor is pointing to the endpoint of a component . The component index of the vertex the iterator is currently at. The vertex index of the vertex the iterator is currently at. Gets the component the iterator is current at. Gets the first of the current segment (the coordinate of the current vertex). Gets the second of the current segment (the coordinate of the next vertex). If the iterator is at the end of a line, null is returned. Represents a location along a or .
The referenced geometry is not maintained within this location, but must be provided for operations which require it. Various methods are provided to manipulate the location value and query the geometry it references.
Gets a location which refers to the end of a linear . The linear geometry. A new LinearLocation. Computes the of a point a given fraction along the line segment (p0, p1). If the fraction is greater than 1.0 the last point of the segment is returned. If the fraction is less than or equal to 0.0 the first point of the segment is returned. The Z ordinate is interpolated from the Z-ordinates of the given points, if they are specified. The first point of the line segment. The last point of the line segment. The length to the desired point. Initializes a new instance of the class: creates a location referring to the start of a linear geometry. Initializes a new instance of the class: creates a location referring to the start of a linear geometry. Index of the segment. The segment fraction. Initializes a new instance of the class: creates a location referring to the start of a linear geometry. Index of the component. Index of the segment. The segment fraction. Initializes a new instance of the class: creates a location referring to the start of a linear geometry. Index of the component. Index of the segment. The segment fraction. If true, ensures the individual values are locally valid. Creates a new location equal to a given one. A linear location Ensures the individual values are locally valid. Does not ensure that the indexes are valid for a particular linear geometry. Ensures the indexes are valid for a given linear . A linear geometry. Snaps the value of this location to the nearest vertex on the given linear , if the vertex is closer than . A linear geometry. The minimum allowable distance to a vertex. Gets the length of the segment in the given Geometry containing this location. A linear geometry. The length of the segment. Sets the value of this location to refer to the end of a linear geometry. The linear geometry to use to set the end. Gets the along the given linear which is referenced by this location. A linear geometry. The at the location. Gets a representing the segment of the given linear which contains this location. A linear geometry the LineSegment containing the location Tests whether this location refers to a valid location on the given linear . A linear geometry. true if this location is valid. Compares the current instance with another object of the same type. The LineStringLocation with which this Coordinate is being compared. A negative integer, zero, or a positive integer as this LineStringLocation is less than, equal to, or greater than the specified LineStringLocation. is not the same type as this instance. Compares the current instance with another object of the same type. The LineStringLocation with which this Coordinate is being compared. A negative integer, zero, or a positive integer as this LineStringLocation is less than, equal to, or greater than the specified LineStringLocation. Compares this object with the specified index values for order. The component index. The segment index. The segment fraction. A negative integer, zero, or a positive integer as this LineStringLocation is less than, equal to, or greater than the specified locationValues. Compares two sets of location values for order. The first component index. The first segment index. The first segment fraction. The second component index. The second segment index. The second segment fraction. A negative integer, zero, or a positive integer as the first set of location values is less than, equal to, or greater than the second set of locationValues. Tests whether two locations are on the same segment in the parent . A location on the same geometry true if the locations are on the same segment of the parent geometry Tests whether this location is an endpoint of the linear component it refers to. The linear geometry referenced by this location True if the location is a component endpoint Converts a linear location to the lowest equivalent location index. The lowest index has the lowest possible component and segment indices. Specifically: * if the location point is an endpoint, a location value is returned as (nseg-1, 1.0) * if the location point is ambiguous (i.e. an endpoint and a startpoint), the lowest endpoint location is returned If the location index is already the lowest possible value, the original location is returned. The linear geometry referenced by this location. The lowest equivalent location. Copies this location. A copy of this location. Gets the component index for this location. Gets the segment index for this location. Gets the segment fraction for this location. Tests whether this location refers to a vertex: returns true if the location is a vertex. Supports linear referencing along a linear using s as the index. Constructs an object which allows linear referencing along a given linear . The linear geometry to reference alo Computes the for the point on the line at the given index. If the is out of range, the first or last point on the line will be returned. The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. The index of the desired point. The at the given index. Computes the for the point on the line at the given index, offset by the given distance. If the index is out of range the first or last point on the line will be returned. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative. The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. The index of the desired point The distance the point is offset from the segment (positive is to the left, negative is to the right) The Coordinate at the given index Computes the for the point on the line at the given index, offset by the given distance. If the index is out of range the first or last point on the line will be returned. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative. The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. The index of the desired point The distance the point is offset from the segment (positive is to the left, negative is to the right) The Coordinate at the given index Computes the for the interval on the line between the given indices. If the start location is after the end location, the computed linear geometry has reverse orientation to the input line. The index of the start of the interval. The index of the end of the interval. The linear interval between the indices. Computes the index for a given point on the line. The supplied point does not necessarily have to lie precisely on the line, but if it is far from the line the accuracy and performance of this function is not guaranteed. Use to compute a guaranteed result for points which may be far from the line. A point on the line. The index of the point. Computes the indices for a subline of the line. (The subline must conform to the line; that is, all vertices in the subline (except possibly the first and last) must be vertices of the line and occcur in the same order). A subLine of the line. A pair of indices for the start and end of the subline. Finds the index for a point on the line which is greater than the given index. If no such index exists, returns . This method can be used to determine all indexes for a point which occurs more than once on a non-simple line. It can also be used to disambiguate cases where the given point lies slightly off the line and is equidistant from two different points on the line. The supplied point does not necessarily have to lie precisely on the line, but if it is far from the line the accuracy and performance of this function is not guaranteed. Use to compute a guaranteed result for points which may be far from the line. A point on the line The value the returned index must be greater than The index of the point greater than the given minimum index Computes the index for the closest point on the line to the given point. If more than one point has the closest distance the first one along the line is returned. (The point does not necessarily have to lie precisely on the line.) A point on the line. The index of the point. Tests whether an index is in the valid index range for the line. The index to test. true if the index is in the valid range. Computes a valid index for this line by clamping the given index to the valid range of index values. A valid index value. Returns the index of the start of the line. Returns the index of the end of the line. Determines the location of a subline along a linear . The location is reported as a pair of s. NOTE: Currently this algorithm is not guaranteed to return the correct substring in some situations where an endpoint of the test line occurs more than once in the input line. (However, the common case of a ring is always handled correctly). Initializes a new instance of the class. The linear geom. Computes the of the point on a linear nearest a given . The nearest point is not necessarily unique; this class always computes the nearest point closest to the start of the geometry. Initializes a new instance of the class. A linear geometry. Find the nearest location along a linear to a given point. The coordinate to locate. The location of the nearest point. Find the nearest along the linear to a given after the specified minimum . If possible the location returned will be strictly greater than the . If this is not possible, the value returned will equal . (An example where this is not possible is when = [end of line] ). The coordinate to locate. The minimum location for the point location. The location of the nearest point. Represents a list of contiguous line segments, and supports noding the segments. The line segments are represented by an array of s. Intended to optimize the noding of contiguous segments by reducing the number of allocated objects. SegmentStrings can carry a context object, which is useful for preserving topological or parentage information. All noded substrings are initialized with the same context object. An interface for classes which represent a sequence of contiguous line segments. SegmentStrings can carry a context object, which is useful for preserving topological or parentage information. Gets/Sets the user-defined data for this segment string. Points that make up ISegmentString Size of Coordinate Sequence States whether ISegmentString is closed Creates a new segment string from a list of vertices. the vertices of the segment string the user-defined data of this segment string (may be null) Gets the octant of the segment starting at vertex index the index of the vertex starting the segment. Must not be the last index in the vertex list octant of the segment at the vertex Gets the user-defined data for this segment string. Validates that a collection of s is correctly noded. Indexing is used to improve performance. In the most common use case, validation stops after a single non-noded intersection is detected, but the class can be requested to detect all intersections by using the property. The validator does not check for a-b-a topology collapse situations. The validator does not check for endpoint-interior vertex intersections. This should not be a problem, since the JTS noders should be able to compute intersections between vertices correctly. The client may either test the condition, or request that a suitable be thrown. Creates a new noding validator for a given set of linework. A collection of s Returns an error message indicating the segments containing the intersection. an error message documenting the intersection location Checks for an intersection and throws a TopologyException if one is found. if an intersection is found Gets or sets whether all intersections should be found. Gets a list of all intersections found. Intersections are represented as s. List is empty if none were found. Checks for an intersection and reports if one is found. An interface for classes which support adding nodes to a segment string. Adds an intersection node for a given point and segment to this segment string. the location of the intersection the index of the segment containing the intersection Creates an intersection finder which tests if there is at least one interior intersection. Uses short-circuiting for efficient performance. The intersection found is recorded. A line intersector. A intersection finder which tests if there is at least one interior intersection. Creates an intersection finder which finds all interior intersections. The intersections are recorded for later inspection. A line intersector. a intersection finder which finds all interior intersections. Creates an intersection finder which counts all interior intersections. The intersections are note recorded to reduce memory usage. A line intersector. a intersection finder which counts all interior intersections. Creates an intersection finder which finds an interior intersection if one exists the LineIntersector to use This method is called by clients of the class to process intersections for two segments of the s being intersected.
Note that some clients (such as MonotoneChains) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).
Tests whether a segment in a is an end segment. (either the first or last). a segment string the index of a segment in the segment string true if the segment is an end segment Gets/Sets whether all intersections should be computed. When this is false (the default value), the value of is true after the first intersection is found. Default is false. Gets/Sets whether intersection points are recorded. If the only need is to count intersection points, this can be set to false. Default is true. Gets/Sets whether only end segments should be tested for interior intersection. This is a performance optimization that may be used if the segments have been previously noded by an appropriate algorithm. It may be known that any potential noding failures will occur only in end segments. Tests whether an intersection was found. Gets the intersections found. A list of . Gets the count of intersections found. The intersection count. Gets the computed location of the intersection. Due to round-off, the location may not be exact. Gets the endpoints of the intersecting segments. Computes the possible intersections between two line segments in s and adds them to each string using . These variables keep track of what types of intersections were found during ALL edges that have been intersected. Initializes a new instance of the class. A trivial intersection is an apparent self-intersection which in fact is simply the point shared by adjacent line segments. Note that closed edges require a special check for the point shared by the beginning and end segments. This method is called by clients of the class to process intersections for two segments of the being intersected.
Note that some clients (such as MonotoneChain") may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).
Returns the proper intersection point, or null if none was found. A proper intersection is an intersection which is interior to at least two line segments. Note that a proper intersection is not necessarily in the interior of the entire , since another edge may have an endpoint equal to the intersection, which according to SFS semantics can result in the point being on the Boundary of the . A proper interior intersection is a proper intersection which is not contained in the set of boundary nodes set for this . An interior intersection is an intersection which is in the interior of some segment. Always process all intersections Finds interior intersections between line segments in s, and adds them as nodes using . This class is used primarily for Snap-Rounding. For general-purpose noding, use . This class is obsolete. Use instead. Creates an intersection finder which finds all proper intersections. The to use. This method is called by clients of the class to process intersections for two segments of the s being intersected.
Note that some clients (such as MonotoneChains) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).
Always process all intersections Nodes a set of s completely. The set of s is fully noded; i.e. noding is repeated until no further intersections are detected. Iterated noding using a precision model is not guaranteed to converge, due to roundoff error. This problem is detected and an exception is thrown. Clients can choose to rerun the noding using a lower precision model. Computes all intersections between segments in a set of s. Intersections found are represented as s and added to the s in which they occur. As a final step in the noding a new set of segment strings split at the nodes may be returned. Computes the noding for a collection of s. Some Noders may add all these nodes to the input s; others may only add some or none at all. Returns a of fully noded s. The s have the same context as their parent. Initializes a new instance of the class. Returns a of fully noded s. The s have the same context as their parent. Fully nodes a list of s, i.e. peforms noding iteratively until no intersections are found between segments. Maintains labelling of edges correctly through the noding. A collection of SegmentStrings to be noded. If the iterated noding fails to converge. Node the input segment strings once and create the split edges between the nodes. Gets/Sets the maximum number of noding iterations performed before the noding is aborted. Experience suggests that this should rarely need to be changed from the default. The default is . Nodes a set of s using a index based on s and a . The used should be something that supports envelope (range) queries efficiently (such as a Quadtree" or . Base class for s which make a single pass to find intersections. This allows using a custom (which for instance may simply identify intersections, rather than insert them). Initializes a new instance of the class. Initializes a new instance of the class. The to use. Computes the noding for a collection of s. Some Noders may add all these nodes to the input s; others may only add some or none at all. Returns a of fully noded s. The s have the same context as their parent. Gets/sets the to use with this noder. A will normally add intersection nodes to the input segment strings, but it may not - it may simply record the presence of intersections. However, some s may require that intersections be added. Initializes a new instance of the class. Initializes a new instance of the class. The to use. Returns a of fully noded s. The s have the same context as their parent. Computes the noding for a collection of s. Some Noders may add all these nodes to the input s; others may only add some or none at all. Initializes a new instance of the class. The Validates that a collection of s is correctly noded. Throws an appropriate exception if an noding error is found. Creates a new validator for the given collection of s. The seg strings. Checks whether the supplied segment strings are correctly noded. Throws an exception if they are not. Checks if a segment string contains a segment pattern a-b-a (which implies a self-intersection). Checks all pairs of segments for intersections at an interior point of a segment. Checks for intersections between an endpoint of a segment string and an interior vertex of another segment string Octants in the Cartesian plane. Octants are numbered as follows: \2|1/ 3 \|/ 0 ---+-- 4 /|\ 7 /5|6\ If line segments lie along a coordinate axis, the octant is the lower of the two possible values. Methods for computing and working with of the Cartesian plane. Returns the octant of a directed line segment (specified as x and y displacements, which cannot both be 0). Returns the octant of a directed line segment from p0 to p1. Allows comparing arrays in an orientation-independent way. Creates a new } for the given array. Computes the canonical orientation for a coordinate array. true if the points are oriented forwards
or falseif the points are oriented in reverse.
Compares two s for their relative order. -1 this one is smaller;
0 the two objects are equal;
1 this one is greater.
Wraps a and transforms its input into the integer domain. This is intended for use with Snap-Rounding noders, which typically are only intended to work in the integer domain. Offsets can be provided to increase the number of digits of available precision. Clients should be aware that rescaling can involve loss of precision, which can cause zero-length line segments to be created. These in turn can cause problems when used to build a planar graph. This situation should be checked for and collapsed segments removed if necessary. Initializes a new instance of the class. Represents an intersection point between two s. Initializes a new instance of the class. -1 this SegmentNode is located before the argument location;
0 this SegmentNode is at the argument location;
1 this SegmentNode is located after the argument location.
Gets the giving the location of this node. A list of the s present along a noded . Initializes a new instance of the class. The edge. Adds an intersection into the list, if it isn't already there. The input segmentIndex and dist are expected to be normalized. The SegmentIntersection found or added. Returns an iterator of SegmentNodes. An iterator of SegmentNodes. Adds nodes for the first and last points of the edge. Adds nodes for any collapsed edge pairs. Collapsed edge pairs can be caused by inserted nodes, or they can be pre-existing in the edge vertex list. In order to provide the correct fully noded semantics, the vertex at the base of a collapsed pair must also be added as a node. Adds nodes for any collapsed edge pairs which are pre-existing in the vertex list. Adds nodes for any collapsed edge pairs caused by inserted nodes Collapsed edge pairs occur when the same coordinate is inserted as a node both before and after an existing edge vertex. To provide the correct fully noded semantics, the vertex must be added as a node as well. Creates new edges for all the edges that the intersections in this list split the parent edge into. Adds the edges to the provided argument list (this is so a single list can be used to accumulate all split edges for a set of s). Create a new "split edge" with the section of points between (and including) the two intersections. The label for the new edge is the same as the label for the parent edge. Gets the list of coordinates for the fully noded segment string, including all original segment string vertices and vertices introduced by nodes in this list. Repeated coordinates are collapsed. An array of s Not implemented. This method is not implemented. Implements a robust method of comparing the relative position of two points along the same segment. The coordinates are assumed to lie "near" the segment. This means that this algorithm will only return correct results if the input coordinates have the same precision and correspond to rounded values of exact coordinates lying on the segment. Compares two s for their relative position along a segment lying in the specified . -1 if node0 occurs first, or
0 if the two nodes are equal, or
1 if node1 occurs first.
Represents a list of contiguous line segments, and supports noding the segments. The line segments are represented by an array of s. Intended to optimize the noding of contiguous segments by reducing the number of allocated objects. s can carry a context object, which is useful for preserving topological or parentage information. All noded substrings are initialized with the same context object. Gets the s which result from splitting this string at node points. A collection of NodedSegmentStrings A collection of NodedSegmentStrings representing the substrings Adds the noded s which result from splitting this string at node points. A collection of NodedSegmentStrings A list which will collect the NodedSegmentStrings representing the substrings Creates a new segment string from a list of vertices. The vertices of the segment string. The user-defined data of this segment string (may be null). Gets the octant of the segment starting at vertex index. The index of the vertex starting the segment. Must not be the last index in the vertex list The octant of the segment at the vertex Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge intersection list. Add an for intersection intIndex. An intersection that falls exactly on a vertex of the is normalized to use the higher of the two possible segmentIndexes. Gets/Sets the user-defined data for this segment string. Dissolves a noded collection of s to produce a set of merged linework with unique segments. A custom merging strategy can be supplied. This strategy will be called when two identical (up to orientation) strings are dissolved together. The default merging strategy is simply to discard one of the merged strings. A common use for this class is to merge noded edges while preserving topological labelling. This requires a custom merging strategy to be supplied to merge the topology labels appropriately. Creates a dissolver with a user-defined merge strategy. Creates a dissolver with the default merging strategy. Dissolve all s in the input . Dissolve the given . Gets the collection of dissolved (i.e. unique) s A merging strategy which can be used to update the context data of s which are merged during the dissolve process. mbdavis Updates the context data of a when an identical (up to orientation) one is found during dissolving. The segment string to update. The segment string being dissolved. true if the strings are in the same direction, false if they are opposite. Nodes a set of s by performing a brute-force comparison of every segment to every other one. This has n^2 performance, so is too slow for use on large numbers of segments. Initializes a new instance of the class. Initializes a new instance of the class. Returns a of fully noded s. The s have the same context as their parent. Computes the noding for a collection of s. Some Noders may add all these nodes to the input s; others may only add some or none at all. Nodes the linework in a list of s using Snap-Rounding to a given . The input coordinates are expected to be rounded to the given precision model. This class does not perform that function. GeometryPrecisionReducer" may be used to do this. This class does not dissolve the output linework, so there may be duplicate linestrings in the output. Subsequent processing (e.g. polygonization) may require the linework to be unique. Using UnaryUnion is one way to do this (although this is an inefficient approach). Creates a new noder which snap-rounds to a grid specified by the given The precision model for the grid to snap-round to. Nodes the linework of a set of Geometrys using SnapRounding. A collection of Geometrys of any type A list of LineStrings representing the noded linework of the input Gets or sets whether noding validity is checked after noding is performed. Implements a "hot pixel" as used in the Snap Rounding algorithm. A hot pixel contains the interior of the tolerance square and the boundary minus the top and right segments. The hot pixel operations are all computed in the integer domain to avoid rounding problems. Initializes a new instance of the class. The coordinate at the center of the hot pixel The scale factor determining the pixel size THe intersector to use for testing intersection with line segments Returns a "safe" envelope that is guaranteed to contain the hot pixel. The envelope returned will be larger than the exact envelope of the pixel. An envelope which contains the pixel Tests whether the line segment (p0-p1) intersects this hot pixel. The first coordinate of the line segment to test The second coordinate of the line segment to test true if the line segment intersects this hot pixel. Tests whether the line segment (p0-p1) intersects this hot pixel. Tests whether the segment p0-p1 intersects the hot pixel tolerance square. Because the tolerance square point set is partially open (along the top and right) the test needs to be more sophisticated than simply checking for any intersection. However, it can take advantage of the fact that the hot pixel edges do not lie on the coordinate grid. It is sufficient to check if any of the following occur: - a proper intersection between the segment and any hot pixel edge. - an intersection between the segment and BOTH the left and bottom hot pixel edges (which detects the case where the segment intersects the bottom left hot pixel corner). - an intersection between a segment endpoint and the hot pixel coordinate. Test whether the given segment intersects the closure of this hot pixel. This is NOT the test used in the standard snap-rounding algorithm, which uses the partially closed tolerance square instead. This routine is provided for testing purposes only. Adds a new node (equal to the snap pt) to the specified segment if the segment passes through the hot pixel true if a node was added to the segment Gets the coordinate this hot pixel is based at. "Snaps" all s in a containing s to a given . Initializes a new instance of the class. Snaps (nodes) all interacting segments to this hot pixel. The hot pixel may represent a vertex of an edge, in which case this routine uses the optimization of not noding the vertex itself The hot pixel to snap to. The edge containing the vertex, if applicable, or null. true if a node was added for this pixel. Snaps (nodes) all interacting segments to this hot pixel. The hot pixel may represent a vertex of an edge, in which case this routine uses the optimization of not noding the vertex itself The hot pixel to snap to. true if a node was added for this pixel. Initializes a new instance of the class. Uses Snap Rounding to compute a rounded, fully noded arrangement from a set of s. Implements the Snap Rounding technique described in papers by Hobby, Guibas and Marimont, and Goodrich et al. Snap Rounding assumes that all vertices lie on a uniform grid; hence the precision model of the input must be fixed precision, and all the input vertices must be rounded to that precision. This implementation uses a monotone chains and a spatial index to speed up the intersection tests. This implementation appears to be fully robust using an integer precision model. It will function with non-integer precision models, but the results are not 100% guaranteed to be correctly noded. Initializes a new instance of the class. The to use. Returns a of fully noded s. The s have the same context as their parent. Computes the noding for a collection of s. Some Noders may add all these nodes to the input s; others may only add some or none at all. Computes all interior intersections in the collection of s, and returns their s. Does NOT node the segStrings. A list of Coordinates for the intersections. Snaps segments to nodes created by segment intersections. Snaps segments to all vertices The list of segment strings to snap together Snaps segments to the vertices of a Segment String. Initializes a new instance of the class. The to use. Returns a of fully noded s. The s have the same context as their parent. A Collection of NodedSegmentStrings representing the substrings Computes the noding for a collection of s. Some Noders may add all these nodes to the input s; others may only add some or none at all. A collection of NodedSegmentStrings Computes all interior intersections in the collection of s, and returns their s. Does NOT node the segStrings. A list of s for the intersections. Computes nodes introduced as a result of snapping segments to snap points (hot pixels). Computes nodes introduced as a result of snapping segments to vertices of other segments. The list of segment strings to snap together Performs a brute-force comparison of every segment in each . This has n^2 performance. Computes the boundary of a . Allows specifying the to be used. This operation will always return a of the appropriate dimension for the boundary (even if the input geometry is empty). The boundary of zero-dimensional geometries (Points) is always the empty . Martin Davis A map which maintains the edges in sorted order around the node. Stores an integer count, for use as a Map entry. Martin Davis Builds the buffer geometry for a given input geometry and precision model. Allows setting the level of approximation for circular arcs, and the precision model in which to carry out the computation. When computing buffers in floating point double-precision it can happen that the process of iterated noding can fail to converge (terminate). In this case a will be thrown. Retrying the computation in a fixed precision can produce more robust results. Compute the change in depth as an edge is crossed from R to L Creates a new BufferBuilder Inserted edges are checked to see if an identical edge already exists. If so, the edge is not inserted, but its label is merged with the existing edge. Completes the building of the input subgraphs by depth-labelling them, and adds them to the PolygonBuilder. The subgraph list must be sorted in rightmost-coordinate order. the subgraphs to build the PolygonBuilder which will build the final polygons Gets the standard result for an empty buffer. Since buffer always returns a polygonal result, this is chosen to be an empty polygon. The empty result geometry Sets the precision model to use during the curve computation and noding, if it is different to the precision model of the Geometry. If the precision model is less than the precision of the Geometry precision model, the Geometry must have previously been rounded to that precision. Sets the to use during noding. This allows choosing fast but non-robust noding, or slower but robust noding. Simplifies a buffer input line to remove concavities with shallow depth. The most important benefit of doing this is to reduce the number of points and the complexity of shape which will be buffered. It also reduces the risk of gores created by the quantized fillet arcs (although this issue should be eliminated in any case by the offset curve generation logic). A key aspect of the simplification is that it affects inside (concave or inward) corners only. Convex (outward) corners are preserved, since they are required to ensure that the generated buffer curve lies at the correct distance from the input geometry. Another important heuristic used is that the end segments of the input are never simplified. This ensures that the client buffer code is able to generate end caps faithfully. No attempt is made to avoid self-intersections in the output. This is acceptable for use for generating a buffer offset curve, since the buffer algorithm is insensitive to invalid polygonal geometry. However, this means that this algorithm cannot be used as a general-purpose polygon simplification technique. Martin Davis Simplify the input coordinate list. If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. The coordinate list to simplify simplification distance tolerance to use The simplified coordinate list Simplify the input coordinate list. If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. Simplification distance tolerance to use The simplified coordinates list Uses a sliding window containing 3 vertices to detect shallow angles in which the middle vertex can be deleted, since it does not affect the shape of the resulting buffer in a significant way. Finds the next non-deleted index, or the end of the point array if none The start index to search from The next non-deleted index, if any
or _inputLine.Length if there are no more non-deleted indices
Checks for shallowness over a sample of points in the given section. This helps to prevent the siplification from incrementally "skipping" over points which are in fact non-shallow. A coordinate of section A coordinate of section The start index of section The end index of section The tolerated distance Computes the buffer of a geometry, for both positive and negative buffer distances. In GIS, the positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with a circle of radius equal to the absolute value of the buffer distance. In the CAD/CAM world buffers are known as offset curves. In morphological analysis the operation of positive and negative buffering is referred to as erosion and dilation The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty . Since true buffer curves may contain circular arcs, computed buffer polygons are only approximations to the true geometry. The user can control the accuracy of the approximation by specifying the number of linear segments used to approximate arcs. This is specified via or . The of a linear buffer may be specified. The following end cap styles are supported:
  • - the usual round end caps
  • - end caps are truncated flat at the line ends
  • - end caps are squared off at the buffer distance beyond the line ends
The of the corners in a buffer may be specified. The following join styles are supported:
  • - the usual round join
  • - corners are "sharp" (up to a distance limit})
  • - corners are beveled (clipped off)
The buffer algorithm can perform simplification on the input to increase performance. The simplification is performed a way that always increases the buffer area (so that the simplified input covers the original input). The degree of simplification can be specified with , with a used otherwise. Note that if the buffer distance is zero then so is the computed simplify tolerance, no matter what the simplify factor.
A number of digits of precision which leaves some computational "headroom" for floating point operations. This value should be less than the decimal precision of double-precision values (16). Compute a scale factor to limit the precision of a given combination of Geometry and buffer distance. The scale factor is determined by the number of digits of precision in the (geometry + buffer distance), limited by the supplied value. The scale factor is based on the absolute magnitude of the (geometry + buffer distance). since this determines the number of digits of precision which must be handled. the Geometry being buffered the buffer distance the max # of digits that should be allowed by the precision determined by the computed scale factor a scale factor for the buffer computation Computes the buffer of a geometry for a given buffer distance. the geometry to buffer the buffer distance the buffer of the input geometry Comutes the buffer for a geometry for a given buffer distance and accuracy of approximation. the geometry to buffer the buffer distance the buffer parameters to use the buffer of the input geometry Comutes the buffer for a geometry for a given buffer distance and accuracy of approximation. the geometry to buffer the buffer distance the number of segments used to approximate a quarter circle the buffer of the input geometry Comutes the buffer for a geometry for a given buffer distance and accuracy of approximation. the geometry to buffer the buffer distance the number of segments used to approximate a quarter circle the end cap style to use the buffer of the input geometry Initializes a buffer computation for the given geometry the geometry to buffer Initializes a buffer computation for the given geometry with the given set of parameters the geometry to buffer the buffer parameters to use Returns the buffer computed for a geometry for a given buffer distance. the buffer distance the buffer of the input geometry Specifies the end cap style of the generated buffer. The styles supported are , , and . The default is . Sets the number of segments used to approximate a angle fillet A value class containing the parameters which specify how a buffer should be constructed. The parameters allow control over: Quadrant segments (accuracy of approximation for circular arcs) End Cap style Join style Mitre limit whether the buffer is single-sided Martin Davis The default number of facets into which to divide a fillet of 90 degrees. A value of 8 gives less than 2% max error in the buffer distance. For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18. The default mitre limit Allows fairly pointy mitres. The default simplify factor. Provides an accuracy of about 1%, which matches the accuracy of the parameter. Creates a default set of parameters Creates a set of parameters with the given quadrantSegments value. The number of quadrant segments to use Creates a set of parameters with the given quadrantSegments and endCapStyle values. the number of quadrant segments to use the end cap style to use Creates a set of parameters with the given parameter values. the number of quadrant segments to use the end cap style to use the join style to use the mitre limit to use Computes the maximum distance error due to a given level of approximation to a true arc. The number of segments used to approximate a quarter-circle The error of approximation Gets/sets the number of quadrant segments which will be used QuadrantSegments is the number of line segments used to approximate an angle fillet. QuadrantSegments >>= 1joins are round, and QuadrantSegments indicates the number of segments to use to approximate a quarter-circle. QuadrantSegments = 0joins are beveled QuadrantSegments < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |QuadrantSegments| For round joins, QuadrantSegments determines the maximum error in the approximation to the true buffer curve. The default value of 8 gives less than 2% max error in the buffer distance. For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18. The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve). Gets/Sets the end cap style of the generated buffer. The styles supported are , , and . The default is . Gets/Sets the join style for outside (reflex) corners between line segments. Allowable values are (which is the default), and Sets the limit on the mitre ratio used for very sharp corners. The mitre ratio is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend far beyond the original geometry. (and in the extreme case will be infinitely far.) To prevent unreasonable geometry, the mitre limit allows controlling the maximum length of the join corner. Corners with a ratio which exceed the limit will be beveled. Gets or sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line. The side used is determined by the sign of the buffer distance: a positive distance indicates the left-hand side a negative distance indicates the right-hand side The single-sided buffer of point geometries is the same as the regular buffer. The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of . Factor used to determine the simplify distance tolerance for input simplification. Simplifying can increase the performance of computing buffers. Generally the simplify factor should be greater than 0. Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. Larger values sacrifice accuracy in return for performance. A connected subset of the graph of DirectedEdges and Nodes. Its edges will generate either a single polygon in the complete buffer, with zero or more holes, or one or more connected holes. Creates the subgraph consisting of all edges reachable from this node. Finds the edges in the graph and the rightmost coordinate. A node to start the graph traversal from. Adds all nodes and edges reachable from this node to the subgraph. Uses an explicit stack to avoid a large depth of recursion. A node known to be in the subgraph. Adds the argument node and all its out edges to the subgraph The node to add. The current set of nodes being traversed. Compute depths for all dirEdges via breadth-first traversal of nodes in graph. Edge to start processing with. Find all edges whose depths indicates that they are in the result area(s). Since we want polygon shells to be oriented CW, choose dirEdges with the interior of the result on the RHS. Mark them as being in the result. Interior Area edges are the result of dimensional collapses. They do not form part of the result area boundary. BufferSubgraphs are compared on the x-value of their rightmost Coordinate. This defines a partial ordering on the graphs such that: g1 >= g2 - Ring(g2) does not contain Ring(g1) where Polygon(g) is the buffer polygon that is built from g. This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to be built before holes. Gets the rightmost coordinate in the edges of the subgraph. Computes the raw offset curve for a single component (ring, line or point). A raw offset curve line is not noded - it may contain self-intersections (and usually will). The final buffer polygon is computed by forming a topological graph of all the noded raw curves and tracing outside contours. The points in the raw curve are rounded to a given . This method handles single points as well as LineStrings. LineStrings are assumed not to be closed (the function will not fail for closed lines, but will generate superfluous line caps). The vertices of the line to offset The offset distance A Coordinate array representing the curve
or null if the curve is empty
This method handles the degenerate cases of single points and lines, as well as rings. A Coordinate array representing the curve
or null if the curve is empty
Computes the distance tolerance to use during input line simplification. The buffer distance The simplification tolerance Gets the buffer parameters being used to generate the curve. Generates segments which form an offset curve. Supports all end cap and join options provided for buffering. This algorithm implements various heuristics to produce smoother, simpler curves which are still within a reasonable tolerance of the true curve. Martin Davis Factor which controls how close offset segments can be to skip adding a filler or mitre. Factor which controls how close curve vertices on inside turns can be to be snapped Factor which controls how close curve vertices can be to be snapped Factor which determines how short closing segs can be for round buffers the max error of approximation (distance) between a quad segment and the true fillet curve The angle quantum with which to approximate a fillet curve (based on the input # of quadrant segments) The Closing Segment Length Factor controls how long "closing segments" are. Closing segments are added at the middle of inside corners to ensure a smoother boundary for the buffer offset curve. In some cases (particularly for round joins with default-or-better quantization) the closing segments can be made quite short. This substantially improves performance (due to fewer intersections being created). A closingSegFactor of 0 results in lines to the corner vertex A closingSegFactor of 1 results in lines halfway to the corner vertex A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex (this option is reasonable for the very common default situation of round joins and quadrantSegs >= 8) Add last offset point Adds the offset points for an outside (convex) turn Adds the offset points for an inside (concave) turn. Compute an offset segment for an input segment on a given side and at a given distance. The offset points are computed in full double precision, for accuracy. The segment to offset The side of the segment the offset lies on The offset distance The points computed for the offset segment Add an end cap around point , terminating a line segment coming from Adds a mitre join connecting the two reflex offset segments. The mitre will be beveled if it exceeds the mitre ratio limit. The first offset segment The second offset segment The offset distance Adds a limited mitre join connecting the two reflex offset segments. A limited mitre is a mitre which is beveled at the distance determined by the mitre ratio limit. The first offset segment The second offset segment The offset distance The mitre limit ratio Adds a bevel join connecting the two offset segments around a reflex corner. The first offset segment The second offset segment Add points for a circular fillet around a reflex corner. Adds the start and end points Base point of curve Start point of fillet curve Endpoint of fillet curve The orientation of the fillet The radius of the fillet Adds points for a circular fillet arc between two specified angles. The start and end point for the fillet are not added - the caller must add them if required. Is -1 for a angle, 1 for a angle The radius of the fillet Creates a circle around a point Creates a square around a point Gets whether the input has a narrow concave angle (relative to the offset distance). In this case the generated offset curve will contain self-intersections and heuristic closing segments. This is expected behaviour in the case of buffer curves. For pure offset curves, the output needs to be further treated before it can be used. A dynamic list of the vertices in a constructed offset curve. Automatically removes adjacent vertices which are closer than a given tolerance. Martin Davis The distance below which two adjacent points on the curve are considered to be coincident. This is chosen to be a small fraction of the offset distance. Tests whether the given point is redundant relative to the previous point in the list (up to tolerance). true if the point is redundant Computes the raw offset curve for a single component (ring, line or point). A raw offset curve line is not noded - it may contain self-intersections (and usually will). The final buffer polygon is computed by forming a topological graph of all the noded raw curves and tracing outside contours. The points in the raw curve are rounded to the required precision model. Factor which controls how close curve vertices can be to be snapped Factor which controls how close offset segments can be to skip adding a filler or mitre. Factor which controls how close curve vertices on inside turns can be to be snapped Factor which determines how short closing segs can be for round buffers Use a value which results in a potential distance error which is significantly less than the error due to the quadrant segment discretization. For QS = 8 a value of 100 is reasonable. This should produce a maximum of 1% distance error. The angle quantum with which to approximate a fillet curve (based on the input # of quadrant segments) the max error of approximation (distance) between a quad segment and the true fillet curve The Closing Segment Factor controls how long "closing segments" are. Closing segments are added at the middle of inside corners to ensure a smoother boundary for the buffer offset curve. In some cases (particularly for round joins with default-or-better quantization) the closing segments can be made quite short. This substantially improves performance (due to fewer intersections being created). A closingSegFactor of 0 results in lines to the corner vertex A closingSegFactor of 1 results in lines halfway to the corner vertex A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex (this option is reasonable for the very common default situation of round joins and quadrantSegs >= 8) This method handles single points as well as lines. Lines are assumed to not be closed (the function will not fail for closed lines, but will generate superfluous line caps). a List of Coordinate[] This method handles the degenerate cases of single points and lines, as well as rings. a List of Coordinate[] Computes the distance tolerance to use during input line simplification. @param distance the buffer distance @return the simplification tolerance Adds the offset points for an outside (convex) turn Adds the offset points for an inside (concave) turn. Add last offset point Compute an offset segment for an input segment on a given side and at a given distance. The offset points are computed in full double precision, for accuracy. The segment to offset The side of the segment () the offset lies on The offset distance The points computed for the offset segment Add an end cap around point p1, terminating a line segment coming from p0 Adds a mitre join connecting the two reflex offset segments. The mitre will be beveled if it exceeds the mitre ratio limit. The base point The first offset segment The second offset segment The offset distance Adds a limited mitre join connecting the two reflex offset segments. A limited mitre is a mitre which is beveled at the distance determined by the mitre ratio limit. The first offset segment The second offset segment The offset distance The mitre limit ratio Adds a bevel join connecting the two offset segments around a reflex corner. The first offset segment The second offset segment Add points for a circular fillet around a reflex corner. Adds the start and end points Base point of curve Start point of fillet curve Endpoint of fillet curve The orientation of the fillet The radius of the fillet Adds points for a circular fillet arc between two specified angles. The start and end point for the fillet are not added - the caller must add them if required. The point around which to add the fillet points The start angle (in radians) The end angle (in radians) Is -1 for a CW angle, 1 for a CCW angle The radius of the fillet Adds a CW circle around a point Adds a CW square around a point Creates all the raw offset curves for a buffer of a Geometry. Raw curves need to be noded together and polygonized to form the final buffer area. Computes the set of raw offset curves for the buffer. Each offset curve has an attached {Label} indicating its left and right location. A Collection of SegmentStrings representing the raw buffer curves. Creates a {SegmentString} for a coordinate list which is a raw offset curve, and adds it to the list of buffer curves. The SegmentString is tagged with a Label giving the topology of the curve. The curve may be oriented in either direction. If the curve is oriented CW, the locations will be: Left: Location.Exterior. Right: Location.Interior. Add a Point to the graph. Adds an offset curve for a polygon ring. The side and left and right topological location arguments assume that the ring is oriented CW. If the ring is in the opposite orientation, the left and right locations must be interchanged and the side flipped. The coordinates of the ring (must not contain repeated points). The distance at which to create the buffer. The side of the ring on which to construct the buffer line. The location on the L side of the ring (if it is CW). The location on the R side of the ring (if it is CW). The ringCoord is assumed to contain no repeated points. It may be degenerate (i.e. contain only 1, 2, or 3 points). In this case it has no area, and hence has a minimum diameter of 0. Tests whether a triangular ring would be eroded completely by the given buffer distance. This is a precise test. It uses the fact that the inner buffer of a triangle converges on the inCentre of the triangle (the point equidistant from all sides). If the buffer distance is greater than the distance of the inCentre from a side, the triangle will be eroded completely. This test is important, since it removes a problematic case where the buffer distance is slightly larger than the inCentre distance. In this case the triangle buffer curve "inverts" with incorrect topology, producing an incorrect hole in the buffer. A list of the vertices in a constructed offset curve. Automatically removes close adjacent vertices. Martin Davis Function to add a point The point is only added if evaluates to false. The point to add. Tests whether the given point duplicates the previous point in the list (up to tolerance) The point to test true if the point duplicates the previous point Automatically closes the ring (if it not alread is). Gets/Sets the precision model to use when adding new points. The distance below which two adjacent points on the curve are considered to be coincident. This is chosen to be a small fraction of the offset distance. Gets the Coordinates for the curve. A RightmostEdgeFinder find the DirectedEdge in a list which has the highest coordinate, and which is oriented L to R at that point. (I.e. the right side is on the RHS of the edge.) Locates a subgraph inside a set of subgraphs, in order to determine the outside depth of the subgraph. The input subgraphs are assumed to have had depths already calculated for their edges. Finds all non-horizontal segments intersecting the stabbing line. The stabbing line is the ray to the right of stabbingRayLeftPt. The left-hand origin of the stabbing line. A List of {DepthSegments} intersecting the stabbing line. Finds all non-horizontal segments intersecting the stabbing line in the list of dirEdges. The stabbing line is the ray to the right of stabbingRayLeftPt. The left-hand origin of the stabbing line. The current list of DepthSegments intersecting the stabbing line. Finds all non-horizontal segments intersecting the stabbing line in the input dirEdge. The stabbing line is the ray to the right of stabbingRayLeftPt. The left-hand origin of the stabbing line. The current list of DepthSegments intersecting the stabbing line. A segment from a directed edge which has been assigned a depth value for its sides. Defines a comparison operation on DepthSegments which orders them left to right. Assumes the segments are normalized. The definition of ordering is: -1 : if DS1.seg is left of or below DS2.seg (DS1 < DS2). 1 : if DS1.seg is right of or above DS2.seg (DS1 > DS2). 0 : if the segments are identical Known Bugs: The logic does not obey the contract. This is acceptable for the intended usage, but may cause problems if used with some utilities in the .Net standard library (e.g. . A DepthSegment The comparison value Compare two collinear segments for left-most ordering. If segs are vertical, use vertical ordering for comparison. If segs are equal, return 0. Segments are assumed to be directed so that the second coordinate is >= to the first (e.g. up and to the right). A segment to compare. A segment to compare. Finds the approximate maximum distance from a buffer curve to the originating geometry. The approximate maximum distance is determined by testing all vertices in the buffer curve, as well as midpoints of the curve segments. Due to the way buffer curves are constructed, this should be a very close approximation. This is similar to the Discrete Oriented Hausdorff distance from the buffer curve to the input. mbdavis Validates that a given buffer curve lies an appropriate distance from the input generating it. Useful only for round buffers (cap and join). Can be used for either positive or negative distances. This is a heuristic test, and may return false positive results (I.e. it may fail to detect an invalid result.) It should never return a false negative result, however (I.e. it should never report a valid result as invalid.) mbdavis Maximum allowable fraction of buffer distance the actual distance can differ by. 1% sometimes causes an error - 1.2% should be safe. Checks that two geometries are at least a minumum distance apart. A geometry A geometry The minimum distance the geometries should be separated by Checks that the furthest distance from the buffer curve to the input is less than the given maximum distance. This uses the Oriented Hausdorff distance metric. It corresponds to finding the point on the buffer curve which is furthest from some point on the input. A geometry A geometry The maximum distance that a buffer result can be from the input Gets a geometry which indicates the location and nature of a validation failure. The indicator is a line segment showing the location and size of the distance discrepancy. A geometric error indicator or null, if no error was found Validates that the result of a buffer operation is geometrically correct, within a computed tolerance. This is a heuristic test, and may return false positive results (I.e. it may fail to detect an invalid result.) It should never return a false negative result, however (I.e. it should never report a valid result as invalid.) This test may be (much) more expensive than the original buffer computation. Martin Davis Maximum allowable fraction of buffer distance the actual distance can differ by. 1% sometimes causes an error - 1.2% should be safe. Checks whether the geometry buffer is valid, and returns an error message if not. An appropriate error message
or nullif the buffer is valid
Gets the error message Gets the error location Gets a geometry which indicates the location and nature of a validation failure. If the failure is due to the buffer curve being too far or too close to the input, the indicator is a line segment showing the location and size of the discrepancy. A geometric error indicator
or null, if no error was found
Computes the Euclidean distance (L2 metric) from a Point to a Geometry. Also computes two points which are separated by the distance. Contains a pair of points and the distance between them. Provides methods to update with a new point pair with either maximum or minimum distance. Initializes the points, avoiding recomputing the distance. The first point The second point The distance between and A wrapper which projects 3D coordinates into one of the three Cartesian axis planes, using the standard orthonormal projection (i.e. simply selecting the appropriate ordinates into the XY ordinates). The projected data is represented as 2D coordinates. Martin Davis Creates a wrapper projecting to the XY plane. The sequence to be projected A sequence which projects coordinates Creates a wrapper projecting to the XZ plane. The sequence to be projected A sequence which projects coordinates Creates a wrapper projecting to the YZ plane. The sequence to be projected A sequence which projects coordinates Find two points on two 3D s which lie within a given distance, or else are the nearest points on the geometries (in which case this also provides the distance between the geometries). 3D geometries have vertex Z ordinates defined. 3D s are assumed to lie in a single plane (which is enforced if not actually the case). 3D s and s may have any configuration. The distance computation also finds a pair of points in the input geometries which have the minimum distance between them. If a point lies in the interior of a line segment, the coordinate computed is a close approximation to the exact point. The algorithms used are straightforward O(n^2) comparisons. This worst-case performance could be improved on by using Voronoi techniques or spatial indexes. 1.13 Compute the distance between the nearest points of two geometries. A geometry A geometry The distance between the geometries Test whether two geometries lie within a given distance of each other. A geometry A geometry The distance to test true if g0.distance(g1) <= Compute the the nearest points of two geometries. The points are presented in the same order as the input Geometries. A geometry A geometry The nearest points in the geometries Constructs a DistanceOp that computes the distance and nearest points between the two specified geometries. A geometry A geometry Constructs a DistanceOp that computes the distance and nearest points between the two specified geometries. A geometry A geometry The distance on which to terminate the search Report the distance between the nearest points on the input geometries. The distance between the geometries
or 0 if either input geometry is empty
Thrown if either input geometry is null.
Report the coordinates of the nearest points in the input geometries. The points are presented in the same order as the input Geometries. A pair of s of the nearest points Gets the locations of the nearest points in the input geometries. The locations are presented in the same order as the input Geometries. A pair of s for the nearest points Finds the index of the "most polygonal" input geometry. This optimizes the computation of the best-fit plane, since it is cached only for the left-hand geometry. The index of the most polygonal geometry Convenience method to create a Plane3DPolygon Computes distance between two polygons. To compute the distance, compute the distance between the rings of one polygon and the other polygon, and vice-versa. If the polygons intersect, then at least one ring must intersect the other polygon. Note that it is NOT sufficient to test only the shell rings. A counter-example is a "figure-8" polygon A and a simple polygon B at right angles to A, with the ring of B passing through the holes of A. The polygons intersect, but A's shell does not intersect B, and B's shell does not intersect A. Compute distance between a polygon and the rings of another. Computes a point at a distance along a segment specified by two relatively proportional values. The fractional distance along the segment is d0/(d0+d1). @param p0 start point of the segment @param p1 end point of the segment @param d0 proportional distance from start point to computed point @param d1 proportional distance from computed point to end point @return the computed point Models a polygon lying in a plane in 3-dimensional Cartesian space. The polygon representation is supplied by a , containing coordinates with XYZ ordinates. 3D polygons are assumed to lie in a single plane. The plane best fitting the polygon coordinates is computed and is represented by a . Martin Davis Computes an average normal vector from a list of polygon coordinates. Uses Newell's method, which is based on the fact that the vector with components equal to the areas of the projection of the polygon onto the Cartesian axis planes is normal. @param seq the sequence of coordinates for the polygon @return a normal vector Computes a point which is the average of all coordinates in a sequence. If the sequence lies in a single plane, the computed point also lies in the plane. @param seq a coordinate sequence @return a Coordinate with averaged ordinates A ConnectedElementPointFilter extracts a single point from each connected element in a Geometry (e.g. a polygon, linestring or point) and returns them in a list. The elements of the list are com.vividsolutions.jts.operation.distance.GeometryLocations. Returns a list containing a point from each Polygon, LineString, and Point found inside the specified point. Thus, if the specified point is not a GeometryCollection, an empty list will be returned. The elements of the list are com.vividsolutions.jts.operation.distance.GeometryLocations. Extracts a single point from each connected element in a Geometry (e.g. a polygon, linestring or point) and returns them in a list Returns a list containing a Coordinate from each Polygon, LineString, and Point found inside the specified point. Thus, if the specified point is not a GeometryCollection, an empty list will be returned. Computes the distance and closest points between two Geometrys. The distance computation finds a pair of points in the input geometries which have minimum distance between them. These points may not be vertices of the geometries, but may lie in the interior of a line segment. In this case the coordinate computed is a close approximation to the exact point. The algorithms used are straightforward O(n^2) comparisons. This worst-case performance could be improved on by using Voronoi techniques. Compute the distance between the closest points of two geometries. A Geometry. Another Geometry. The distance between the geometries. Test whether two geometries lie within a given distance of each other. Compute the the closest points of two geometries. The points are presented in the same order as the input Geometries. A Geometry. Another Geometry. The closest points in the geometries. Compute the the closest points of two geometries. The points are presented in the same order as the input Geometries. A Geometry. Another Geometry. The closest points in the geometries. Constructs a that computes the distance and closest points between the two specified geometries. Constructs a that computes the distance and closest points between the two specified geometries. The distance on which to terminate the search. Report the distance between the closest points on the input geometries. The distance between the geometries
or 0 if either input geometry is empty.
if either input geometry is null
Report the coordinates of the closest points in the input geometries. The points are presented in the same order as the input Geometries. A pair of Coordinates of the closest points. Report the locations of the closest points in the input geometries. The locations are presented in the same order as the input Geometries. A pair of s for the closest points. Report the coordinates of the nearest points in the input geometries. The points are presented in the same order as the input Geometries. A pair of Coordinates of the nearest points. Report the locations of the nearest points in the input geometries. The locations are presented in the same order as the input Geometries. A pair of s for the nearest points. Computes distance between facets (lines and points) of input geometries. Represents a sequence of facets (points or line segments) of a specified by a subsequence of a . Martin Davis Creates a new section based on a CoordinateSequence. The sequence holding the points in the section The index of the start point The index of the end point + 1 Creates a new sequence for a single point from a CoordinateSequence. The sequence holding the points in the facet sequence the index of the point Gets the coordinate at the given index The index The coordinate at the given index Computes the distance to another facet sequence The other facet sequence The distance between this and . Gets the envelope of this facet sequence Gets the number of coordinates in this facet sequence Tests if this facet sequence consists of only one point Utility class to build facet sequencs STRtrees- Creates facet sequences from a given geometry The geometry A list of s Represents the location of a point on a Geometry. Maintains both the actual point location (which may not be exact, if the point is not a vertex) as well as information about the component and segment index where the point occurs. Locations inside area Geometrys will not have an associated segment index, so in this case the segment index will have the sentinel value of . A special value of segmentIndex used for locations inside area geometries. These locations are not located on a segment, and thus do not have an associated segment index. Constructs a GeometryLocation specifying a point on a point, as well as the segment that the point is on (or if the point is not on a segment). The component of the geometry containing the point The segment index of the location, or The coordinate of the location Constructs a GeometryLocation specifying a point inside an area point. The component of the geometry containing the point The coordinate of the location Returns the geometry component on (or in) which this location occurs. Returns the segment index for this location. If the location is inside an area, the index will have the value . Returns the of this location. Tests whether this location represents a point inside an area geometry. Computes the distance between the facets (segments and vertices) of two s using a Branch-and-Bound algorithm. The Branch-and-Bound algorithm operates over a traversal of R-trees built on the target and possibly also the query geometries. This approach provides the following benefits: Performance is improved due to the effects of the R-tree index and the pruning due to the Branch-and-Bound approach The spatial index on the target geometry can be cached to allow reuse in an incremental query situation. Using this technique can be much more performant than using when one or both input geometries are large, or when evaluating many distance computations against a single geometry. This class is not thread-safe. Martin Davis Computes the distance between two geometries using the indexed approach. For geometries with many segments or points, this can be faster than using a simple distance algorithm. A geometry A geometry The distance between the two geometries Creates a new distance-finding instance for a given target . Distances will be computed to all facets of the input geometry. The facets of the geometry are the discrete segments and points contained in its components. In the case of and inputs, this is equivalent to computing the conventional distance. In the case of inputs, this is equivalent to computing the distance to the polygons boundaries. A Geometry, which may be of any type. Computes the distance from the base geometry to the given geometry. The geometry to compute the distance to. The computed distance * Tests whether the base geometry lies within * a specified distance of the given geometry. * //* @param g the geomtry to test //* @param maximumDistance the maximum distance to test //* @return true if the geometry lies with the specified distance The base class for operations that require s. The operation args into an array so they can be accessed by index. Tests whether a is simple. In general, the SFS specification of simplicity follows the rule: A Geometry is simple if and only if the only self-intersections are at boundary points. Simplicity is defined for each } subclass as follows: Valid geometries are simple by definition, so IsSimple trivially returns true.
(Note: this means that IsSimple cannot be used to test for (invalid) self-intersections in Polygons. In order to check if a Polygonal geometry has self-intersections, use ).
geometries are simple if and only if they do not self-intersect at interior points (i.e. points other than boundary points). This is equivalent to saying that no two linear components satisfy the SFS predicate. Zero-dimensional () geometries are simple if and only if they have no repeated points. Empty s are always simple by definition.
For geometries the evaluation of simplicity can be customized by supplying a to define how boundary points are determined. The default is the SFS-standard . Note that under the Mod-2 rule, closed LineStrings (rings) will never satisfy the touches predicate at their endpoints, since these are interior points, not boundary points. If it is required to test whether a set of LineStrings touch only at their endpoints, use IsSimpleOp with {@link BoundaryNodeRule#ENDPOINT_BOUNDARY_RULE}. For example, this can be used to validate that a set of lines form a topologically valid linear network.
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule The geometry to test Creates a simplicity checker using a given The geometry to test The rule to use Tests whether the geometry is simple. true if the geometry is simple Reports whether a is simple. The lineal geometry to test True if the geometry is simple Reports whether a is simple. The lineal geometry to test True if the geometry is simple A MultiPoint is simple if it has no repeated points. Computes simplicity for polygonal geometries. Polygonal geometries are simple if and only if all of their component rings are simple. A Polygonal geometry true if the geometry is simple Semantics for GeometryCollection is simple iff all components are simple. A GeometryCollection true if the geometry is simple For all edges, check if there are any intersections which are NOT at an endpoint. The Geometry is not simple if there are intersections not at endpoints. Tests that no edge intersection is the endpoint of a closed line. This ensures that closed lines are not touched at their endpoint, which is an interior point according to the Mod-2 rule To check this we compute the degree of each endpoint. The degree of endpoints of closed lines must be exactly 2. Add an endpoint to the map, creating an entry for it if none exists. Gets a coordinate for the location where the geometry fails to be simple. (i.e. where it has a non-boundary self-intersection). must be called before this location is accessed a coordinate for the location of the non-boundary self-intersection or null if the geometry is simple Creates an instance of this class The endpoint A sequence of LineMergeDirectedEdges forming one of the lines that will be output by the line-merging process. Constructs an EdgeString with the given factory used to convert this EdgeString to a LineString. Adds a directed edge which is known to form part of this line. Converts this EdgeString into a LineString. A com.vividsolutions.jts.planargraph.DirectedEdge of a LineMergeGraph. Represents a directed edge in a PlanarGraph. A DirectedEdge may or may not have a reference to a parent Edge (some applications of planar graphs may not require explicit Edge objects to be created). Usually a client using a PlanarGraph will subclass DirectedEdge to add its own application-specific data and methods. The base class for all graph component classes. Maintains flags of use in generic graph algorithms. Provides two flags: marked - typically this is used to indicate a state that persists for the course of the graph's lifetime. For instance, it can be used to indicate that a component has been logically deleted from the graph. visited - this is used to indicate that a component has been processed or visited by an single graph algorithm. For instance, a breadth-first traversal of the graph might use this to indicate that a node has already been traversed. The visited flag may be set and cleared many times during the lifetime of a graph. Sets the state for all s in an . A to scan. The state to set the flag to. Sets the state for all s in an . A to scan. The state to set the flag to. Finds the first in a set which has the specified state. A to scan. The state to test. The first found, or null if none found. Tests if a component has been visited during the course of a graph algorithm. Gets/Sets the visited flag for this component. Tests if a component has been marked at some point during the processing involving this graph. Gets/Sets the marked flag for this component. Tests whether this component has been removed from its containing graph. Gets or sets user defined data for this component Returns a List containing the parent Edge (possibly null) for each of the given DirectedEdges. Constructs a DirectedEdge connecting the from node to the to node. Specifies this DirectedEdge's direction (given by an imaginary line from the from node to directionPt). Whether this DirectedEdge's direction is the same as or opposite to that of the parent Edge (if any). Returns 1 if this DirectedEdge has a greater angle with the positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is susceptible to roundoff. A robust algorithm is: first compare the quadrants. If the quadrants are different, it it trivial to determine which vector is "greater". if the vectors lie in the same quadrant, the robust RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) function can be used to decide the relative orientation of the vectors. Returns 1 if this DirectedEdge has a greater angle with the positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is susceptible to roundoff. A robust algorithm is: first compare the quadrants. If the quadrants are different, it it trivial to determine which vector is "greater". if the vectors lie in the same quadrant, the robust RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) function can be used to decide the relative orientation of the vectors. Writes a detailed string representation of this DirectedEdge to the given PrintStream. Removes this directed edge from its containing graph. Returns this DirectedEdge's parent Edge, or null if it has none. Associates this DirectedEdge with an Edge (possibly null, indicating no associated Edge). Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's orientation lies. Returns a point to which an imaginary line is drawn from the from-node to specify this DirectedEdge's orientation. Returns whether the direction of the parent Edge (if any) is the same as that of this Directed Edge. Returns the node from which this DirectedEdge leaves. Returns the node to which this DirectedEdge goes. Returns the coordinate of the from-node. Returns the angle that the start of this DirectedEdge makes with the positive x-axis, in radians. Returns the symmetric DirectedEdge -- the other DirectedEdge associated with this DirectedEdge's parent Edge. Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite direction. Tests whether this component has been removed from its containing graph. Constructs a LineMergeDirectedEdge connecting the from node to the to node. specifies this DirectedEdge's direction (given by an imaginary line from the from node to directionPt). whether this DirectedEdge's direction is the same as or opposite to that of the parent Edge (if any). Returns the directed edge that starts at this directed edge's end point, or null if there are zero or multiple directed edges starting there. An edge of a LineMergeGraph. The marked field indicates whether this Edge has been logically deleted from the graph. Represents an undirected edge of a {PlanarGraph}. An undirected edge in fact simply acts as a central point of reference for two opposite DirectedEdges. Usually a client using a PlanarGraph will subclass Edge to add its own application-specific data and methods. The two DirectedEdges associated with this Edge. Constructs an Edge whose DirectedEdges are not yet set. Be sure to call SetDirectedEdges(DirectedEdge, DirectedEdge). Constructs an Edge initialized with the given DirectedEdges, and for each DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. Returns one of the DirectedEdges associated with this Edge. 0 or 1. Returns the DirectedEdge that starts from the given node, or null if the node is not one of the two nodes associated with this Edge. If node is one of the two nodes associated with this Edge, returns the other node; otherwise returns null. Removes this edge from its containing graph. Tests whether this component has been removed from its containing graph. Constructs a LineMergeEdge with vertices given by the specified LineString. Returns the LineString specifying the vertices of this edge. A planar graph of edges that is analyzed to sew the edges together. The marked flag on com.vividsolutions.planargraph.Edges and com.vividsolutions.planargraph.Nodes indicates whether they have been logically deleted from the graph. Represents a directed graph which is embeddable in a planar surface. This class and the other classes in this package serve as a framework for building planar graphs for specific algorithms. This class must be subclassed to expose appropriate methods to construct the graph. This allows controlling the types of graph components ({DirectedEdge}s, Edges and Nodes) which can be added to the graph. An application which uses the graph framework will almost always provide subclasses for one or more graph components, which hold application-specific data and graph algorithms. Returns the at the given location, or null if no was there. The location The node found
or null if this graph contains no node at the location
Adds a node to the map, replacing any that is already at that location. Only subclasses can add Nodes, to ensure Nodes are of the right type. The added node. Adds the Edge and its DirectedEdges with this PlanarGraph. Assumes that the Edge has already been created with its associated DirectEdges. Only subclasses can add Edges, to ensure the edges added are of the right class. Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, to ensure the edges added are of the right class. Returns an IEnumerator over the Nodes in this PlanarGraph. Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they were added. Returns an Iterator over the Edges in this PlanarGraph, in the order in which they were added. Removes an Edge and its associated DirectedEdges from their from-Nodes and from this PlanarGraph. Note: This method does not remove the Nodes associated with the Edge, even if the removal of the Edge reduces the degree of a Node to zero. Removes a from its from- and from this PlanarGraph. This method does not remove the s associated with the DirectedEdge, even if the removal of the DirectedEdge reduces the degree of a Node to zero. Removes a node from the graph, along with any associated DirectedEdges and Edges. Returns all Nodes with the given number of Edges around it. Returns the Nodes in this PlanarGraph. Returns the Edges that have been added to this PlanarGraph. Adds an Edge, DirectedEdges, and Nodes for the given LineString representation of an edge. Sews together a set of fully noded LineStrings. Sewing stops at nodes of degree 1 or 3 or more -- the exception is an isolated loop, which only has degree-2 nodes, in which case a node is simply chosen as a starting point. The direction of each merged LineString will be that of the majority of the LineStrings from which it was derived. Any dimension of Geometry is handled -- the constituent linework is extracted to form the edges. The edges must be correctly noded; that is, they must only meet at their endpoints. The LineMerger will still run on incorrectly noded input but will not form polygons from incorrected noded edges. NOTE:once merging has been performed, no more Adds a Geometry to be processed. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted. Adds a collection of Geometries to be processed. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted. Returns the LineStrings built by the merging process. Builds a sequence from a set of s, so that they are ordered end to end. A sequence is a complete non-repeating list of the linear components of the input. Each linestring is oriented so that identical endpoints are adjacent in the list. The input linestrings may form one or more connected sets. The input linestrings should be correctly noded, or the results may not be what is expected. The output of this method is a single , containing the ordered linestrings in the sequence. The sequencing employs the classic 'Eulerian path' graph algorithm. Since Eulerian paths are not uniquely determined, further rules are used to make the computed sequence preserve as much as possible of the input ordering. Within a connected subset of lines, the ordering rules are: - If there is degree-1 node which is the start node of an linestring, use that node as the start of the sequence. - If there is a degree-1 node which is the end node of an linestring, use that node as the end of the sequence. - If the sequence has no degree-1 nodes, use any node as the start Not all arrangements of lines can be sequenced. For a connected set of edges in a graph, Euler's Theorem states that there is a sequence containing each edge once if and only if there are no more than 2 nodes of odd degree. If it is not possible to find a sequence, the property will return false. Tests whether a is sequenced correctly. s are trivially sequenced. s are checked for correct sequencing. Otherwise, IsSequenced is defined to be true for geometries that are not lineal. The to test. true if the is sequenced or is not lineal. Adds a of s to be sequenced. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted. A of geometries to add. Adds a to be sequenced. May be called multiple times. Any dimension of may be added; the constituent linework will be extracted. Tests whether the arrangement of linestrings has a valid sequence. true if a valid sequence exists. Returns the or built by the sequencing process, if one exists. The sequenced linestrings, or null if a valid sequence does not exist. Tests whether a complete unique path exists in a graph using Euler's Theorem. The containing the edges. true if a sequence exists. Finds an for an unvisited edge (if any), choosing the which preserves orientation, if possible. The to examine. The found, or null if none were unvisited. Computes a version of the sequence which is optimally oriented relative to the underlying geometry. Heuristics used are: - If the path has a degree-1 node which is the start node of an linestring, use that node as the start of the sequence. - If the path has a degree-1 node which is the end node of an linestring, use that node as the end of the sequence. - If the sequence has no degree-1 nodes, use any node as the start (NOTE: in this case could orient the sequence according to the majority of the linestring orientations). A of s. A of s oriented appropriately. Reverse the sequence. This requires reversing the order of the s, and flipping each as well. A enumeration of s, in sequential order. The reversed sequence. Builds a geometry ( or ) representing the sequence. An enumeration of s of s with s as their parent edges. The sequenced geometry, or null if no sequence exists. A private implementation for Initializes a new instance of the class. The sequencer. Performs an operation with or on A to which the filter is applied. Nodes a set of edges. Takes one or more sets of edges and constructs a new set of edges consisting of all the split edges created by noding the input edges together. Forms NTS LineStrings out of a the graph of DirectedEdges created by an OverlayOp. A list of the LineStrings in the result of the specified overlay operation. Find and mark L edges which are "covered" by the result area (if any). L edges at nodes which also have A edges can be checked by checking their depth at that node. L edges at nodes which do not have A edges can be checked by doing a point-in-polygon test with the previously computed result areas. Collect edges from Area inputs which should be in the result but which have not been included in a result area. This happens ONLY: during an intersection when the boundaries of two areas touch in a line segment OR as a result of a dimensional collapse. Label an isolated node with its relationship to the target point. A ring of edges which may contain nodes of degree > 2. A MaximalEdgeRing may represent two different spatial entities: a single polygon possibly containing inversions (if the ring is oriented CW) a single hole possibly containing exversions (if the ring is oriented CCW) If the MaximalEdgeRing represents a polygon, the interior of the polygon is strongly connected. These are the form of rings used to define polygons under some spatial data models. However, under the OGC SFS model, MinimalEdgeRings are required. A MaximalEdgeRing can be converted to a list of MinimalEdgeRings using the BuildMinimalRings() method. For all nodes in this EdgeRing, link the DirectedEdges at the node to form minimalEdgeRings A ring of edges with the property that no node has degree greater than 2. These are the form of rings required to represent polygons under the OGC SFS spatial data model. Creates nodes for use in the PlanarGraphs constructed during overlay operations. The spatial functions supported by this class. These operations implement various bool combinations of the resultants of the overlay. The code for the Intersection overlay operation The code for the Union overlay operation The code for the Difference overlay operation The code for the Symmetric Difference overlay operation Computes the geometric overlay of two s. The overlay can be used to determine any bool combination of the geometries. Computes an overlay operation for the given geometry arguments. The first geometry argument The second geometry argument The code for the desired overlay operation The result of the overlay operation Thrown if a robustness problem is encountered. Tests whether a point with a given topological relative to two geometries is contained in the result of overlaying the geometries using a given overlay operation. The method handles arguments of correctly The topological label of the point The code for the overlay operation to test true if the label locations correspond to the overlayOpCode Tests whether a point with given s relative to two geometries is contained in the result of overlaying the geometries using a given overlay operation. The method handles arguments of correctly the code for the location in the first geometry the code for the location in the second geometry the code for the overlay operation to test true if the locations correspond to the overlayOpCode. Constructs an instance to compute a single overlay operation for the given geometries. The first geometry argument The second geometry argument Gets the result of the overlay for a given overlay operation. Note: this method can be called once only. The code of the overlay operation to perform The computed result geometry Thrown if a robustness problem is encountered Insert an edge from one of the noded input graphs. Checks edges that are inserted to see if an identical edge already exists. If so, the edge is not inserted, but its label is merged with the existing edge. The edge to insert Update the labels for edges according to their depths. For each edge, the depths are first normalized. Then, if the depths for the edge are equal, this edge must have collapsed into a line edge. If the depths are not equal, update the label with the locations corresponding to the depths (i.e. a depth of 0 corresponds to a Location of Exterior, a depth of 1 corresponds to Interior) If edges which have undergone dimensional collapse are found, replace them with a new edge which is a L edge Copy all nodes from an arg point into this graph. The node label in the arg point overrides any previously computed label for that argIndex. (E.g. a node may be an intersection node with a previously computed label of Boundary, but in the original arg Geometry it is actually in the interior due to the Boundary Determination Rule) Compute initial labelling for all DirectedEdges at each node. In this step, DirectedEdges will acquire a complete labelling (i.e. one with labels for both Geometries) only if they are incident on a node which has edges for both Geometries For nodes which have edges from only one Geometry incident on them, the previous step will have left their dirEdges with no labelling for the other Geometry. However, the sym dirEdge may have a labelling for the other Geometry, so merge the two labels. Incomplete nodes are nodes whose labels are incomplete. (e.g. the location for one Geometry is null). These are either isolated nodes, or nodes which have edges from only a single Geometry incident on them. Isolated nodes are found because nodes in one graph which don't intersect nodes in the other are not completely labelled by the initial process of adding nodes to the nodeList. To complete the labelling we need to check for nodes that lie in the interior of edges, and in the interior of areas. When each node labelling is completed, the labelling of the incident edges is updated, to complete their labelling as well. Label an isolated node with its relationship to the target point. Find all edges whose label indicates that they are in the result area(s), according to the operation being performed. Since we want polygon shells to be oriented CW, choose dirEdges with the interior of the result on the RHS. Mark them as being in the result. Interior Area edges are the result of dimensional collapses. They do not form part of the result area boundary. If both a dirEdge and its sym are marked as being in the result, cancel them out. Tests if a point node should be included in the result or not. The point coordinate true if the coordinate point is covered by a result Line or Area geometry. Tests if an L edge should be included in the result or not. The point coordinate true if the coordinate point is covered by a result Area geometry. true if the coord is located in the interior or boundary of a point in the list. Creates an empty result geometry of the appropriate dimension, based on the given overlay operation and the dimensions of the inputs. The created geometry is always an atomic geometry, not a collection. The empty result is constructed using the following rules: - result has the dimension of the lowest input dimension - result has the dimension of the highest input dimension - result has the dimension of the left-hand input - result has the dimension of the highest input dimension (since symDifference is the union of the differences). The overlay operation being performed An input geometry An input geometry The geometry factory being used for the operation An empty atomic geometry of the appropriate dimension Disable when an intersection is made (), so performances are dramatically improved but failures are not managed. Use ay your own risk! Gets the graph constructed to compute the overlay. Constructs Points from the nodes of an overlay graph. A list of the Points in the result of the specified overlay operation. This method simplifies the resultant Geometry by finding and eliminating "covered" points. A point is covered if it is contained in another element Geometry with higher dimension (e.g. a point might be contained in a polygon, in which case the point can be eliminated from the resultant). Forms Polygons out of a graph of {DirectedEdge}s. The edges to use are marked as being in the result Area. Add a complete graph. The graph is assumed to contain one or more polygons, possibly with holes. Add a set of edges and nodes, which form a graph. The graph is assumed to contain one or more polygons, possibly with holes. For all DirectedEdges in result, form them into MaximalEdgeRings. This method takes a list of MinimalEdgeRings derived from a MaximalEdgeRing, and tests whether they form a Polygon. This is the case if there is a single shell in the list. In this case the shell is returned. The other possibility is that they are a series of connected holes, in which case no shell is returned. The shell EdgeRing, if there is one
or null, if all the rings are holes.
This method assigns the holes for a Polygon (formed from a list of MinimalEdgeRings) to its shell. Determining the holes for a MinimalEdgeRing polygon serves two purposes: it is faster than using a point-in-polygon check later on. it ensures correctness, since if the PIP test was used the point chosen might lie on the shell, which might return an incorrect result from the PIP test. For all rings in the input list, determine whether the ring is a shell or a hole and add it to the appropriate list. Due to the way the DirectedEdges were linked, a ring is a shell if it is oriented CW, a hole otherwise. This method determines finds a containing shell for all holes which have not yet been assigned to a shell. These "free" holes should all be properly contained in their parent shells, so it is safe to use the findEdgeRingContaining method. (This is the case because any holes which are NOT properly contained (i.e. are connected to their parent shell) would have formed part of a MaximalEdgeRing and been handled in a previous step). Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. The innermost enclosing ring is the smallest enclosing ring. The algorithm used depends on the fact that: ring A contains ring B iff envelope(ring A) contains envelope(ring B). This routine is only safe to use if the chosen point of the hole is known to be properly contained in a shell (which is guaranteed to be the case if the hole does not touch its shell). Containing EdgeRing, if there is one
or null if no containing EdgeRing is found.
Checks the current set of shells (with their associated holes) to see if any of them contain the point. Snaps the vertices and segments of a to another Geometry's vertices. A snap distance tolerance is used to control where snapping is performed. Snapping one geometry to another can improve robustness for overlay operations by eliminating nearly-coincident edges (which cause problems during noding and intersection calculation). It can also be used to eliminate artifacts such as narrow slivers, spikes and gores. Too much snapping can result in invalid topology beging created, so the number and location of snapped vertices is decided using heuristics to determine when it is safe to snap. This can result in some potential snaps being omitted, however. Martin Davis Estimates the snap tolerance for a Geometry, taking into account its precision model. The estimated snap tolerance Snaps two geometries together with a given tolerance. Snaps a geometry to itself. Allows optionally cleaning the result to ensure it is topologically valid (which fixes issues such as topology collapses in polygonal inputs). Snapping a geometry to itself can remove artifacts such as very narrow slivers, gores and spikes. the geometry to snap the snapping tolerance whether the result should be made valid a new snapped Creates a new snapper acting on the given geometry the geometry to snap Snaps the vertices in the component s of the source geometry to the vertices of the given snap geometry. a geometry to snap the source to a new snapped Geometry Snaps the vertices in the component s of the source geometry to the vertices of the same geometry. Allows optionally cleaning the result to ensure it is topologically valid (which fixes issues such as topology collapses in polygonal inputs). The snapping tolerance Whether the result should be made valid The geometry snapped to itself Computes the snap tolerance based on the input geometries. Snaps the vertices and segments of a to a set of target snap vertices. A snap distance tolerance is used to control where snapping is performed. The implementation handles empty geometry and empty snap vertex sets. Creates a new snapper using the points in the given as target snap points. A LineString to snap (may be empty) the snap tolerance to use Creates a new snapper using the given points as source points to be snapped. Snaps the vertices and segments of the source LineString to the given set of snap points. the vertices to snap to list of the snapped points Snap source vertices to vertices in the target. the points to snap the points to snap to Snap segments of the source to nearby snap vertices. Source segments are "cracked" at a snap vertex. A single input segment may be snapped several times to different snap vertices. For each distinct snap vertex, at most one source segment is snapped to. This prevents "cracking" multiple segments at the same point, which would likely cause topology collapse when being used on polygonal linework. The coordinates of the source linestring to snap The target snap vertices Finds a src segment which snaps to (is close to) the given snap point Only a single segment is selected for snapping. This prevents multiple segments snapping to the same snap vertex, which would almost certainly cause invalid geometry to be created. (The heuristic approach of snapping used here is really only appropriate when snap pts snap to a unique spot on the src geometry) Also, if the snap vertex occurs as a vertex in the src coordinate list, no snapping is performed. The point to snap to The source segment coordinates The index of the snapped segment
or -1 if no segment snaps to the snap point.
Performs an overlay operation using snapping and enhanced precision to improve the robustness of the result. This class only uses snapping if an error is detected when running the standard JTS overlay code. Errors detected include thrown exceptions (in particular, ) and invalid overlay computations. Performs an overlay operation using snapping and enhanced precision to improve the robustness of the result. This class always uses snapping. This is less performant than the standard JTS overlay code, and may even introduce errors which were not present in the original data. For this reason, this class should only be used if the standard overlay code fails to produce a correct result. Finds the most likely of a point relative to the polygonal components of a geometry, using a tolerance value. If a point is not clearly in the Interior or Exterior, it is considered to be on the Boundary. In other words, if the point is within the tolerance of the Boundary, it is considered to be on the Boundary; otherwise, whether it is Interior or Exterior is determined directly. Martin Davis Extracts linework for polygonal components. The geometry from which to extract A lineal geometry containing the extracted linework Extracts the LineStrings in the boundaries of all the polygonal elements in the target . Martin Davis Filters out all linework for polygonal elements Gets the list of polygonal linework. Generates points offset by a given distance from both sides of the midpoint of all segments in a . Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. The input geometry may have any orientation for its rings, but is only meaningful if the orientation is known. Martin Davis Set the sides on which to generate offset points. @param doLeft @param doRight Gets the computed offset points. Generates the two points which are offset from the midpoint of the segment (p0, p1) by the offsetDistance The first point of the segment to offset from. The second point of the segment to offset from Validates that the result of an overlay operation is geometrically correct within a determined tolerance. Uses fuzzy point location to find points which are definitely in either the interior or exterior of the result geometry, and compares these results with the expected ones. This algorithm is only useful where the inputs are polygonal. This is a heuristic test, and may return false positive results (I.e. it may fail to detect an invalid result.) It should never return a false negative result, however (I.e. it should never report a valid result as invalid.) Martin Davis Represents a ring of PolygonizeDirectedEdges which form a ring of a polygon. The ring may be either an outer shell or a hole. Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. The innermost enclosing ring is the smallest enclosing ring. The algorithm used depends on the fact that: ring A contains ring B iff envelope(ring A) contains envelope(ring B). This routine is only safe to use if the chosen point of the hole is known to be properly contained in a shell (which is guaranteed to be the case if the hole does not touch its shell). Containing EdgeRing, if there is one
or null if no containing EdgeRing is found.
Finds a point in a list of points which is not contained in another list of points. The Coordinates to test. An array of Coordinates to test the input points against. A Coordinate from testPts which is not in pts,
or null.
Tests whether a given point is in an array of points. Uses a value-based test. A Coordinate for the test point. An array of Coordinates to test, true if the point is in the array. Traverses a ring of DirectedEdges, accumulating them into a list. This assumes that all dangling directed edges have been removed from the graph, so that there is always a next dirEdge. @param startDE the DirectedEdge to start traversing at @return a List of DirectedEdges that form a ring Adds a DirectedEdge which is known to form part of this ring. The DirectedEdge to add. Computes whether this ring is a hole. Due to the way the edges in the polyongization graph are linked, a ring is a hole if it is oriented counter-clockwise. Adds a hole to the polygon formed by this ring. The LinearRing forming the hole. Adds a hole to the polygon formed by this ring. the forming the hole. Updates the included status for currently non-included shells based on whether they are adjacent to an included shell. Gets a string representation of this object. Tests whether this ring is a hole. Due to the way the edges in the polyongization graph are linked, a ring is a hole if it is oriented counter-clockwise. true if this ring is a hole. Computes and returns the Polygon formed by this ring and any contained holes. Tests if the ring formed by this edge ring is topologically valid. true if the ring is valid. Computes and returns the list of coordinates which are contained in this ring. The coordinatea are computed once only and cached. Gets the coordinates for this ring as a LineString. Used to return the coordinates in this ring as a valid point, when it has been detected that the ring is topologically invalid. Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem). Details of problems are written to standard output. Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole. Gets a value indicating whether this ring has a shell assigned to it. Tests whether this ring is an outer hole. A hole is an outer hole if it is not contained by a shell. Tests whether this ring is an outer shell. Gets or sets a value indicating whether this ring has been processed. Compares EdgeRings based on their envelope, using the standard lexicographic ordering. This ordering is sufficient to make edge ring sorting deterministic. mbdavis A DirectedEdge of a PolygonizeGraph, which represents an edge of a polygon formed by the graph. May be logically deleted from the graph by setting the marked flag. Constructs a directed edge connecting the from node to the to node. Specifies this DirectedEdge's direction (given by an imaginary line from the from node to directionPt). Whether this DirectedEdge's direction is the same as or opposite to that of the parent Edge (if any). Returns the identifier attached to this directed edge. Attaches an identifier to this directed edge. Returns the next directed edge in the EdgeRing that this directed edge is a member of. Sets the next directed edge in the EdgeRing that this directed edge is a member of. Returns the ring of directed edges that this directed edge is a member of, or null if the ring has not been set. Gets/Sets the ring of directed edges that this directed edge is a member of. An edge of a polygonization graph. Represents a planar graph of edges that can be used to compute a polygonization, and implements the algorithms to compute the EdgeRings formed by the graph. The marked flag on DirectedEdges is used to indicate that a directed edge has be logically deleted from the graph. Deletes all edges at a node. Create a new polygonization graph. Add a LineString forming an edge of the polygon graph. The line to add. Convert the maximal edge rings found by the initial graph traversal into the minimal edge rings required by NTS polygon topology rules. The list of start edges for the edgeRings to convert. Finds all nodes in a maximal edgering which are self-intersection nodes The list of intersection nodes found, or null if no intersection nodes were found. Computes the minimal EdgeRings formed by the edges in this graph. A list of the{EdgeRings found by the polygonization process. Finds and labels all edgerings in the graph. The edge rings are labeling with unique integers. The labeling allows detecting cut edges. A List of the DirectedEdges in the graph. A List of DirectedEdges, one for each edge ring found. Finds and removes all cut edges from the graph. A list of the LineStrings forming the removed cut edges. Computes the next edge pointers going CCW around the given node, for the given edgering label. This algorithm has the effect of converting maximal edgerings into minimal edgerings Marks all edges from the graph which are "dangles". Dangles are which are incident on a node with degree 1. This process is recursive, since removing a dangling edge may result in another edge becoming a dangle. In order to handle large recursion depths efficiently, an explicit recursion stack is used. A List containing the s that formed dangles. Traverses the polygonized edge rings in the graph and computes the depth parity (odd or even) relative to the exterior of the graph. If the client has requested that the output be polygonally valid, only odd polygons will be constructed. Traverses all connected edges, computing the depth parity of the associated polygons. Polygonizes a set of s which contain linework that represents the edges of a planar graph. All types of Geometry are accepted as input; the constituent linework is extracted as the edges to be polygonized. The processed edges must be correctly noded; that is, they must only meet at their endpoints. Polygonization will accept incorrectly noded input but will not form polygons from non-noded edges, and reports them as errors. The Polygonizer reports the follow kinds of errors: Dangles - edges which have one or both ends which are not incident on another edge endpoint Cut Edges - edges which are connected at both ends but which do not form part of polygon Invalid Ring Lines - edges which form rings which are invalid (e.g. the component lines contain a self-intersection). Polygonization supports extracting only polygons which form a valid polygonal geometry. The set of extracted polygons is guaranteed to be edge-disjoint. This is useful for situations where it is known that the input lines form a valid polygonal geometry. The default polygonizer output behavior Default linestring adder. Creates a polygonizer with the same as the input Geometrys. The output mask is Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted. true if only polygons which form a valid polygonal geometry are to be extracted Adds a collection of s to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used. A list of Geometrys with linework to be polygonized. Adds a to the linework to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used A Geometry with linework to be polygonized. Adds a to the graph of polygon edges. The to add. Gets the list of polygons formed by the polygonization. Gets a geometry representing the polygons formed by the polygonization. If a valid polygonal geometry was extracted the result is a geometry. A geometry containing the polygons Gets the list of dangling lines found during polygonization. Gets the list of cut edges found during polygonization. Gets the list of lines forming invalid rings found during polygonization. Performs the polygonization, if it has not already been carried out. For each outer hole finds and includes a single outer shell. This seeds the travesal algorithm for finding only polygonal shells. The list of shell EdgeRings Allows disabling the valid ring checking, to optimize situations where invalid rings are not expected. The default is true Adds every linear element in a into the polygonizer graph. Filters all geometry instances The geometry instance Optimized implementation of spatial predicate "contains" for cases where the first Geometry is a rectangle. As a further optimization, this class can be used directly to test many geometries against a single rectangle. Create a new contains computer for two geometries. A rectangular geometry. Tests if a point is contained in the boundary of the target rectangle. the point to test true if the point is contained in the boundary Tests if a linestring is completely contained in the boundary of the target rectangle. the linestring to test true if the linestring is contained in the boundary Tests if a line segment is contained in the boundary of the target rectangle. an endpoint of the segment an endpoint of the segment true if the line segment is contained in the boundary I Implementation of the Intersects spatial predicate optimized for the case where one is a rectangle. This class works for all input geometries, including s. As a further optimization, this class can be used in batch style to test many geometries against a single rectangle. Crossover size at which brute-force intersection scanning is slower than indexed intersection detection. Must be determined empirically. Should err on the safe side by making value smaller rather than larger. Tests whether a rectangle intersects a given geometry. A rectangular polygon A geometry of any kind true if the geometries intersect. Create a new intersects computer for a rectangle. A rectangular polygon. Tests whether the given Geometry intersects the query rectangle. The Geometry to test (may be of any type) true if an intersection must occur or false if no conclusion about intersection can be made Tests whether it can be concluded that a rectangle intersects a geometry, based on the relationship of the envelope(s) of the geometry. Martin Davis Creates an instance of this class using the provided Envelope The query envelope Reports whether it can be concluded that an intersection occurs, or whether further testing is required. true if an intersection must occur
or false if no conclusion about intersection can be made
A visitor which tests whether it can be concluded that a geometry contains a vertex of a query geometry. Martin Davis Gets a value indicating whether it can be concluded that a corner point of the rectangle is contained in the geometry, or whether further testing is required. true if a corner point is contained or false if no conclusion about intersection can be made A visitor to test for intersection between the query rectangle and the line segments of the geometry. Martin Davis Creates a visitor for checking rectangle intersection with segments the query rectangle Reports whether any segment intersection exists. true if a segment intersection exists or false if no segment intersection exists Tests if any line segments in two sets of intersect. Optimized for use when at least one input is of small size. Short-circuited to return as soon an intersection is found. An EdgeEndBuilder creates EdgeEnds for all the "split edges" created by the intersections determined for an Edge. Computes the EdgeEnds which arise from a noded Edge. Creates stub edges for all the intersections in this Edge (if any) and inserts them into the graph. Create a EdgeStub for the edge before the intersection eiCurr. The previous intersection is provided in case it is the endpoint for the stub edge. Otherwise, the previous point from the parent edge will be the endpoint. eiCurr will always be an EdgeIntersection, but eiPrev may be null. Create a StubEdge for the edge after the intersection eiCurr. The next intersection is provided in case it is the endpoint for the stub edge. Otherwise, the next point from the parent edge will be the endpoint. eiCurr will always be an EdgeIntersection, but eiNext may be null. A collection of EdgeStubs which obey the following invariant: They originate at the same node and have the same direction. Contains all EdgeEnds which start at the same point and are parallel. This computes the overall edge label for the set of edges in this EdgeStubBundle. It essentially merges the ON and side labels for each edge. These labels must be compatible Compute the overall ON location for the list of EdgeStubs. (This is essentially equivalent to computing the self-overlay of a single Geometry) edgeStubs can be either on the boundary (eg Polygon edge) OR in the interior (e.g. segment of a LineString) of their parent Geometry. In addition, GeometryCollections use the to determine whether a segment is on the boundary or not. Finally, in GeometryCollections it can occur that an edge is both on the boundary and in the interior (e.g. a LineString segment lying on top of a Polygon edge.) In this case the Boundary is given precendence. These observations result in the following rules for computing the ON location: if there are an odd number of Bdy edges, the attribute is Bdy if there are an even number >= 2 of Bdy edges, the attribute is Int if there are any Int edges, the attribute is Int otherwise, the attribute is Null. Compute the labelling for each side To compute the summary label for a side, the algorithm is: FOR all edges IF any edge's location is Interior for the side, side location = Interior ELSE IF there is at least one Exterior attribute, side location = Exterior ELSE side location = Null Note that it is possible for two sides to have apparently contradictory information i.e. one edge side may indicate that it is in the interior of a point, while another edge side may indicate the exterior of the same point. This is not an incompatibility - GeometryCollections may contain two Polygons that touch along an edge. This is the reason for Interior-primacy rule above - it results in the summary label having the Geometry interior on both sides. Update the IM with the contribution for the computed label for the EdgeStubs. An ordered list of EdgeEndBundles around a RelateNode. They are maintained in CCW order (starting with the positive x-axis) around the node for efficient lookup and topology building. Insert a EdgeEnd in order in the list. If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is added to the bundle. Otherwise, a new EdgeEndBundle is created to contain the EdgeEnd. Update the IM with the contribution for the EdgeStubs around the node. Computes the topological relationship between two Geometries. RelateComputer does not need to build a complete graph structure to compute the IntersectionMatrix. The relationship between the geometries can be computed by simply examining the labelling of edges incident on each node. RelateComputer does not currently support arbitrary GeometryCollections. This is because GeometryCollections can contain overlapping Polygons. In order to correct compute relate on overlapping Polygons, they would first need to be noded and merged (if not explicitly, at least implicitly). Copy all nodes from an arg point into this graph. The node label in the arg point overrides any previously computed label for that argIndex. (E.g. a node may be an intersection node with a computed label of Boundary, but in the original arg Geometry it is actually in the interior due to the Boundary Determination Rule) Insert nodes for all intersections on the edges of a Geometry. Label the created nodes the same as the edge label if they do not already have a label. This allows nodes created by either self-intersections or mutual intersections to be labelled. Endpoint nodes will already be labelled from when they were inserted. For all intersections on the edges of a Geometry, label the corresponding node IF it doesn't already have a label. This allows nodes created by either self-intersections or mutual intersections to be labelled. Endpoint nodes will already be labelled from when they were inserted. If the Geometries are disjoint, we need to enter their dimension and boundary dimension in the Ext rows in the IM Update the IM with the sum of the IMs for each component. Processes isolated edges by computing their labelling and adding them to the isolated edges list. Isolated edges are guaranteed not to touch the boundary of the target (since if they did, they would have caused an intersection to be computed and hence would not be isolated). Label an isolated edge of a graph with its relationship to the target point. If the target has dim 2 or 1, the edge can either be in the interior or the exterior. If the target has dim 0, the edge must be in the exterior. Isolated nodes are nodes whose labels are incomplete (e.g. the location for one Geometry is null). This is the case because nodes in one graph which don't intersect nodes in the other are not completely labelled by the initial process of adding nodes to the nodeList. To complete the labelling we need to check for nodes that lie in the interior of edges, and in the interior of areas. Label an isolated node with its relationship to the target point. A RelateNode is a Node that maintains a list of EdgeStubs for the edges that are incident on it. Update the IM with the contribution for this component. A component only contributes if it has a labelling for both parent geometries. Update the IM with the contribution for the EdgeEnds incident on this node. Used by the NodeMap in a RelateNodeGraph to create RelateNodes. Implements the simple graph of Nodes and EdgeEnd which is all that is required to determine topological relationships between Geometries. Also supports building a topological graph of a single Geometry, to allow verification of valid topology. It is not necessary to create a fully linked PlanarGraph to determine relationships, since it is sufficient to know how the Geometries interact locally around the nodes. In fact, this is not even feasible, since it is not possible to compute exact intersection points, and hence the topology around those nodes cannot be computed robustly. The only Nodes that are created are for improper intersections; that is, nodes which occur at existing vertices of the Geometries. Proper intersections (e.g. ones which occur between the interior of line segments) have their topology determined implicitly, without creating a Node object to represent them. Insert nodes for all intersections on the edges of a Geometry. Label the created nodes the same as the edge label if they do not already have a label. This allows nodes created by either self-intersections or mutual intersections to be labelled. Endpoint nodes will already be labelled from when they were inserted. Precondition: edge intersections have been computed. Copy all nodes from an arg point into this graph. The node label in the arg point overrides any previously computed label for that argIndex. (E.g. a node may be an intersection node with a computed label of Boundary, but in the original arg Geometry it is actually in the interior due to the Boundary Determination Rule). Implements the SFS relate() generalized spatial predicate on two s.
The class supports specifying a custom to be used during the relate computation.
If named spatial predicates are used on the result of the RelateOp, the result may or not be affected by the choice of BoundaryNodeRule, depending on the exact nature of the pattern. For instance, is insensitive to the choice of BoundaryNodeRule, whereas is affected by the rule chosen. Note: custom Boundary Node Rules do not (currently) affect the results of other methods (such as . The results of these methods may not be consistent with the relationship computed by a custom Boundary Node Rule.
Computes the for the spatial relationship between two s, using the default (OGC SFS) Boundary Node Rule A geometry to test A geometry to test The IntersectonMatrix for the spatial relationship between the geometries Computes the for the spatial relationship between two s, using the specified Boundary Node Rule A geometry to test A geometry to test The Boundary Node Rule to use The IntersectonMatrix for the spatial relationship between the geometries Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. a Geometry to relate another Geometry to relate Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. a Geometry to relate another Geometry to relate The Boundary Node Rule to use Gets the IntersectionMatrix for the spatial relationship between the input geometries. Provides an efficient method of unioning a collection of geometrys. The geometries are indexed using a spatial index, and unioned recursively in index order. For geometries with a high degree of overlap, this has the effect of reducing the number of vertices early in the process, which increases speed and robustness. This algorithm is faster and more robust than the simple iterated approach of repeatedly unioning each polygon to a result geometry. The buffer(0) trick is sometimes faster, but can be less robust and can sometimes take a long time to complete. This is particularly the case where there is a high degree of overlap between the polygons. In this case, buffer(0) is forced to compute with all line segments from the outset, whereas cascading can eliminate many segments at each stage of processing. The best situation for using buffer(0) is the trivial case where there is no overlap between the input geometries. However, this case is likely rare in practice. Martin Davis The effectiveness of the index is somewhat sensitive to the node capacity. Testing indicates that a smaller capacity is better. For an STRtree, 4 is probably a good number (since this produces 2x2 "squares"). Computes the union of a collection of s. A collection of s. Creates a new instance to union the given collection of s. A collection of s Computes the union of the input geometries. This method discards the input geometries as they are processed. In many input cases this reduces the memory retained as the operation proceeds. Optimal memory usage is achieved by disposing of the original input collection before calling this method. The union of the input geometries, or null if no input geometries were provided if this method is called more than once Unions a list of geometries by treating the list as a flattened binary tree, and performing a cascaded union on the tree. The list of geometries to union The union of the list Unions a section of a list using a recursive binary union on each half of the section. The list of geometries containing the section to union The start index of the section The index after the end of the section The union of the list section Gets the element at a given list index, or null if the index is out of range. The list of geometries The index The geometry at the given index or null if the index is out of range Reduces a tree of geometries to a list of geometries by recursively unioning the subtrees in the list. A tree-structured list of geometries A list of Geometrys Computes the union of two geometries, either or both of which may be null. A Geometry A Geometry The union of the input(s) or null if both inputs are null Unions two polygonal geometries, restricting computation to the envelope intersection where possible. The case of MultiPolygons is optimized to union only the polygons which lie in the intersection of the two geometry's envelopes. Polygons outside this region can simply be combined with the union result, which is potentially much faster. This case is likely to occur often during cascaded union, and may also occur in real world data (such as unioning data for parcels on different street blocks). A polygonal geometry A polygonal geometry The intersection of the envelopes of the inputs The union of the inputs Encapsulates the actual unioning of two polygonal geometries. Computes a containing only components. Extracts the s from the input and returns them as an appropriate geometry. If the input is already Polygonal, it is returned unchanged. A particular use case is to filter out non-polygonal components returned from an overlay operation. The geometry to filter A polygonal geometry Computes the union of a geometry with another arbitrary . Does not copy any component geometries. Unions a Collection of s or a single Geometry (which may be a ) together. By using this special-purpose operation over a collection of geometries it is possible to take advantage of various optimizations to improve performance. Heterogeneous s are fully supported. The result obeys the following contract: Unioning a set of s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together). Unioning a set of s has the effect of fully noding and dissolving the input linework. In this context "fully noded" means that there will be an endpoint or node in the result for every endpoint or line segment crossing in the input. "Dissolved" means that any duplicate (e.g. coincident) line segments or portions of line segments will be reduced to a single line segment in the output. This is consistent with the semantics of the operation. If merged linework is required, the class can be used. Unioning a set of s has the effect of merging all identical points (producing a set with no duplicates). UnaryUnion always operates on the individual components of MultiGeometries. So it is possible to use it to "clean" invalid self-intersecting MultiPolygons (although the polygon components must all still be individually valid.) mbdavis Computes the geometric union of a A collection of geometries The union of the geometries, or null if the input is empty Computes the geometric union of a If no input geometries were provided but a was provided, an empty is returned. A collection of geometries The geometry factory to use if the collection is empty The union of the geometries or an empty GEOMETRYCOLLECTION Constructs a unary union operation for a (which may be a ). A geometry to union The union of the elements of the geometry or an empty GEOMETRYCOLLECTION Constructs a unary union operation for an enumeration of s, using the of the input geometries. An enumeration of geometries Constructs a unary union operation for an enumeration of s. If no input geometries were provided but a was provided, An enumeration of geometries The geometry factory to use if the enumeration is empty Constructs a unary union operation for a (which may be a ). A geometry to union Gets the union of the input geometries. If no input geometries were provided but a was provided, an empty is returned. Otherwise, the return value is null A Geometry containing the union or an empty if no geometries were provided in the input, or null if not GeometryFactory was provided Computes the union of two geometries, either of both of which may be null. The union of the input(s) or null if both inputs are null Computes a unary union with no extra optimization, and no short-circuiting. Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. A geometry The union of the input geometry Experimental code to union MultiPolygons with processing limited to the elements which actually interact. Not currently used, since it doesn't seem to offer much of a performance advantage. mbdavis This class tests that the interior of an area ( or ) is connected. An area Geometry is invalid if the interior is disconnected. This can happen if: - a shell self-intersects, - one or more holes form a connected chain touching a shell at two different points, - one or more holes form a ring around a subset of the interior. If a disconnected situation is found the location of the problem is recorded. Form s in graph into Minimal EdgeRings. (Minimal Edgerings must be used, because only they are guaranteed to provide a correct isHole computation). Mark all the edges for the edgeRings corresponding to the shells of the input polygons. Only ONE ring gets marked for each shell - if there are others which remain unmarked this indicates a disconnected interior. Check if any shell ring has an unvisited edge. A shell ring is a ring which is not a hole and which has the interior of the parent area on the RHS. (Note that there may be non-hole rings with the interior on the LHS, since the interior of holes will also be polygonized into CW rings by the LinkAllDirectedEdges() step). true if there is an unvisited edge in a non-hole ring. Checks that a {GeometryGraph} representing an area (a Polygon or MultiPolygon ) is consistent with the SFS semantics for area geometries. Checks include: Testing for rings which self-intersect (both properly and at nodes). Testing for duplicate rings. If an inconsistency if found the location of the problem is recorded. Returns the intersection point, or null if none was found. Check all nodes to see if their labels are consistent. If any are not, return false. Checks for two duplicate rings in an area. Duplicate rings are rings that are topologically equal (that is, which have the same sequence of points up to point order). If the area is topologically consistent (determined by calling the isNodeConsistentArea, duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. (This is because topologically consistent areas cannot have two rings sharing the same line segment, unless the rings are equal). The start point of one of the equal rings will be placed in invalidPoint. Returns true if this area Geometry is topologically consistent but has two duplicate rings. Tests whether any of a set of {@link LinearRing}s are nested inside another ring in the set, using a spatial index to speed up the comparisons. @version 1.7 Implements the algorithsm required to compute the method for s. See the documentation for the various geometry types for a specification of validity. Checks whether a coordinate is valid for processing. Coordinates are valid iff their x and y ordinates are in the range of the floating point representation. The coordinate to validate. true if the coordinate is valid. Find a point from the list of testCoords that is NOT a node in the edge for the list of searchCoords. The point found, or null if none found. If the following condition is TRUE JTS will validate inverted shells and exverted holes (the ESRI SDE model). Checks validity of a Point. Checks validity of a MultiPoint. Checks validity of a LineString. Almost anything goes for lineStrings! Checks validity of a LinearRing. Checks the validity of a polygon and sets the validErr flag. Check that there is no ring which self-intersects (except of course at its endpoints). This is required by OGC topology rules (but not by other models such as ESRI SDE, which allow inverted shells and exverted holes). Check that a ring does not self-intersect, except at its endpoints. Algorithm is to count the number of times each node along edge occurs. If any occur more than once, that must be a self-intersection. Tests that each hole is inside the polygon shell. This routine assumes that the holes have previously been tested to ensure that all vertices lie on the shell or inside it. A simple test of a single point in the hole can be used, provide the point is chosen such that it does not lie on the boundary of the shell. The polygon to be tested for hole inclusion. A GeometryGraph incorporating the polygon. Tests that no hole is nested inside another hole. This routine assumes that the holes are disjoint. To ensure this, holes have previously been tested to ensure that: They do not partially overlap (checked by checkRelateConsistency). They are not identical (checked by checkRelateConsistency). Tests that no element polygon is wholly in the interior of another element polygon. Preconditions: Shells do not partially overlap. Shells do not touch along an edge. No duplicate rings exists. This routine relies on the fact that while polygon shells may touch at one or more vertices, they cannot touch at ALL vertices. Check if a shell is incorrectly nested within a polygon. This is the case if the shell is inside the polygon shell, but not inside a polygon hole. (If the shell is inside a polygon hole, the nesting is valid.) The algorithm used relies on the fact that the rings must be properly contained. E.g. they cannot partially overlap (this has been previously checked by CheckRelateConsistency). This routine checks to see if a shell is properly contained in a hole. It assumes that the edges of the shell and hole do not properly intersect. null if the shell is properly contained, or a Coordinate which is not inside the hole if it is not. Gets/Sets whether polygons using Self-Touching Rings to form holes are reported as valid. If this flag is set, the following Self-Touching conditions are treated as being valid: - The shell ring self-touches to create a hole touching the shell. - A hole ring self-touches to create two holes touching at a point. The default (following the OGC SFS standard) is that this condition is not valid (false). This does not affect whether Self-Touching Rings disconnecting the polygon interior are considered valid (these are considered to be invalid under the SFS, and many other spatial models as well). This includes "bow-tie" shells, which self-touch at a single point causing the interior to be disconnected, and "C-shaped" holes which self-touch at a single point causing an island to be formed. States whether geometry with this condition is valid. Computes the validity of the geometry, and returns true if it is valid. Computes the validity of the geometry, and if not valid returns the validation error for the geometry, or null if the geometry is valid. The validation error, if the geometry is invalid
or null if the geometry is valid
Tests whether any of a set of LinearRings are nested inside another ring in the set, using a Quadtree index to speed up the comparisons. Implements the appropriate checks for repeated points (consecutive identical coordinates) as defined in the NTS spec. Tests whether any of a set of LinearRings are nested inside another ring in the set, using a simple O(n^2) comparison. Tests whether any of a set of LinearRings are nested inside another ring in the set, using a SweepLineIndex index to speed up the comparisons. Contains information about the nature and location of a validation error. Not used. No longer used: repeated points are considered valid as per the SFS. Indicates that a hole of a polygon lies partially or completely in the exterior of the shell. Indicates that a hole lies in the interior of another hole in the same polygon. Indicates that the interior of a polygon is disjoint (often caused by set of contiguous holes splitting the polygon into two parts). Indicates that two rings of a polygonal geometry intersect. Indicates that a ring self-intersects. Indicates that a polygon component of a lies inside another polygonal component. Indicates that a polygonal geometry contains two rings which are identical. Indicates that either: - A contains a single point. - A contains 2 or 3 points. Indicates that the X or Y ordinate of a is not a valid numeric value (e.g. ). Indicates that a ring is not correctly closed (the first and the last coordinate are different). Contains information about the nature and location of a Geometry validation error. These messages must synch up with the indexes above Finds all connected s of a . Initializes a new instance of the class. The . Adds all nodes and edges reachable from this node to the subgraph. Uses an explicit stack to avoid a large depth of recursion. Adds the argument node and all its out edges to the subgraph. A sorted collection of DirectedEdges which leave a Node in a PlanarGraph. The underlying list of outgoing DirectedEdges. Adds a new member to this DirectedEdgeStar. Drops a member of this DirectedEdgeStar. Returns an Iterator over the DirectedEdges, in ascending order by angle with the positive x-axis. Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis. Returns the zero-based index of the given DirectedEdge, after sorting in ascending order by angle with the positive x-axis. Returns the remainder when i is divided by the number of edges in this DirectedEdgeStar. Returns the on the left-hand side of the given (which must be a member of this DirectedEdgeStar). Returns the on the right-hand (CW) side of the given (which must be a member of this DirectedEdgeStar). Returns the number of edges around the Node associated with this DirectedEdgeStar. Returns the coordinate for the node at wich this star is based. Returns the DirectedEdges, in ascending order by angle with the positive x-axis. A node in a PlanarGraph is a location where 0 or more Edges meet. A node is connected to each of its incident Edges via an outgoing DirectedEdge. Some clients using a PlanarGraph may want to subclass Node to add their own application-specific data and methods. Returns all Edges that connect the two nodes (which are assumed to be different). The location of this Node. The collection of DirectedEdges that leave this Node. Constructs a Node with the given location. Constructs a Node with the given location and collection of outgoing DirectedEdges. Adds an outgoing DirectedEdge to this Node. Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis. Removes a incident on this node. Does not change the state of the directed edge. Removes this node from its containing graph. Returns the location of this Node. Returns the collection of DirectedEdges that leave this Node. Returns the number of edges around this Node. Tests whether this component has been removed from its containing graph. A map of nodes, indexed by the coordinate of the node. Adds a node to the map, replacing any that is already at that location. The added node. Removes the Node at the given location, and returns it (or null if no Node was there). Returns the Node at the given location, or null if no Node was there. Returns an Iterator over the Nodes in this NodeMap, sorted in ascending order by angle with the positive x-axis. Returns the Nodes in this NodeMap, sorted in ascending order by angle with the positive x-axis. Returns the number of Nodes in this NodeMap. A subgraph of a . A subgraph may contain any subset of s from the parent graph. It will also automatically contain all s and s associated with those edges. No new objects are created when edges are added - all associated components must already exist in the parent graph. Creates a new subgraph of the given . Gets the which this subgraph is part of. Adds an to the subgraph. The associated s and s are also added. The to add. Returns an over the s in this graph, in the order in which they were added. Returns an over the s in this graph, in the order in which they were added. Returns an over the s in this graph. Tests whether an is contained in this subgraph. The to test. true if the is contained in this subgraph. Determines the maximum number of common most-significant bits in the mantissa of one or numbers. Can be used to compute the double-precision number which is represented by the common bits. If there are no common bits, the number computed is 0.0. Computes the bit pattern for the sign and exponent of a double-precision number. The bit pattern for the sign and exponent. This computes the number of common most-significant bits in the mantissas of two double-precision numbers. It does not count the hidden bit, which is always 1. It does not determine whether the numbers have the same exponent - if they do not, the value computed by this function is meaningless. /// The number of common most-significant mantissa bits. Zeroes the lower n bits of a bitstring. The bitstring to alter. the number of bits to zero. The zeroed bitstring. Extracts the i'th bit of a bitstring. The bitstring to extract from. The bit to extract. The value of the extracted bit. A representation of the Double bits formatted for easy readability Provides versions of Geometry spatial functions which use common bit removal to reduce the likelihood of robustness problems. In the current implementation no rounding is performed on the reshifted result point, which means that it is possible that the returned Geometry is invalid. Client classes should check the validity of the returned result themselves. Creates a new instance of class, which reshifts result Geometrys. Creates a new instance of class, specifying whether the result Geometrys should be reshifted. Computes the set-theoretic intersection of two Geometrys, using enhanced precision. The first Geometry. The second Geometry. The Geometry representing the set-theoretic intersection of the input Geometries. Computes the set-theoretic union of two Geometrys, using enhanced precision. The first Geometry. The second Geometry. The Geometry representing the set-theoretic union of the input Geometries. Computes the set-theoretic difference of two Geometrys, using enhanced precision. The first Geometry. The second Geometry, to be subtracted from the first. The Geometry representing the set-theoretic difference of the input Geometries. Computes the set-theoretic symmetric difference of two geometries, using enhanced precision. The first Geometry. The second Geometry. The Geometry representing the set-theoretic symmetric difference of the input Geometries. Computes the buffer a point, using enhanced precision. The Geometry to buffer. The buffer distance. The Geometry representing the buffer of the input Geometry. If required, returning the result to the orginal precision if required. In this current implementation, no rounding is performed on the reshifted result point, which means that it is possible that the returned Geometry is invalid. The result Geometry to modify. The result Geometry with the required precision. Computes a copy of the input Geometry with the calculated common bits removed from each coordinate. The Geometry to remove common bits from. A copy of the input Geometry with common bits removed. Computes a copy of each input Geometrys with the calculated common bits removed from each coordinate. A Geometry to remove common bits from. A Geometry to remove common bits from. An array containing copies of the input Geometry's with common bits removed. Removes common most-significant mantissa bits from one or more s. The CommonBitsRemover "scavenges" precision which is "wasted" by a large displacement of the geometry from the origin. For example, if a small geometry is displaced from the origin by a large distance, the displacement increases the significant figures in the coordinates, but does not affect the relative topology of the geometry. Thus the geometry can be translated back to the origin without affecting its topology. In order to compute the translation without affecting the full precision of the coordinate values, the translation is performed at the bit level by removing the common leading mantissa bits. If the geometry envelope already contains the origin, the translation procedure cannot be applied. In this case, the common bits value is computed as zero. If the geometry crosses the Y axis but not the X axis (and mutatis mutandum), the common bits for Y are zero, but the common bits for X are non-zero. Add a point to the set of geometries whose common bits are being computed. After this method has executed the common coordinate reflects the common bits of all added geometries. A Geometry to test for common bits. Removes the common coordinate bits from a Geometry. The coordinates of the Geometry are changed. The Geometry from which to remove the common coordinate bits. The shifted Geometry. Adds the common coordinate bits back into a Geometry. The coordinates of the Geometry are changed. The Geometry to which to add the common coordinate bits. The common bits of the Coordinates in the supplied Geometries. The coordinate sequence Reduces the precision of the s in a to match the supplied . Uses . The input is modified in-place, so it should be cloned beforehand if the original should not be modified. mbdavis Creates a new precision reducer filter. The PrecisionModel to use Rounds the Coordinates in the sequence to match the PrecisionModel Always runs over all geometry components. Always reports that the geometry has changed Provides versions of Geometry spatial functions which use enhanced precision techniques to reduce the likelihood of robustness problems. Only static methods! Computes the set-theoretic intersection of two Geometrys, using enhanced precision. The first Geometry. The second Geometry. The Geometry representing the set-theoretic intersection of the input Geometries. Computes the set-theoretic union of two Geometrys, using enhanced precision. The first Geometry. The second Geometry. The Geometry representing the set-theoretic union of the input Geometries. Computes the set-theoretic difference of two Geometrys, using enhanced precision. The first Geometry. The second Geometry. The Geometry representing the set-theoretic difference of the input Geometries. Computes the set-theoretic symmetric difference of two Geometrys, using enhanced precision. The first Geometry. The second Geometry. The Geometry representing the set-theoretic symmetric difference of the input Geometries. Computes the buffer of a Geometry, using enhanced precision. This method should no longer be necessary, since the buffer algorithm now is highly robust. The first Geometry. The buffer distance. The Geometry representing the buffer of the input Geometry. Reduces the precision of a according to the supplied , ensuring that the result is topologically valid. Convenience method for doing precision reduction on a single geometry, with collapses removed and keeping the geometry precision model the same, and preserving polygonal topology. The geometry to reduce The precision model to use The reduced geometry Convenience method for doing pointwise precision reduction on a single geometry, with collapses removed and keeping the geometry precision model the same, but NOT preserving valid polygonal topology. The geometry to reduce The precision model to use The reduced geometry Duplicates a geometry to one that uses a different PrecisionModel, without changing any coordinate values. The geometry to duplicate The precision model to use The geometry value with a new precision model Gets or sets whether the reduction will result in collapsed components being removed completely, or simply being collapsed to an (invalid) Geometry of the same type. The default is to remove collapsed components. /// Gets or sets whether the of the new reduced Geometry will be changed to be the supplied to specify the precision reduction. The default is to not change the precision model Gets or sets whether the precision reduction will be done in pointwise fashion only. Pointwise precision reduction reduces the precision of the individual coordinates only, but does not attempt to recreate valid topology. This is only relevant for geometries containing polygonal components. Computes the Minimum Clearance of a . The Minimum Clearance is a measure of what magnitude of perturbation of the vertices of a geometry can be tolerated before the geometry becomes topologically invalid. The smaller the Minimum Clearance distance, the less vertex pertubation the geometry can tolerate before becoming invalid. The concept was introduced by Thompson and Van Oosterom [TV06], based on earlier work by Milenkovic [Mi88]. The Minimum Clearance of a geometry G is defined to be the value r such that "the movement of all points by a distance of r in any direction will guarantee to leave the geometry valid" [TV06]. An equivalent constructive definition [Mi88] is that r is the largest value such: No two distinct vertices of G are closer than r. No vertex of G is closer than r to an edge of G of which the vertex is not an endpoint The following image shows an example of the Minimum Clearance of a simple polygon.
If G has only a single vertex (i.e. is a ), the value of the minimum clearance is . If G is a or geometry, then in fact no amount of perturbation will render the geometry invalid. In this case a Minimum Clearance is still computed based on the vertex and segment distances according to the constructive definition. It is possible for no Minimum Clearance to exist. For instance, a with all members identical has no Minimum Clearance (i.e. no amount of perturbation will cause the member points to become non-identical). Empty geometries also have no such distance. The lack of a meaningful MinimumClearance distance is detected and suitable values are returned by and . The computation of Minimum Clearance utilizes the method to provide good performance even for large inputs. An interesting note is that for the case of s, the computed Minimum Clearance line effectively determines the Nearest Neighbours in the collection.

References

[Mi88] Milenkovic, V. J., Verifiable implementations of geometric algorithms using finite precision arithmetic. in Artificial Intelligence, 377-401. 1988 [TV06] Thompson, Rod and van Oosterom, Peter, Interchange of Spatial Data-Inhibiting Factors, Agile 2006, Visegrad, Hungary. 2006
/// Martin Davis
Computes the Minimum Clearance distance for the given Geometry. The input geometry The minimum clearance Gets a LineString containing two points which are at the Minimum Clearance distance for the given Geometry. The input geometry The value of the minimum clearance distance
or LINESTRING EMPTY if no minimum clearance distance exists.
Creates an object to compute the Minimum Clearance for the given Geometry The input geometry Gets the Minimum Clearance distance. If no distance exists (e.g. in the case of two identical points) is returned. The value of the minimum clearance distance
or if no Minimum Clearance distance exists
Gets a LineString containing two points which are at the Minimum Clearance distance. If no distance could be found (e.g. in the case of two identical points) LINESTRING EMPTY is returned. The value of the minimum clearance distance,
or LINESTRING EMPTY if no minimum clearance distance exists.
Reduces the precision of the coordinates of a Geometry according to the supplied {PrecisionModel}, without attempting to preserve valid topology. In case of geometries, the topology of the resulting geometry may be invalid if topological collapse occurs due to coordinates being shifted. It is up to the client to check this and handle it if necessary. Collapses may not matter for some uses. An example is simplifying the input to the buffer algorithm. The buffer algorithm does not depend on the validity of the input point. Convenience method for doing precision reduction on a single geometry, with collapses removed and keeping the geometry precision model the same. The reduced geometry Sets whether the reduction will result in collapsed components being removed completely, or simply being collapsed to an (invalid) Geometry of the same type. Gets/Sets whether the PrecisionModel of the new reduced Geometry will be changed to be the PrecisionModel supplied to specify the precision reduction. The default is to not change the precision model. Computes the minimum clearance of a geometry or set of geometries. The Minimum Clearance is a measure of what magnitude of perturbation of its vertices can be tolerated by a geometry before it becomes topologically invalid. This class uses an inefficient O(N^2) scan. It is primarily for testing purposes. Martin Davis Gets or sets the total number of points in the created . The created geometry will have no more than this number of points, unless more are needed to create a valid geometry. The height of an equilateral triangle of side one Creates random point sets contained in a region defined by either a rectangular or a polygonal extent. mbdavis Create a shape factory which will create shapes using the default . Create a shape factory which will create shapes using the given The factory to use Sets a polygonal mask. if the mask is not polygonal Creates random point sets where the points are constrained to lie in the cells of a grid. mbdavis Create a builder which will create shapes using the default . Create a builder which will create shapes using the given . The factory to use Gets the containing the generated point A MultiPoint Gets or sets whether generated points are constrained to lie within a circle contained within each grid cell. This provides greater separation between points in adjacent cells. The default is to not be constrained to a circle. Gets or sets the fraction of the grid cell side which will be treated as a gutter, in which no points will be created. The provided value is clamped to the range [0.0, 1.0]. Simplifies a line (sequence of points) using the standard Douglas-Peucker algorithm. Simplifies a using the Douglas-Peucker algorithm. Ensures that any polygonal geometries returned are valid. Simple lines are not guaranteed to remain simple after simplification. All geometry types are handled. Empty and point geometries are returned unchanged. Empty geometry components are deleted. Note that in general D-P does not preserve topology - e.g. polygons can be split, collapse to lines or disappear holes can be created or disappear, and lines can cross. To simplify point while preserving topology use TopologySafeSimplifier. (However, using D-P is significantly faster). KNOWN BUGS: In some cases the approach used to clean invalid simplified polygons can distort the output geometry severely. Simplifies a geometry using a given tolerance. The geometry to simplify. The tolerance to use. A simplified version of the geometry. Creates a simplifier for a given geometry. The geometry to simplify. Gets the simplified geometry. The simplified geometry. The distance tolerance for the simplification. All vertices in the simplified geometry will be within this distance of the original geometry. The tolerance value must be non-negative. Controls whether simplified polygons will be "fixed" to have valid topology. The caller may choose to disable this because: valid topology is not required fixing topology is a relative expensive operation in some pathological cases the topology fixing operation may either fail or run for too long The default is to fix polygon topology. Simplifies a polygon, fixing it if required. Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component. null if the simplification results in a degenerate ring Creates a valid area point from one that possibly has bad topology (i.e. self-intersections). Since buffer can handle invalid topology, but always returns valid point, constructing a 0-width buffer "corrects" the topology. Note this only works for area geometries, since buffer always returns areas. This also may return empty geometries, if the input has no actual area. An area point possibly containing self-intersections. A valid area point. An index of LineSegments. ItemVisitor subclass to reduce volume of query results. Simplifies a linestring (sequence of points) using the Visvalingam-Whyatt algorithm. The Visvalingam-Whyatt algorithm simplifies geometry by removing vertices while trying to minimize the area changed. 1.7 A LineSegment which is tagged with its location in a Geometry. Used to index the segments in a point and recover the segment locations from the index. Simplifies a collection of TaggedLineStrings, preserving topology (in the sense that no new intersections are introduced). This class is essentially just a container for the common indexes used by . Simplifies a collection of TaggedLineStrings. The collection of lines to simplify. Gets or sets the distance tolerance for the simplification.
Points closer than this tolerance to a simplified segment may be removed.
Represents a which can be modified to a simplified shape. This class provides an attribute which specifies the minimum allowable length for the modified result. Simplifies a TaggedLineString, preserving topology (in the sense that no new intersections are introduced). Uses the recursive Douglas-Peucker algorithm. Simplifies the given using the distance tolerance specified. The linestring to simplify. Flattens a section of the line between indexes and , replacing them with a line between the endpoints. The input and output indexes are updated to reflect this. The start index of the flattened section. The end index of the flattened section. The new segment created. Tests whether a segment is in a section of a . Remove the segs in the section of the line. Sets the distance tolerance for the simplification. All vertices in the simplified geometry will be within this distance of the original geometry. Simplifies a point and ensures that the result is a valid point having the same dimension and number of components as the input, and with the components having the same topological relationship. If the input is a polygonal geometry ( or ): The result has the same number of shells and holes as the input, with the same topological structure The result rings touch at no more than the number of touching points in the input (although they may touch at fewer points). The key implication of this statement is that if the input is topologically valid, so is the simplified output. For linear geometries, if the input does not contain any intersecting line segments, this property will be preserved in the output. For all geometry types, the result will contain enough vertices to ensure validity. For polygons and closed linear geometries, the result will have at least 4 vertices; for open linestrings the result will have at least 2 vertices. All geometry types are handled. Empty and point geometries are returned unchanged. Empty geometry components are deleted. The simplification uses a maximum-distance difference algorithm similar to the Douglas-Peucker algorithm.

KNOWN BUGS

May create invalid topology if there are components which are small relative to the tolerance value. In particular, if a small hole is very near an edge, it is possible for the edge to be moved by a relatively large tolerance value and end up with the hole outside the result shell (or inside another hole). Similarly, it is possible for a small polygon component to end up inside a nearby larger polygon. A workaround is to test for this situation in post-processing and remove any invalid holes or polygons.
A filter to add linear geometries to the linestring map with the appropriate minimum size constraint. Closed s (including s have a minimum output size constraint of 4, to ensure the output is valid. For all other linestrings, the minimum size is 2 points. Martin Davis Filters linear geometries. A geometry of any type Simplifies a linestring (sequence of points) using the Visvalingam-Whyatt algorithm. The Visvalingam-Whyatt algorithm simplifies geometry by removing vertices while trying to minimize the area changed. 1.7 Simplifies a using the Visvalingam-Whyatt area-based algorithm. Ensures that any polygonal geometries returned are valid. Simple lines are not guaranteed to remain simple after simplification. All geometry types are handled. Empty and point geometries are returned unchanged. Empty geometry components are deleted. The simplification tolerance is specified as a distance. This is converted to an area tolerance by squaring it. Known Bugs * Not yet optimized for performance. * Does not simplify the endpoint of rings. To Do * Allow specifying desired number of vertices in the output. Note that in general this algorithm does not preserve topology - e.g. polygons can be split, collapse to lines or disappear holes can be created or disappear, and lines can cross. 1.7 Simplifies a using a given tolerance. The to simplify. The tolerance to use. A simplified version of the . Creates a simplifier for a given . The to simplify. Gets the semplified . The semplified . Sets the distance tolerance for the simplification. All vertices in the simplified will be within this distance of the original geometry. The tolerance value must be non-negative. Controls whether simplified polygons will be "fixed" to have valid topology. The caller may choose to disable this because: * valid topology is not required. * fixing topology is a relative expensive operation. * in some pathological cases the topology fixing operation may either fail or run for too long. The default is to fix polygon topology. Simplifies a , fixing it if required. Simplifies a . If the simplification results in a degenerate ring, remove the component. null if the simplification results in a degenerate ring. Simplifies a , fixing it if required. Creates a valid area geometry from one that possibly has bad topology (i.e. self-intersections). Since buffer can handle invalid topology, but always returns valid geometry, constructing a 0-width buffer "corrects" the topology. Note this only works for area geometries, since buffer always returns areas. This also may return empty geometries, if the input has no actual area. An area geometry possibly containing self-intersections. A valid area geometry. A utility class which creates Conforming Delaunay Trianglulations from collections of points and linear constraints, and extract the resulting triangulation edges or triangles as geometries. Martin Davis Sets the sites (point or vertices) which will be triangulated. All vertices of the given geometry will be used as sites. The site vertices do not have to contain the constraint vertices as well; any site vertices which are identical to a constraint vertex will be removed from the site vertex set. The geometry from which the sites will be extracted. Gets the QuadEdgeSubdivision which models the computed triangulation. The subdivision containing the triangulation Gets the edges of the computed triangulation as a . The geometry factory to use to create the output the edges of the triangulation Gets the faces of the computed triangulation as a of . the geometry factory to use to create the output the faces of the triangulation Sets the linear constraints to be conformed to. All linear components in the input will be used as constraints. The constraint vertices do not have to be disjoint from the site vertices. The constraints must not contain duplicate segments (up to orientation). Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation. A tolerance of 0.0 specifies that no snapping will take place. Creates a Conforming Delaunay Triangulation based on the given unconstrained initial vertices. The initial vertex set should not contain any vertices which appear in the constraint set. a collection of the distance tolerance below which points are considered identical Sets the constraints to be conformed to by the computed triangulation. The constraints must not contain duplicate segments (up to orientation). The unique set of vertices (as es) forming the constraints must also be supplied. Supplying it explicitly allows the ConstraintVertexes to be initialized appropriately(e.g. with external data), and avoids re-computing the unique set if it is already available. list of the constraint {@link Segment}s the set of unique es referenced by the segments Creates a vertex on a constraint segment the location of the vertex to create the constraint segment it lies on the new constraint vertex Inserts all sites in a collection a collection of ConstraintVertex Inserts a site into the triangulation, maintaining the conformal Delaunay property. This can be used to further refine the triangulation if required (e.g. to approximate the medial axis of the constraints, or to improve the grading of the triangulation). the location of the site to insert Computes the Delaunay triangulation of the initial sites. Enforces the supplied constraints into the triangulation. if the constraints cannot be enforced Given a set of points stored in the kd-tree and a line segment defined by two points in this set, finds a in the circumcircle of the line segment, if one exists. This is called the Gabriel point - if none exists then the segment is said to have the Gabriel condition. Uses the heuristic of finding the non-Gabriel point closest to the midpoint of the segment. the line segment A point which is non-Gabriel, or null if no point is non-Gabriel Gets or sets the to be used during constraint enforcement. Different splitting strategies may be appropriate for special situations. the ConstraintSplitPointFinder to be used Gets the tolerance value used to construct the triangulation. a tolerance value Gets and sets the used to create new constraint vertices at split points. Allows the setting of a custom {@link ConstraintVertexFactory} to be used to allow vertices carrying extra information to be created. Gets the which represents the triangulation. Gets the which contains the vertices of the triangulation. Gets the sites (vertices) used to initialize the triangulation. Gets the s which represent the constraints. Gets the convex hull of all the sites in the triangulation, including constraint vertices. Only valid after the constraints have been enforced. the convex hull of the sites Indicates a failure during constraint enforcement. Martin Davis 1.0 Creates a new instance with a given message. a string Creates a new instance with a given message and approximate location. a string the location of the error Gets the approximate location of this error. a location An interface for strategies for determining the location of split points on constraint segments. The location of split points has a large effect on the performance and robustness of enforcing a constrained Delaunay triangulation. Poorly chosen split points can cause repeated splitting, especially at narrow constraint angles, since the split point will end up encroaching on the segment containing the original encroaching point. With detailed knowledge of the geometry of the constraints, it is sometimes possible to choose better locations for splitting. mbdavis Finds a point at which to split an encroached segment to allow the original segment to appear as edges in a constrained Delaunay triangulation. the encroached segment the encroaching point the point at which to split the encroached segment A vertex in a Constrained Delaunay Triangulation. The vertex may or may not lie on a constraint. If it does it may carry extra information about the original constraint. Martin Davis Models a site (node) in a . The sites can be points on a line string representing a linear site. The vertex can be considered as a vector with a norm, length, inner product, cross product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle defined by this point and two others, etc.) are also defined in this class. It is common to want to attach user-defined data to the vertices of a subdivision. One way to do this is to subclass Vertex to carry any desired information. David Skea Martin Davis Creates an instance of this class using the given x- and y-ordinate valuse x-ordinate value y-ordinate value Creates an instance of this class using the given x-, y- and z-ordinate values x-ordinate value y-ordinate value z-ordinate value Creates an instance of this class using a clone of the given . The coordinate Computes the cross product k = u X v. a vertex returns the magnitude of u X v Computes the inner or dot product A vertex The dot product u.v Computes the scalar product c(v) A vertex The scaled vector Tests if this is inside the circle defined by the points a, b, c. This test uses simple double-precision arithmetic, and thus may not be robust. A vertex of the triangle A vertex of the triangle A vertex of the triangle true if this vertex is inside the circumcircle (a, b, c) Tests whether the triangle formed by this vertex and two other vertices is in CCW orientation. a vertex a vertex true if the triangle is oriented CCW Computes the value of the ratio of the circumradius to shortest edge. If smaller than some given tolerance B, the associated triangle is considered skinny. For an equal lateral triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: circumRadius/shortestEdge = 1/(2sin(theta)). second vertex of the triangle third vertex of the triangle ratio of circumradius to shortest edge. returns a new vertex that is mid-way between this vertex and another end point. the other end point. the point mid-way between this and that. Computes the centre of the circumcircle of this vertex and two others. the Coordinate which is the circumcircle of the 3 points. For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate a z value from the surrounding vertices. Interpolates the Z-value (height) of a point enclosed in a triangle whose vertices all have Z values. The containing triangle must not be degenerate (in other words, the three vertices must enclose a non-zero area). The point to interpolate the Z value of A vertex of a triangle containing the A vertex of a triangle containing the A vertex of a triangle containing the The interpolated Z-value (height) of the point Computes the interpolated Z-value for a point p lying on the segment p0-p1 The point to interpolate the Z value of A vertex of the segment is lying on A vertex of the segment is lying on The interpolated Z-value (height) of the point Gets the x-ordinate value Gets the y-ordinate value Gets the z-ordinate value Gets the coordinate Creates a new constraint vertex the location of the vertex Merges the constraint data in the vertex other into this vertex. This method is called when an inserted vertex is very close to an existing vertex in the triangulation. the constraint vertex to merge Gets or sets whether this vertex lies on a constraint. true if the vertex lies on a constraint Gets or sets the external constraint object object which carries information about the constraint this vertex lies on An interface for factories which create a {@link ConstraintVertex} Martin Davis A utility class which creates Delaunay Trianglulations from collections of points and extract the resulting triangulation edges or triangles as geometries. Martin Davis Extracts the unique s from the given . the geometry to extract from a List of the unique Coordinates Converts all s in a collection to es. the coordinates to convert a List of Vertex objects Computes the of a collection of s. a List of Coordinates the envelope of the set of coordinates Sets the sites (vertices) which will be triangulated. All vertices of the given geometry will be used as sites. the geometry from which the sites will be extracted. Sets the sites (vertices) which will be triangulated from a collection of s. a collection of Coordinates. Gets the which models the computed triangulation. the subdivision containing the triangulation Gets the edges of the computed triangulation as a . the geometry factory to use to create the output the edges of the triangulation Gets the faces of the computed triangulation as a of . the geometry factory to use to create the output the faces of the triangulation Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation. A tolerance of 0.0 specifies that no snapping will take place. Computes a Delauanay Triangulation of a set of es, using an incrementatal insertion algorithm. Martin Davis 1.0 Creates a new triangulator using the given . The triangulator uses the tolerance of the supplied subdivision. a subdivision in which to build the TIN Inserts all sites in a collection. The inserted vertices MUST be unique up to the provided tolerance value. (i.e. no two vertices should be closer than the provided tolerance value). They do not have to be rounded to the tolerance grid, however. a Collection of Vertex if the location algorithm fails to converge in a reasonable number of iterations Inserts a new point into a subdivision representing a Delaunay triangulation, and fixes the affected edges so that the result is still a Delaunay triangulation. a quadedge containing the inserted vertex A simple split point finder which returns the midpoint of the split segment. This is a default strategy only. Usually a more sophisticated strategy is required to prevent repeated splitting. Other points which could be used are:
  • The projection of the encroaching point on the segment
  • A point on the segment which will produce two segments which will not be further encroached
  • The point on the segment which is the same distance from an endpoint as the encroaching
  • point
Martin Davis
Gets the midpoint of the split segment A strategy for finding constraint split points which attempts to maximise the length of the split segments while preventing further encroachment. (This is not always possible for narrow angles). Martin Davis A basic strategy for finding split points when nothing extra is known about the geometry of the situation. the encroached segment the encroaching point the point at which to split the encroached segment Computes a split point which is the projection of the encroaching point on the segment The segment The enchroaching point A split point on the segment A framework to visit sets of edge-connected s in breadth-first order Martin Davis 1.0 Called to initialize the traversal queue with a given set of s a collection of QuadEdgeTriangle Subclasses call this method to perform the visiting process. An interface for classes which locate an edge in a which either contains a given V or is an edge of a triangle which contains V. Implementors may utilized different strategies for optimizing locating containing edges/triangles. Martin Davis Interface for classes which process triangles visited during travesals of a Martin Davis Visits a triangle during a traversal of a . An implementation of this method may perform processing on the current triangle. It must also decide whether a neighbouring triangle should be added to the queue so its neighbours are visited. Often it will perform processing on the neighbour triangle as well, in order to mark it as processed (visited) and/or to determine if it should be visited. Note that choosing not to visit the neighbouring triangle is the terminating condition for many traversal algorithms. In particular, if the neighbour triangle has already been visited, it should not be visited again. the current triangle being processed the index of the edge in the current triangle being traversed a neighbouring triangle next in line to visit true if the neighbour triangle should be visited An interface for algorithms which process the triangles in a . Martin Davis 1.0 Locates s in a , optimizing the search by starting in the locality of the last edge found. Martin Davis Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. The search starts from the last located edge amd proceeds on the general direction of v. A class that represents the edge data structure which implements the quadedge algebra. The quadedge algebra was described in a well-known paper by Guibas and Stolfi, "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", ACM Transactions on Graphics, 4(2), 1985, 75-123. Each edge object is part of a quartet of 4 edges, linked via their Rot references. Any edge in the group may be accessed using a series of operations. Quadedges in a subdivision are linked together via their Next references. The linkage between the quadedge quartets determines the topology of the subdivision. The edge class does not contain separate information for vertice or faces; a vertex is implicitly defined as a ring of edges (created using the Next field). David Skea Martin Davis Creates a new QuadEdge quartet from o to d. the origin Vertex the destination Vertex the new QuadEdge quartet Creates a new QuadEdge connecting the destination of a to the origin of b, in such a way that all three have the same left face after the connection is complete. Additionally, the data pointers of the new edge are set. the connected edge Splices two edges together or apart. Splice affects the two edge rings around the origins of a and b, and, independently, the two edge rings around the left faces of a and b. In each case, (i) if the two rings are distinct, Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it into two separate pieces. Thus, Splice can be used both to attach the two edges together, and to break them apart. an edge to splice an edge to splice Turns an edge counterclockwise inside its enclosing quadrilateral. the quadedge to turn Quadedges must be made using {@link makeEdge}, to ensure proper construction. Gets the primary edge of this quadedge and its sym. The primary edge is the one for which the origin and destination coordinates are ordered according to the standard ordering the primary quadedge Marks this quadedge as being deleted. This does not free the memory used by this quadedge quartet, but indicates that this edge no longer participates in a subdivision. Sets the connected edge edge Tests if this quadedge and another have the same line segment geometry, regardless of orientation. a quadege true if the quadedges are based on the same line segment regardless of orientation Tests if this quadedge and another have the same line segment geometry with the same orientation. a quadege true if the quadedges are based on the same line segment Creates a representing the geometry of this edge. a LineSegment Converts this edge to a WKT two-point LINESTRING indicating the geometry of this edge. a String representing this edge's geometry Gets or sets the external data value for this edge. an object containing external data Tests whether this edge has been deleted. true if this edge has not been deleted. Gets the dual of this edge, directed from its right to its left. Gets or Sets the rotated edge Gets the dual of this edge, directed from its left to its right. Gets the inverse rotated edge. Gets the edge from the destination to the origin of this edge. Gets the sym of the edge. Gets the next CCW edge around the origin of this edge. Gets the next linked edge. Gets the next CW edge around (from) the origin of this edge. Gets the previous edge. Gets the next CCW edge around (into) the destination of this edge. Get the next destination edge. Gets the next CW edge around (into) the destination of this edge. Get the previous destination edge. Gets the CCW edge around the left face following this edge. Gets the next left face edge. Gets the CCW edge around the left face before this edge. Get the previous left face edge. Gets the edge around the right face ccw following this edge. Gets the next right face edge. Gets the edge around the right face ccw before this edge. Gets the previous right face edge. Gets or sets the vertex for the edge's origin Gets the origin vertex Gets or sets the vertex for the edge's destination Gets the destination vertex Gets the length of the geometry of this quadedge. Gets the length of the quadedge A class that contains the s representing a planar subdivision that models a triangulation. The subdivision is constructed using the quadedge algebra defined in the classs . All metric calculations are done in the class. In addition to a triangulation, subdivisions support extraction of Voronoi diagrams. This is easily accomplished, since the Voronoi diagram is the dual of the Delaunay triangulation. Subdivisions can be provided with a tolerance value. Inserted vertices which are closer than this value to vertices already in the subdivision will be ignored. Using a suitable tolerance value can prevent robustness failures from happening during Delaunay triangulation. Subdivisions maintain a frame triangle around the client-created edges. The frame is used to provide a bounded "container" for all edges within a TIN. Normally the frame edges, frame connecting edges, and frame triangles are not included in client processing. David Skea Martin Davis Gets the edges for the triangle to the left of the given . if the edges do not form a triangle Creates a new instance of a quad-edge subdivision based on a frame triangle that encloses a supplied bounding box. A new super-bounding box that contains the triangle is computed and stored. the bouding box to surround the tolerance value for determining if two sites are equal Gets the collection of base s (one for every pair of vertices which is connected). a collection of QuadEdges Sets the to use for locating containing triangles in this subdivision. a QuadEdgeLocator Creates a new quadedge, recording it in the edges list. The origin vertex The destination vertex A new quadedge Creates a new QuadEdge connecting the destination of a to the origin of b, in such a way that all three have the same left face after the connection is complete. The quadedge is recorded in the edges list. A quadedge A quadedge A quadedge Deletes a quadedge from the subdivision. Linked quadedges are updated to reflect the deletion. the quadedge to delete Locates an edge of a triangle which contains a location specified by a Vertex v. The edge returned has the property that either v is on e, or e is an edge of a triangle containing v. The search starts from startEdge amd proceeds on the general direction of v. This locate algorithm relies on the subdivision being Delaunay. For non-Delaunay subdivisions, this may loop for ever. the location to search for an edge of the subdivision to start searching at a QuadEdge which contains v, or is on the edge of a triangle containing v if the location algorithm fails to converge in a reasonable number of iterations Finds a quadedge of a triangle containing a location specified by a , if one exists. the vertex to locate a quadedge on the edge of a triangle which touches or contains the location
or null if no such triangle exists
Finds a quadedge of a triangle containing a location specified by a , if one exists. the Coordinate to locate a quadedge on the edge of a triangle which touches or contains the location, or null if no such triangle exists Locates the edge between the given vertices, if it exists in the subdivision. a coordinate another coordinate the edge joining the coordinates, if present, or null if no such edge exists Inserts a new site into the Subdivision, connecting it to the vertices of the containing triangle (or quadrilateral, if the split point falls on an existing edge). This method does NOT maintain the Delaunay condition. If desired, this must be checked and enforced by the caller. This method does NOT check if the inserted vertex falls on an edge. This must be checked by the caller, since this situation may cause erroneous triangulation the vertex to insert a new quad edge terminating in v Tests whether a QuadEdge is an edge incident on a frame triangle vertex. the edge to test true if the edge is connected to the frame triangle Tests whether a QuadEdge is an edge on the border of the frame facets and the internal facets. E.g. an edge which does not itself touch a frame vertex, but which touches an edge which does. the edge to test true if the edge is on the border of the frame Tests whether a vertex is a vertex of the outer triangle. the vertex to test true if the vertex is an outer triangle vertex Tests whether a {@link Coordinate} lies on a {@link QuadEdge}, up to a tolerance determined by the subdivision tolerance. a QuadEdge a point true if the vertex lies on the edge Tests whether a is the start or end vertex of a , up to the subdivision tolerance distance. true if the vertex is a endpoint of the edge Gets the unique es in the subdivision, including the frame vertices if desired. true if the frame vertices should be included a collection of the subdivision vertices Gets a collection of s whose origin vertices are a unique set which includes all vertices in the subdivision. The frame vertices can be included if required. This is useful for algorithms which require traversing the subdivision starting at all vertices. Returning a quadedge for each vertex is more efficient than the alternative of finding the actual vertices using and then locating quadedges attached to them. true if the frame vertices should be included a collection of QuadEdge with the vertices of the subdivision as their origins Gets all primary quadedges in the subdivision. A primary edge is a which occupies the 0'th position in its array of associated quadedges. These provide the unique geometric edges of the triangulation. true if the frame edges are to be included a List of QuadEdges The quadedges forming a single triangle. Only one visitor is allowed to be active at a time, so this is safe. Stores the edges for a visited triangle. Also pushes sym (neighbour) edges on stack to visit later. the visited triangle edges,
or null if the triangle should not be visited (for instance, if it is outer)
Gets a list of the triangles in the subdivision, specified as an array of the primary quadedges around the triangle. true if the frame triangles should be included a List of QuadEdge[3] arrays Gets a list of the triangles in the subdivision, specified as an array of the triangle es. true if the frame triangles should be included a List of Vertex[3] arrays Gets the coordinates for each triangle in the subdivision as an array. true if the frame triangles should be included a list of Coordinate[4] representing each triangle Gets the geometry for the edges in the subdivision as a containing 2-point lines. the GeometryFactory to use a IMultiLineString Gets the geometry for the triangles in a triangulated subdivision as a of triangular s. the GeometryFactory to use a GeometryCollection of triangular Polygons Gets the cells in the Voronoi diagram for this triangulation. The cells are returned as a of s The userData of each polygon is set to be the of the cell site. This allows easily associating external data associated with the sites to the cells. a geometry factory a GeometryCollection of Polygons Gets a List of s for the Voronoi cells of this triangulation. The UserData of each polygon is set to be the of the cell site. This allows easily associating external data associated with the sites to the cells. a geometry factory a List of Polygons Gets the Voronoi cell around a site specified by the origin of a QuadEdge. The userData of the polygon is set to be the of the site. This allows attaching external data associated with the site to this cell polygon. a quadedge originating at the cell site a factory for building the polygon a polygon indicating the cell extent Gets the vertex-equality tolerance value used in this subdivision Gets the tolerance value Gets the envelope of the Subdivision (including the frame). Gets the envelope A TriangleVisitor which computes and sets the circumcentre as the origin of the dual edges originating in each triangle. mbdavis Models a triangle formed from s in a which forms a triangulation. The class provides methods to access the topological and geometric properties of the triangle and its neighbours in the triangulation. Triangle vertices are ordered in CCW orientation in the structure. QuadEdgeTriangles support having an external data attribute attached to them. Alternatively, this class can be subclassed and attributes can be defined in the subclass. Subclasses will need to define their own BuilderVisitor class and CreateOn method. Martin Davis 1.0 Creates s for all facets of a representing a triangulation. The data attributes of the s in the subdivision will be set to point to the triangle which contains that edge. This allows tracing the neighbour triangles of any given triangle. The QuadEdgeSubdivision to create the triangles on. A List of the created QuadEdgeTriangles Tests whether the point pt is contained in the triangle defined by 3 es. an array containing at least 3 Vertexes the point to test true if the point is contained in the triangle Tests whether the point pt is contained in the triangle defined by 3 es. an array containing at least 3 QuadEdges the point to test true if the point is contained in the triangle Creates a new triangle from the given edges. An array of the edges of the triangle in CCW order Gets the vertices for this triangle. a new array containing the triangle vertices Gets the index for the given edge of this triangle a QuadEdge the index of the edge in this triangle,
or -1 if the edge is not an edge of this triangle
Gets the index for the edge that starts at vertex v. the vertex to find the edge for the index of the edge starting at the vertex,
or -1 if the vertex is not in the triangle
Tests whether this triangle is adjacent to the outside of the subdivision. true if the triangle is adjacent to the subdivision exterior Gets the triangles which are adjacent (include) to a given vertex of this triangle. The vertex to query A list of the vertex-adjacent triangles Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is null an array containing the 3 neighbours of this triangle Gets or sets the external data value for this triangle. Gets all edges which are incident on the origin of the given edge. the edge to start at a List of edges which have their origin at the origin of the given edge Algorithms for computing values and predicates associated with triangles. For some algorithms extended-precision implementations are provided, which are more robust (i.e. they produce correct answers in more cases). Also, some more robust formulations of some algorithms are provided, which utilize normalization to the origin. Martin Davis Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise). This test uses simple double-precision arithmetic, and thus is not 100% robust. A vertex of the triangle A vertex of the triangle A vertex of the triangle The point to test true if this point is inside the circle defined by the points a, b, c Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise). This test uses simple double-precision arithmetic, and thus is not 100% robust. However, by using normalization to the origin it provides improved robustness and increased performance. Based on code by J.R.Shewchuk. A vertex of the triangle A vertex of the triangle A vertex of the triangle The point to test true if this point is inside the circle defined by the points a, b, c Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the triangle is oriented counterclockwise. A vertex of the triangle A vertex of the triangle A vertex of the triangle The area of the triangle defined by the points a, b, c Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise). This method uses more robust computation. A vertex of the triangle A vertex of the triangle A vertex of the triangle The point to test true if this point is inside the circle defined by the points a, b, c Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise). The computation uses arithmetic for robustness. A vertex of the triangle A vertex of the triangle A vertex of the triangle The point to test true if this point is inside the circle defined by the points a, b, c Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the triangle is oriented counterclockwise. The computation uses {@link DD} arithmetic for robustness. x ordinate of a vertex of the triangle y ordinate of a vertex of the triangle x ordinate of a vertex of the triangle y ordinate of a vertex of the triangle x ordinate of a vertex of the triangle y ordinate of a vertex of the triangle The area of a triangle defined by the points a, b and c Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise). The computation uses arithmetic for robustness, but a faster approach. A vertex of the triangle A vertex of the triangle A vertex of the triangle The point to test true if this point is inside the circle defined by the points a, b, c Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the triangle is oriented counterclockwise. The computation uses {@link DD} arithmetic for robustness. a vertex of the triangle a vertex of the triangle a vertex of the triangle The area of a triangle defined by the points a, b and c Computes the inCircle test using distance from the circumcentre. Uses standard double-precision arithmetic. In general this doesn't appear to be any more robust than the standard calculation. However, there is at least one case where the test point is far enough from the circumcircle that this test gives the correct answer.
            LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
            1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
            
A vertex of the triangle A vertex of the triangle A vertex of the triangle The point to test The area of a triangle defined by the points a, b and c
Checks if the computed value for isInCircle is correct, using double-double precision arithmetic. A vertex of the triangle A vertex of the triangle A vertex of the triangle The point to test Creates a new instance for the given ordinates. Creates a new instance for the given ordinates, with associated external data. Creates a new instance for the given points, with associated external data. the start point the end point an external data object Creates a new instance for the given points. the start point the end point Determines whether two segments are topologically equal. I.e. equal up to orientation. a segment true if the segments are topologically equal Computes the intersection point between this segment and another one. a segment the intersection point, or null if there is none Computes a string representation of this segment. a string Gets the start coordinate of the segment a Coordinate Gets the end coordinate of the segment a Coordinate Gets the start X ordinate of the segment the X ordinate value Gets the start Y ordinate of the segment the Y ordinate value Gets the start Z ordinate of the segment the Z ordinate value Gets the end X ordinate of the segment the X ordinate value Gets the end Y ordinate of the segment he Y ordinate value Gets the end Z ordinate of the segment the Z ordinate value Gets a LineSegment modelling this segment. a LineSegment Gets or sets the external data associated with this segment a data object Models a constraint segment which can be split in two in various ways, according to certain geometric constraints. Martin Davis Computes the {@link Coordinate} that lies a given fraction along the line defined by the reverse of the given segment. A fraction of 0.0 returns the end point of the segment; a fraction of 1.0 returns the start point of the segment. the LineSegment the fraction of the segment length along the line the point at that distance Creates a map between the vertex s of a set of s, and the parent geometry, and transfers the source geometry data objects to geometry components tagged with the coordinates. This class can be used in conjunction with to transfer data objects from the input site geometries to the constructed Voronoi polygons. Martin Davis Input is assumed to be a multiGeometry in which every component has its userData set to be a Coordinate which is the key to the output data. The Coordinate is used to determine the output data object to be written back into the component. A utility class which creates Voronoi Diagrams from collections of points. The diagram is returned as a of s, representing the faces of the Voronoi diagram. /// The faces are clipped to the larger of: an envelope supplied by . an envelope determined by the input sites. The userData attribute of each face Polygon is set to the Coordinate of the corresponding input site. This allows using a Map to link faces to data associated with sites. Martin Davis Sets the sites (point or vertices) which will be diagrammed. All vertices of the given geometry will be used as sites. geom the geometry from which the sites will be extracted. Sets the sites (point or vertices) which will be diagrammed from a collection of s. a collection of Coordinates. Gets the which models the computed diagram. the subdivision containing the triangulation Gets the faces of the computed diagram as a of s, clipped as specified. The attribute of each face is set to the Coordinate of the corresponding input site. This allows using a to link faces to data associated with sites. the geometry factory to use to create the output a containg the face s of the diagram Sets the envelope to clip the diagram to. The diagram will be clipped to the larger of this envelope or an envelope surrounding the sites. the clip envelope. Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation. A tolerance of 0.0 specifies that no snapping will take place. tolerance the tolerance distance to use An alternative implementation of the priority queue abstract data type. This allows us to do more than , which we got from JTS. Ultimately, this queue enables scenarios that have more favorable execution speed characteristics at the cost of less favorable memory and usability characteristics. The type of the priority for each queue node. The type of data stored in the queue. When enumerating over the queue, note that the elements will not be in sorted order. To get at the elements in sorted order, use the copy constructor and repeatedly elements from it. Initializes a new instance of the class. Initializes a new instance of the class. The initial queue capacity. is less than 1. Initializes a new instance of the class. The to use to compare priority values, or to use the default comparer for the type. Initializes a new instance of the class. The initial queue capacity. The to use to compare priority values, or to use the default comparer for the type. is less than 1. Initializes a new instance of the class. The to copy from. is . Removes all nodes from this queue. Determines whether the given node is contained within this queue. The node to locate in the queue. if is found in the queue, otherwise . Adds a given node to the queue with the given priority. The node to add to the queue. The priority for the node. is . Removes and returns the head of the queue. The removed element. Changes the priority of the given node. The node whose priority to change. The new priority for the node. is . Removes the given node from this queue if it is present. The node to remove if present. A value indicating whether the node was removed. Gets the number of nodes currently stored in this queue. Gets the node at the head of the queue. This is the node whose compares less than or equal to the priority of all other nodes in the queue. A container for a prioritized node that sites in an . The type to use for the priority of the node in the queue. The type to use for the data stored by the node in the queue. Initializes a new instance of the class. The to store in this node. Gets the that is stored in this node. Gets the of this node in the queue. The queue may update this priority while the node is still in the queue. Gets or sets the index of this node in the queue. This should only be read and written by the queue itself. It has no "real" meaning to anyone else. A utility for making programming assertions. A supoort class: the purpose is to integrate System.BitConverter methods not presents in .NET Compact Framework. Static utility class for casting objects Cast function from arbitrary-type to The output type The sequence of items to cast. as an enumerable of Thrown if cast cannot be performed Cast function from sub-type to super-type The output (super/base) type The input (sub/derived) type The sequence of items to cast. as an enumerable of Cast function from super-type to sub-type The input (sub/derived) type The output (super/base) type The sequence of items to cast. as an enumerable of Executes a transformation function on each element of a collection and returns the results in a new List. Executes a function on each item in a and returns the results in a new . Executes a function on each item in a and returns the results in a new . Executes a function on each item in a and returns the results in a new . Executes a function on each item in a and returns the results in a new . Executes a function on each item in a and returns the results in a new . Executes a function on each item in a but does not accumulate the result. Executes a function on each item in a but does not accumulate the result. Executes a function on each item in a and collects all the entries for which the result of the function is equal to true. Executes a function on each item in a and collects all the entries for which the result of the function is equal to true. Copies s in an array to an object array the source array An array of objects A CoordinateFilter that creates an array containing every coordinate in a Geometry. Constructs a CoordinateArrayFilter. The number of points that the CoordinateArrayFilter will collect. Returns the Coordinates collected by this CoordinateArrayFilter. CoordinateCompare is used in the sorting of arrays of Coordinate objects. Implements a lexicographic comparison. Compares two object and returns a value indicating whether one is less than, equal to or greater than the other. First Coordinate object to compare. Second Coordinate object to compare. <table cellspacing="0" class="dtTABLE"> <TR VALIGN="top"> <TH width=50%>Value</TH> <TH width=50%>Condition</TH> </TR> <TR VALIGN="top"> <TD width=50%>Less than zero</TD> <TD width=50%><I>a</I> is less than <I>b</I>.</TD> </TR> <TR VALIGN="top"> <TD width=50%>Zero</TD> <TD width=50%><I>a</I> equals <I>b</I>.</TD> </TR> <TR VALIGN="top"> <TD width=50%>Greater than zero</TD> <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> </TR> </table> If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b implements IComparable, then b. CompareTo (a) is returned. Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not generate an exception when using IComparable. When sorting, a null reference (Nothing) is considered to be less than any other object. A CoordinateFilter that counts the total number of coordinates in a Geometry. Returns the result of the filtering. Converts degrees to radians. Converts degrees to radians. The angle in degrees. The angle in radians. Only static methods! Convert the given numeric value (passed as string) of the base specified by baseIn to the value specified by baseOut. Numeric value to be converted, as string. Base of input value. Base to use for conversion. Converted value, as string. Utility functions to report memory usage. mbdavis A priority queue over a set of objects. Objects to add Martin Davis Insert into the priority queue. Duplicates are allowed. The item to insert. Test if the priority queue is logically empty. true if empty, false otherwise. Make the priority queue logically empty. Remove the smallest item from the priority queue. The smallest item, or default(T) if empty. Returns size. Converts radians to degress. Converts radians to degress. Angle in radians. The angle in degrees. Buffer for characters. This approximates StringBuilder but is designed to be faster for specific operations. This is about 30% faster for the operations I'm interested in (Append, Clear, Length, ToString). This trades off memory for speed. To make Remove from the head fast, this is implemented as a ring buffer. This uses head and tail indices into a fixed-size array. This will grow the array as necessary. Default constructor. Construct with a specific capacity. Reallocate the buffer to be larger. For the new size, this uses the max of the requested length and double the current capacity. This does not shift, meaning it does not change the head or tail indices. The new requested length. Ensure that we're set for the requested length by potentially growing or shifting contents. Move the buffer contents such that headIndex becomes 0. Overwrite this object's underlying buffer with the specified buffer. The character array. The number of characters to consider filled in the input buffer. Append a character to this buffer. Append a string to this buffer. The string to append. Append a string to this buffer. The string to append. Remove a character at the specified index. The index of the character to remove. Remove a specified number of characters at the specified index. The index of the characters to remove. The number of characters to remove. Find the first instance of a character in the buffer, and return its index. This returns -1 if the character is not found. The character to find. The index of the specified character, or -1 for not found. Empty the buffer. Return the current contents as a string. The new string. Gets/Sets the number of characters in the character buffer. Increasing the length this way provides indeterminate results. Returns the capacity of this character buffer. Indexer. Exception class for unterminated tokens. Construct with a particular message. The message to store in this object. Exception class for unterminated quotes. Construct with a particular message. The message to store in this object. Exception class for unterminated block comments. Construct with a particular message. The message to store in this object. Bitwise enumeration for character types. word characters (usually alpha, digits, and domain specific) # or something for line comments whitespace ' or " type usually 0 to 9 usually 0 to 9, a-f and A-F eof char This contains the settings that control the behavior of the tokenizer. This is separated from the StreamTokenizer so that common settings are easy to package and keep together. Default constructor. Copy constructor. Sets this object to be the same as the specified object. Note that some settings which are entirely embodied by the character type table. Setup default parse behavior. This resets to same behavior as on construction. bool - true for success. Apply settings which are commonly used for code parsing C-endCapStyle code, including C++, C#, and Java. Clear the character type settings. This leaves them unset, as opposed to the default. Use SetDefaults() for default settings. Specify that a particular character is a word character. Character table type manipulation method. This adds the type to the char(s), rather than overwriting other types. The character. Specify that a range of characters are word characters. Character table type manipulation method. This adds the type to the char(s), rather than overwriting other types. First character. Last character. Specify that a string of characters are word characters. Character table type manipulation method. This adds the type to the char(s), rather than overwriting other types. Specify that a character is a whitespace character. Character table type manipulation method. This type is exclusive with other types. The character. Specify that a range of characters are whitespace characters. Character table type manipulation method. This adds the characteristic to the char(s), rather than overwriting other characteristics. First character. Last character. Remove other type settings from a range of characters. Character table type manipulation method. Remove other type settings from a character. Character table type manipulation method. Specify that a particular character is a comment-starting character. Character table type manipulation method. Specify that a particular character is a quote character. Character table type manipulation method. Return a string representation of a character type setting. Since the type setting is bitwise encoded, a character can have more than one type. The character type byte. The string representation of the type flags. Check whether the specified char type byte has a particular type flag set. The char type byte. The CharTypeBits entry to compare to. bool - true or false Check whether the specified char has a particular type flag set. The character. The CharTypeBits entry to compare to. bool - true or false Check whether the specified char has a particular type flag set. The character. The CharTypeBits entry to compare to. bool - true or false Display the state of this object. Display the state of this object, with a per-line prefix. The pre-line prefix. This is the character type table. Each byte is bitwise encoded with the character attributes, such as whether that character is word or whitespace. Whether or not to return whitespace tokens. If not, they're ignored. Whether or not to return EolTokens on end of line. Eol tokens will not break up other tokens which can be multi-line. For example block comments and quotes will not be broken by Eol tokens. Therefore the number of Eol tokens does not give you the line count of a stream. Whether or not to look for // comments Whether or not to look for /* */ block comments. Whether or not to return comments. Whether or not to check for unterminated quotes and block comments. If true, and one is encoutered, an exception is thrown of the appropriate type. Whether or not digits are specified as Digit type in the character table. This setting is based on the character types table, so this setting interacts with character type table manipulation. This setting may become incorrect if you modify the character types table directly. Whether or not to parse Hex (0xABCD...) numbers. This setting is based on the character types table, so this setting interacts with character type table manipulation. A StreamTokenizer similar to Java's. This breaks an input stream (coming from a TextReader) into Tokens based on various settings. The settings are stored in the TokenizerSettings property, which is a StreamTokenizerSettings instance. This is configurable in that you can modify TokenizerSettings.CharTypes[] array to specify which characters are which type, along with other settings such as whether to look for comments or not. WARNING: This is not internationalized. This treats all characters beyond the 7-bit ASCII range (decimal 127) as Word characters. There are two main ways to use this: 1) Parse the entire stream at once and get an ArrayList of Tokens (see the Tokenize* methods), and 2) call NextToken() successively. This reads from a TextReader, which you can set directly, and this also provides some convenient methods to parse files and strings. This returns an Eof token if the end of the input is reached. Here's an example of the NextToken() endCapStyle of use: StreamTokenizer tokenizer = new StreamTokenizer(); tokenizer.GrabWhitespace = true; tokenizer.Verbosity = VerbosityLevel.Debug; // just for debugging tokenizer.TextReader = File.OpenText(fileName); Token token; while (tokenizer.NextToken(out token)) log.Info("Token = '{0}'", token); Here's an example of the Tokenize... endCapStyle of use: StreamTokenizer tokenizer = new StreamTokenizer("some string"); ArrayList tokens = new ArrayList(); if (!tokenizer.Tokenize(tokens)) { // error handling } foreach (Token t in tokens) Console.WriteLine("t = {0}", t); Comment delimiters are hardcoded (// and /*), not affected by char type table. This sets line numbers in the tokens it produces. These numbers are normally the line on which the token starts. There is one known caveat, and that is that when GrabWhitespace setting is true, and a whitespace token contains a newline, that token's line number will be set to the following line rather than the line on which the token started. This is the number of characters in the character table. Default constructor. Construct and set this object's TextReader to the one specified. The TextReader to read from. Construct and set a string to tokenize. The string to tokenize. Utility function, things common to constructors. Clear the stream settings. Display the state of this object. Display the state of this object, with a per-line prefix. The pre-line prefix. Pick the next state given just a single character. This is used at the start of a new token. The type of the character. The character. The state. Pick the next state given just a single character. This is used at the start of a new token. The type of the character. The character. Exclude this state from the possible next state. The state. Read the next character from the stream, or from backString if we backed up. The next character. Get the next token. The last token will be an EofToken unless there's an unterminated quote or unterminated block comment and Settings.DoUntermCheck is true, in which case this throws an exception of type StreamTokenizerUntermException or sub-class. The output token. bool - true for success, false for failure. Starting from current stream location, scan forward over an int. Determine whether it's an integer or not. If so, push the integer characters to the specified CharBuffer. If not, put them in backString (essentially leave the stream as it was) and return false. If it was an int, the stream is left 1 character after the end of the int, and that character is output in the thisChar parameter. The formats for integers are: 1, +1, and -1 The + and - signs are included in the output buffer. The CharBuffer to append to. Whether or not to consider + to be part of an integer. The last character read by this method. true for parsed an int, false for not an int Parse the rest of the stream and put all the tokens in the input ArrayList. This resets the line number to 1. The ArrayList to append to. bool - true for success Parse all tokens from the specified TextReader, put them into the input ArrayList. The TextReader to read from. The ArrayList to append to. bool - true for success, false for failure. Parse all tokens from the specified file, put them into the input ArrayList. The file to read. The ArrayList to put tokens in. bool - true for success, false for failure. Tokenize a file completely and return the tokens in a Token[]. The file to tokenize. A Token[] with all tokens. Parse all tokens from the specified string, put them into the input ArrayList. The ArrayList to put tokens in. bool - true for success, false for failure. Parse all tokens from the specified Stream, put them into the input ArrayList. The ArrayList to put tokens in. bool - true for success, false for failure. Gibt einen Enumerator zurück, der die Auflistung durchläuft. Ein , der zum Durchlaufen der Auflistung verwendet werden kann. 1 Gibt einen Enumerator zurück, der eine Auflistung durchläuft. Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. 2 This is the TextReader that this object will read from. Set this to set the input reader for the parse. The settings which govern the behavior of the tokenization. The states of the state machine. Token class used by StreamTokenizer. This represents a single token in the input stream. This is subclassed to provide specific token types, such as CharToken, FloatToken, etc. The line number in the input stream where this token originated. This is base-1. A storage object for the data of this token. Backer for UntermError. An error message associated with unterm error. Construct a Token with the specified line number. The line number where this token comes from. Equals override. The object to compare to. bool - true for equals, false otherwise. Equals overload. The string to compare to. bool Equals overload. The char to compare to. bool Operator== overload. Compare a token and an object. The token to compare. The other object. bool Operator!= overload. Compare a token and an object. The token to compare. The other object. bool Operator== overload. Compare a token and a char. The token to compare. The char. bool Operator!= overload. Compare a token and a char. The token to compare. The char. bool Operator== overload. Compare a token and a string. The token to compare. The string. bool Operator!= overload. Compare a token and a string. The token to compare. The string. bool Override. Returns the ToString().GetHashCode(). The hash code. Produce a string which includes the line number. Produce a string which includes the token type. Create an object of the specified type corresponding to this token. The type of object to create. The new object, or null for error. The line number where this token was found. This is base-1. The Object stored by this token. This will be a primitive C# type. Whether or not there was an unterminated token problem when creating this token. See UntermErrorMessage for a message associated with the problem. The error message if there was an unterminated token error creating this token. Return this token's value as a string. This token's value as a string. Represents end-of-lines (line separator characters). Default constructor. Constructor that takes line number. Override, see base Override, see base Override, see base Override, see base Override, see base Represents end of file/stream. Default constructor. Constructor that takes line number. Override, see base Override, see base Override, see base Override, see base Override, see base Abstract base class for string tokens. Default constructor. Constructor with the specified value and line number. Override, see base Override, see base Override, see base Override, see base Token type for words, meaning sequences of word characters. Constructor with the specified value. Constructor with the specified value and line number. Token type for Quotes such as "this is a quote". Constructor with the specified value. Constructor with the specified value and line number. Token type for comments, including line and block comments. Constructor with the specified value. Constructor with the specified value and line number. Token type for whitespace such as spaces and tabs. Constructor with the specified value. Constructor with the specified value and line number. Token type for characters, meaning non-word characters. Constructor with the specified value and line number. Constructor with the specified value. Constructor with the specified value. Override, see base Override, see base Override, see base Override, see base Override, see base Token type for floating point numbers, stored internally as a Double. Constructor with the specified value. Constructor with the specified value. Constructor with the specified value. Constructor with the specified value and line number. Constructor with the specified value and line number. Override, see base Override, see base Override, see base Override, see base Override, see base Token type for integer tokens. This handles both Int32 and Int64. Constructor with the specified value. Constructor with the specified value. Constructor with the specified value. Constructor with the specified value and line number. Constructor with the specified value and line number. Constructor for a 64 bit int Parse a string known to be a hex string. This is faster than Parse which doesn't assume the number is Hex. This will throw an exception if the input number isn't hex. The hex number as a string. The line where this token was found. A new IntToken set to the value in the input string. Convert the input string to an integer, if possible The string to parse. Override, see base Override, see base Override, see base Override, see base Override, see base This enumerates verbosity levels. For error messages. For warn messages. For info messages. For debug messages. Framework replacement for string.IsNullOrWhitespace The string to test A value indicating if is null, empty or only contains whitespace characters A CoordinateFilter that builds a set of Coordinates. The set of coordinates contains no duplicate points. Convenience method which allows running the filter over an array of s. an array of coordinates an array of the unique coordinates Returns the gathered s. An algorithm for computing a distance metric which is an approximation to the Hausdorff Distance based on a discretization of the input . The algorithm computes the Hausdorff distance restricted to discrete points for one of the geometries. The points can be either the vertices of the geometries (the default), or the geometries with line segments densified by a given fraction. Also determines two points of the Geometries which are separated by the computed distance. This algorithm is an approximation to the standard Hausdorff distance. Specifically, for all geometries a, b: DHD(a, b) <= HD(a, b) The approximation can be made as close as needed by densifying the input geometries. In the limit, this value will approach the true Hausdorff distance: DHD(A, B, densifyFactor) -> HD(A, B) as densifyFactor -> 0.0 The default approximation is exact or close enough for a large subset of useful cases. Examples of these are: computing distance between Linestrings that are roughly parallel to each other, and roughly equal in length. This occurs in matching linear networks. Testing similarity of geometries. An example where the default approximation is not close is: A = LINESTRING (0 0, 100 0, 10 100, 10 100) B = LINESTRING (0 100, 0 10, 80 10) DHD(A, B) = 22.360679774997898 HD(A, B) ~= 47.8 Computes the Discrete Hausdorff Distance of two s. A geometry A geometry The Discrete Hausdorff Distance Computes the Discrete Hausdorff Distance of two s. A geometry A geometry The densify fraction. A value of 0 indicates, that no densification should take place The Discrete Hausdorff Distance Value of 0.0 indicates that no densification should take place Gets/sets the fraction by which to densify each segment. Each segment will be (virtually) split into a number of equal-length subsegments, whose fraction of the total length is closest to the given fraction.