Namespace: algorithm

jsts.algorithm

Source:

Classes

Angle
BoundaryNodeRule
CentralEndpointIntersector
Centroid
CGAlgorithms
ConvexHull
HCoordinate
InteriorPointArea
InteriorPointLine
InteriorPointPoint
LineIntersector
MinimumDiameter
PointLocator
RayCrossingCounter
RobustDeterminant
RobustLineIntersector
SafeBisectorFinder

Namespaces

distance
locate

Methods

(static) CentroidArea()

Computes the centroid of an area geometry.

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 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.
Version:
  • 1.7
Source:

(static) CentroidLine()

Computes the centroid of a linear geometry.

Algorithm

Compute the average of the midpoints of all line segments weighted by the segment length.
Version:
  • 1.7
Source:

(static) CentroidPoint()

Computes the centroid of a point geometry.

Algorithm

Compute the average of all points.
Version:
  • 1.7
Source:

(static) MCPointInRing()

Implements PointInRing using MonotoneChains and a Bintree index to increase performance.
Source:
See:
  • IndexedPointInAreaLocator for more general functionality

(static) MinimumBoundingCircle()

Computes the Minimum Bounding Circle (MBC) for the points in a Geometry. The MBC is the smallest circle which covers all the input points (this is also 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 arrangement.
    • 2 or 3 points define a circle which contains all the input points.
The class can also output a Geometry which approximates the shape of the MBC (although as an approximation it is not guaranteed to cover all the input points.)
Author:
  • Martin Davis
Source:
See:
  • MinimumDiameter

(static) Mod2BoundaryNodeRule()

A BoundaryNodeRule 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 LinearRings and closed LineStrings have an empty boundary.

This is the rule specified by the OGC SFS, and is the default rule used in JTS.

Source:

(static) RectangleLineIntersector(rectEnv)

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.

Parameters:
Name Type Description
rectEnv the query rectangle, specified as an Envelope
Author:
  • Martin Davis Creates a new intersector for the given query rectangle, specified as an Envelope.
Source: