Class PreparedGeometryExample
java.lang.Object
org.locationtech.jtsexample.geom.prep.PreparedGeometryExample
Shows use of
PreparedGeometry
in a batch (repeated) operation.
The example uses a Monte Carlo method to approximate the value of Pi.
Given a circle inscribed in a square and a large number of random points
in the square, the number of points which intersect the circle approximates Pi/4.
This involves repeated Point-In-Polygon tests, which is one of the
geometry tests optimized by the PreparedGeometry implementation for polygons.- Version:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static GeometryFactory
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
geomFact
-
MAX_ITER
static final int MAX_ITER- See Also:
-
-
Constructor Details
-
PreparedGeometryExample
public PreparedGeometryExample()
-
-
Method Details
-
main
- Throws:
Exception
-
createCircle
-
createRandomPoint
-