| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
package org.locationtech.jts.geom.prep; |
| 13 |
|
| 14 |
import org.locationtech.jts.geom.Geometry; |
| 15 |
import org.locationtech.jts.geom.Puntal; |
| 16 |
|
| 17 |
|
| 18 |
/** |
| 19 |
* A prepared version for {@link Puntal} geometries. |
| 20 |
* <p> |
| 21 |
* Instances of this class are thread-safe. |
| 22 |
* |
| 23 |
* @author Martin Davis |
| 24 |
* |
| 25 |
*/ |
| 26 |
public class PreparedPoint |
| 27 |
extends BasicPreparedGeometry |
| 28 |
{ |
| 29 |
public PreparedPoint(Puntal point) { |
| 30 |
super((Geometry) point); |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* Tests whether this point intersects a {@link Geometry}. |
| 35 |
* <p> |
| 36 |
* The optimization here is that computing topology for the test geometry |
| 37 |
* is avoided. This can be significant for large geometries. |
| 38 |
*/ |
| 39 |
public boolean intersects(Geometry g) |
| 40 |
{ |
| 41 |
if (! envelopesIntersect(g)) return false; |
| 42 |
|
| 43 |
/** |
| 44 |
* This avoids computing topology for the test geometry |
| 45 |
*/ |
| 46 |
return isAnyTargetComponentInTest(g); |
| 47 |
} |
| 48 |
} |
| 49 |
|