Class IntersectionIndex.Options
- Enclosing class:
- IntersectionIndex
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
long
Any geometries with more points than this is too complexdouble
Any geometries with more than cutMinPoints is too complex if the ratio of their area to their bounding box is less thancutRatio
.long
Any geometries with more points than this and a larger cutRatio is too complexlong
An optional width/height to target for complexity.int
hashCode()
boolean
Whether to optimize this index by cutting up complex geometries for faster point lookups.boolean
isTooComplex
(org.locationtech.jts.geom.Geometry geom, org.locationtech.jts.geom.Envelope geomEnvelope) Heuristic for deciding if geometry is 'too complex' to put in the index.void
setCutBeforeAdding
(boolean cutBeforeAdding) Whether to optimize this index by cutting up complex geometries for faster point lookups.void
setCutPoints
(long cutPoints) Any geometries with more points than this is too complexvoid
setCutRatio
(double cutRatio) Any geometries with more than cutMinPoints is too complex if the ratio of their area to their bounding box is less thancutRatio
.void
setCutRatioPoints
(long cutRatioPoints) Any geometries with more points than this and a larger cutRatio is too complexvoid
setCutSizeMapUnits
(long cutSizeMapUnits) An optional width/height to target for complexity.toString()
-
Constructor Details
-
Options
public Options()
-
-
Method Details
-
isTooComplex
public boolean isTooComplex(org.locationtech.jts.geom.Geometry geom, org.locationtech.jts.geom.Envelope geomEnvelope) Heuristic for deciding if geometry is 'too complex' to put in the index. We use this to decide whether to cut it up before adding it (as well as computing the true intersection for points later)
-
isCutBeforeAdding
public boolean isCutBeforeAdding()Whether to optimize this index by cutting up complex geometries for faster point lookups. This optimization cuts up the indexed geometry recursively in to quads, until all the constituent parts are no longer "too complex" according to the indexes given options. Note that this option can have a slight detrimental affect on the performance of sampling polygonal features against the index.
This improves performance by excluding large areas of these indexed geometries before they go in to the index, so that each feature's indexed "hitbox" is smaller, meaning less false positives in the index. This reduces the number of times the index returns a hit, only for the later, more computationally expensive, intersection test to fail.
As a further optimization, point intersections can be done against the cut geometry, instead of the larger source geometry, which runs quicker against smaller (in terms of points) features.
This feature will increase the amount of memory used by the index. Tuning the other options may help reach a compromise between memory usage and performance - the defaults are meant to be a good compromise.
-
getCutPoints
public long getCutPoints()Any geometries with more points than this is too complex
-
getCutRatioPoints
public long getCutRatioPoints()Any geometries with more points than this and a larger cutRatio is too complex
-
getCutRatio
public double getCutRatio()Any geometries with more than cutMinPoints is too complex if the ratio of their area to their bounding box is less than
cutRatio
. This is a measure of the 'efficiency' of the bounding box as an index key; The higher the ratio, the more chance that a bounding box hit will also intersect with the indexed geometry. -
getCutSizeMapUnits
public long getCutSizeMapUnits()An optional width/height to target for complexity. When this option is set, this takes precedence over all other options. It defines the size of the geometry as being the (width + height) / 2. Note that it won't do any reprojection if your geometries are not metric.
-
setCutBeforeAdding
public void setCutBeforeAdding(boolean cutBeforeAdding) Whether to optimize this index by cutting up complex geometries for faster point lookups. This optimization cuts up the indexed geometry recursively in to quads, until all the constituent parts are no longer "too complex" according to the indexes given options. Note that this option can have a slight detrimental affect on the performance of sampling polygonal features against the index.
This improves performance by excluding large areas of these indexed geometries before they go in to the index, so that each feature's indexed "hitbox" is smaller, meaning less false positives in the index. This reduces the number of times the index returns a hit, only for the later, more computationally expensive, intersection test to fail.
As a further optimization, point intersections can be done against the cut geometry, instead of the larger source geometry, which runs quicker against smaller (in terms of points) features.
This feature will increase the amount of memory used by the index. Tuning the other options may help reach a compromise between memory usage and performance - the defaults are meant to be a good compromise.
-
setCutPoints
public void setCutPoints(long cutPoints) Any geometries with more points than this is too complex
-
setCutRatioPoints
public void setCutRatioPoints(long cutRatioPoints) Any geometries with more points than this and a larger cutRatio is too complex
-
setCutRatio
public void setCutRatio(double cutRatio) Any geometries with more than cutMinPoints is too complex if the ratio of their area to their bounding box is less than
cutRatio
. This is a measure of the 'efficiency' of the bounding box as an index key; The higher the ratio, the more chance that a bounding box hit will also intersect with the indexed geometry. -
setCutSizeMapUnits
public void setCutSizeMapUnits(long cutSizeMapUnits) An optional width/height to target for complexity. When this option is set, this takes precedence over all other options. It defines the size of the geometry as being the (width + height) / 2. Note that it won't do any reprojection if your geometries are not metric.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-