AlgorithmBased 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
http://www.faqs.org/faqs/graphics/algorithms-faq/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.
AlgorithmCompute the average of the midpoints of all line segments weighted by the segment length.
AlgorithmCompute the average of all points.
- IndexedPointInAreaLocator for more general functionality
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 arrangement.
- 2 or 3 points define a circle which contains all the input points.
This is the rule specified by the OGC SFS, and is the default rule used in JTS.
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.
||the query rectangle, specified as an Envelope|