Tabnine Logo
Geometry.covers
Code IndexAdd Tabnine to your IDE (free)

How to use
covers
method
in
com.vividsolutions.jts.geom.Geometry

Best Java code snippets using com.vividsolutions.jts.geom.Geometry.covers (Showing top 18 results out of 315)

origin: com.vividsolutions/jts

/**
 * Default implementation.
 */
public boolean covers(Geometry g)
{
 return baseGeom.covers(g);
}
origin: com.vividsolutions/jts

return g.covers(this);
origin: com.vividsolutions/jts

/**
 * Computes the full topological <tt>covers</tt> predicate.
 * Used when short-circuit tests are not conclusive.
 * 
 * @param geom the test geometry
 * @return true if this prepared polygon covers the test geometry
 */
protected boolean fullTopologicalPredicate(Geometry geom)
{
  boolean result = prepPoly.getGeometry().covers(geom);
  return result;
}
 
origin: com.vividsolutions/jts-core

/**
 * Default implementation.
 */
public boolean covers(Geometry g)
{
 return baseGeom.covers(g);
}
origin: org.geotools/gt-render

public boolean covers(Geometry g) {
  return geometry.covers(g);
}
origin: org.orbisgis/h2gis-functions

  /**
   * Returns true if no point in geometry B is outside geometry A.
   *
   * @param geomA Geometry A
   * @param geomB Geometry B
   * @return True if no point in geometry B is outside geometry A
   */
  public static Boolean covers(Geometry geomA, Geometry geomB) {
    if(geomA == null||geomB == null){
      return null;
    }
    return geomA.covers(geomB);
  }
}
origin: org.orbisgis/h2gis

  /**
   * Returns true if no point in geometry B is outside geometry A.
   *
   * @param geomA Geometry A
   * @param geomB Geometry B
   * @return True if no point in geometry B is outside geometry A
   */
  public static Boolean covers(Geometry geomA, Geometry geomB) {
    if(geomA == null||geomB == null){
      return null;
    }
    return geomA.covers(geomB);
  }
}
origin: com.vividsolutions/jts-core

return g.covers(this);
origin: DataSystemsLab/GeoSpark

  public boolean match(Geometry spatialObject, Geometry queryWindow)
  {
    if (considerBoundaryIntersection) {
      if (queryWindow.intersects(spatialObject)) { return true; }
    }
    else {
      if (queryWindow.covers(spatialObject)) { return true; }
    }
    return false;
  }
}
origin: DataSystemsLab/GeoSpark

  private boolean geoMatch(Geometry left, Geometry right)
  {
    //log.warn("Check "+left.toText()+" with "+right.toText());
    return considerBoundaryIntersection ? left.intersects(right) : left.covers(right);
  }
}
origin: com.vividsolutions/jts-core

/**
 * Computes the full topological <tt>covers</tt> predicate.
 * Used when short-circuit tests are not conclusive.
 * 
 * @param geom the test geometry
 * @return true if this prepared polygon covers the test geometry
 */
protected boolean fullTopologicalPredicate(Geometry geom)
{
  boolean result = prepPoly.getGeometry().covers(geom);
  return result;
}
 
origin: org.datasyslab/geospark

  private boolean geoMatch(Geometry left, Geometry right)
  {
    //log.warn("Check "+left.toText()+" with "+right.toText());
    return considerBoundaryIntersection ? left.intersects(right) : left.covers(right);
  }
}
origin: org.datasyslab/geospark

  public boolean match(Geometry spatialObject, Geometry queryWindow)
  {
    if (considerBoundaryIntersection) {
      if (queryWindow.intersects(spatialObject)) { return true; }
    }
    else {
      if (queryWindow.covers(spatialObject)) { return true; }
    }
    return false;
  }
}
origin: NationalSecurityAgency/datawave

public static boolean covers(Object fieldValue, String geoString) {
  Geometry otherGeom = GeometryNormalizer.parseGeometry(geoString);
  Geometry thisGeom = getGeometryFromFieldValue(fieldValue);
  return thisGeom.covers(otherGeom);
}

origin: matsim-org/matsim

