Refine search
if (! getEnvelopeInternal().covers(g.getEnvelopeInternal())) return false; if (isRectangle()) { return relate(g).isCovers();
/** * Returns <code>true</code> if <code>isDisjoint</code> returns false. * *@return <code>true</code> if the two <code>Geometry</code>s related by * this <code>IntersectionMatrix</code> intersect */ public boolean isIntersects() { return ! isDisjoint(); }
if (! getEnvelopeInternal().intersects(g.getEnvelopeInternal())) return false; if (isRectangle()) { return RectangleIntersects.intersects((Polygon) this, g); return relate(g).isIntersects();
/** * Tests if each of the actual dimension symbols in a matrix string satisfies the * corresponding required dimension symbol in a pattern string. * *@param actualDimensionSymbols nine dimension symbols to validate. * Possible values are <code>{T, F, * , 0, 1, 2}</code>. *@param requiredDimensionSymbols nine dimension symbols to validate * against. Possible values are <code>{T, F, * , 0, 1, 2}</code>. *@return true if each of the required dimension * symbols encompass the corresponding actual dimension symbol */ public static boolean matches(String actualDimensionSymbols, String requiredDimensionSymbols) { IntersectionMatrix m = new IntersectionMatrix(actualDimensionSymbols); return m.matches(requiredDimensionSymbols); }
/** * Adds one matrix to another. * Addition is defined by taking the maximum dimension value of each position * in the summand matrices. * * @param im the matrix to add */ public void add(IntersectionMatrix im) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { setAtLeast(i, j, im.get(i, j)); } } }
List<Polygon> candidates = this.query(target.getEnvelopeInternal()); try matrix = target.relate(candidate); if (matrix.isWithin()) if (!matrix.isIntersects()) final Geometry clipped = target.intersection(candidate);
final List<Polygon> polygons = this.query(target.getEnvelopeInternal()); try matrix = target.relate(polygon); if (matrix.isWithin()) else if (matrix.isIntersects()) final Geometry clipped = target.intersection(polygon.getBoundary()); final String containedCountryCode = getGeometryProperty(polygon, ISOCountryTag.KEY);
if (! getEnvelopeInternal().contains(g.getEnvelopeInternal())) return false; if (isRectangle()) { return RectangleContains.contains((Polygon) this, g); return relate(g).isContains();
public IntersectionMatrix computeIM() IntersectionMatrix im = new IntersectionMatrix(); im.set(Location.EXTERIOR, Location.EXTERIOR, 2); if (! arg[0].getGeometry().getEnvelopeInternal().intersects( arg[1].getGeometry().getEnvelopeInternal()) ) { computeDisjointIM(im); return im;
public static SpatialRelation intersectionMatrixToSpatialRelation(IntersectionMatrix matrix) { //As indicated in SpatialRelation javadocs, Spatial4j CONTAINS & WITHIN are // OGC's COVERS & COVEREDBY if (matrix.isCovers()) return SpatialRelation.CONTAINS; else if (matrix.isCoveredBy()) return SpatialRelation.WITHIN; else if (matrix.isDisjoint()) return SpatialRelation.DISJOINT; return SpatialRelation.INTERSECTS; }
if (! getEnvelopeInternal().contains(g.getEnvelopeInternal())) return false; if (isRectangle()) { return RectangleContains.contains((Polygon) this, g); return relate(g).isContains();
public IntersectionMatrix computeIM() IntersectionMatrix im = new IntersectionMatrix(); im.set(Location.EXTERIOR, Location.EXTERIOR, 2); if (! arg[0].getGeometry().getEnvelopeInternal().intersects( arg[1].getGeometry().getEnvelopeInternal()) ) { computeDisjointIM(im); return im;
public static SpatialRelation intersectionMatrixToSpatialRelation(IntersectionMatrix matrix) { //As indicated in SpatialRelation javadocs, Spatial4j CONTAINS & WITHIN are // OGC's COVERS & COVEREDBY if (matrix.isCovers()) return SpatialRelation.CONTAINS; else if (matrix.isCoveredBy()) return SpatialRelation.WITHIN; else if (matrix.isDisjoint()) return SpatialRelation.DISJOINT; return SpatialRelation.INTERSECTS; }
/** * Tests if each of the actual dimension symbols in a matrix string satisfies the * corresponding required dimension symbol in a pattern string. * *@param actualDimensionSymbols nine dimension symbols to validate. * Possible values are <code>{T, F, * , 0, 1, 2}</code>. *@param requiredDimensionSymbols nine dimension symbols to validate * against. Possible values are <code>{T, F, * , 0, 1, 2}</code>. *@return true if each of the required dimension * symbols encompass the corresponding actual dimension symbol */ public static boolean matches(String actualDimensionSymbols, String requiredDimensionSymbols) { IntersectionMatrix m = new IntersectionMatrix(actualDimensionSymbols); return m.matches(requiredDimensionSymbols); }
/** * Adds one matrix to another. * Addition is defined by taking the maximum dimension value of each position * in the summand matrices. * * @param im the matrix to add */ public void add(IntersectionMatrix im) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { setAtLeast(i, j, im.get(i, j)); } } }
if (! getEnvelopeInternal().covers(g.getEnvelopeInternal())) return false; if (isRectangle()) { return relate(g).isCovers();
if (! getEnvelopeInternal().intersects(g.getEnvelopeInternal())) return false; if (isRectangle()) { return RectangleIntersects.intersects((Polygon) this, g); return relate(g).isIntersects();