if (geometry.covers(geometryFactory.createPoint(CoordUtils.createGeotoolsCoordinate(coord)))) {
  if (!measurePointPolygons.containsKey(measurePointId)) {
    measurePointPolygons.put(measurePointId, geometry);
origin: org.orbisgis/h2gis

/**
 *
 *  @param g1 Geometry instance or null
 *  @param g2 Geometry instance or null
 *  @return minimum distance in meters between two geometries
 */
private static Double distancePolygonPolygon(Geometry g1, Geometry g2) {
  Double distance = Double.MAX_VALUE;
  Double ringDistance;
  if (g1.covers(g2) || g2.covers(g1)) {
    return 0.0;
  }
  for (int i = 0; i < ((Polygon) g1).getExteriorRing().getNumPoints(); i++) {
    for (int j = 0; j < ((Polygon) g2).getExteriorRing().getNumPoints(); j++) {
      ringDistance = distancePointToPoint(((Polygon) g1).getExteriorRing().getPointN(i), ((Polygon) g2).getExteriorRing().getPointN(j));
      if (ringDistance < distance) {
        distance = ringDistance;
      }
    }
  }
  return distance;
}
origin: org.orbisgis/h2gis-functions

/**
 *
 *  @param g1 Geometry instance or null
 *  @param g2 Geometry instance or null
 *  @return minimum distance in meters between two geometries
 */
private static Double distancePolygonPolygon(Geometry g1, Geometry g2) {
  Double distance = Double.MAX_VALUE;
  Double ringDistance;
  if (g1.covers(g2) || g2.covers(g1)) {
    return 0.0;
  }
  for (int i = 0; i < ((Polygon) g1).getExteriorRing().getNumPoints(); i++) {
    for (int j = 0; j < ((Polygon) g2).getExteriorRing().getNumPoints(); j++) {
      ringDistance = distancePointToPoint(((Polygon) g1).getExteriorRing().getPointN(i), ((Polygon) g2).getExteriorRing().getPointN(j));
      if (ringDistance < distance) {
        distance = ringDistance;
      }
    }
  }
  return distance;
}
origin: org.integratedmodelling/klab-engine

public double getCoverage(Cell cell, boolean simpleIntersection) {
  checkPreparedShape();
  if (preparedShape == null) {
    if (simpleIntersection) {
      Geometry gm = makePoint(cell);
      return gm.intersects(value) ? 1.0 : 0.0;
    }
    Geometry gm = makeCell(cell.getMinX(), cell.getMinY(), cell.getMaxX(), cell
        .getMaxY());
    return gm.covers(value) ? 1.0
        : (gm.intersection(value).getArea() / gm.getArea());
  }
  if (simpleIntersection) {
    return preparedShape.covers(makePoint(cell)) ? 1 : 0;
  }
  Geometry gm = makeCell(cell.getMinX(), cell.getMinY(), cell.getMaxX(), cell
      .getMaxY());
  return preparedShape.covers(gm) ? 1.0
      : (gm.intersection(value).getArea() / gm.getArea());
}
com.vividsolutions.jts.geomGeometrycovers

Javadoc

Tests whether this geometry covers the argument geometry.

The covers predicate has the following equivalent definitions:

  • Every point of the other geometry is a point of this geometry.
  • The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns:
    • [T*****FF*]
    • [*T****FF*]
    • [***T**FF*]
    • [****T*FF*]
  • g.coveredBy(this) = true
    (covers is the converse of #coveredBy)
If either geometry is empty, the value of this predicate is false.

This predicate is similar to #contains, but is more inclusive (i.e. returns true for more cases). In particular, unlike contains it does not distinguish between points in the boundary and in the interior of geometries. For most situations, covers should be used in preference to contains. As an added benefit, covers is more amenable to optimization, and hence should be more performant.

Popular methods of Geometry

  • getEnvelopeInternal
    Gets an Envelope containing the minimum and maximum x and y values in this Geometry. If the geometr
  • getCoordinates
    Returns an array containing the values of all the vertices for this geometry. If the geometry is a c
  • isEmpty
    Tests whether the set of points covered by this Geometry is empty.
  • getCentroid
    Computes the centroid of this Geometry. The centroid is equal to the centroid of the set of componen
  • getGeometryN
    Returns an element Geometry from a GeometryCollection(or this, if the geometry is not a collection).
  • toText
    Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text
  • getNumGeometries
    Returns the number of Geometrys in a GeometryCollection(or 1, if the geometry is not a collection).
  • getFactory
    Gets the factory which contains the context in which this geometry was created.
  • getGeometryType
    Returns the name of this Geometry's actual class.
  • getSRID
    Returns the ID of the Spatial Reference System used by the Geometry. JTS supports Spatial Reference
  • getCoordinate
    Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordi
  • intersection
    Computes a Geometry representing the point-set which is common to both this Geometry and the other
  • getCoordinate,
  • intersection,
  • buffer,
  • contains,
  • getArea,
  • getEnvelope,
  • intersects,
  • union,
  • apply,
  • getLength

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now