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

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

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

origin: opentripplanner/OpenTripPlanner

/**
 * Compare to another object.
 * 
 * We can't use identity equality, because point features may be serialized and deserialized
 * and thus the same PointFeature may exist in memory more than once. For example, PointFeatures
 * are compared inside the conveyal/otpa-cluster project to figure out which origins have
 * returned from the compute cluster. 
 */
public boolean equals (Object o) {
  if (o instanceof PointFeature) {
    PointFeature f = (PointFeature) o;
    return f.lat == this.lat &&
        f.lon == this.lon &&
        (f.geom == this.geom || f.geom != null && f.geom.equals(this.geom)) &&
        (f.id == this.id || f.id != null && f.id.equals(this.id)) &&
        this.properties.equals(f.properties);
  }
  
  return false; 
}

origin: org.n52.epos/epos-pattern-util

/**
 * @param geom first geometry
 * @param g second geometry
 * @return <code>true</code> if the first geometry equals the second
 */
public static boolean equals(Geometry geom, Geometry g) {
  if  (geom == null || g == null) return false;
  return geom.equals(g);
}
origin: ryantxu/spatial-solr-sandbox

 @Override
 public boolean matches(Geometry geo) {
  return geo.equals(queryGeo);
 }
}
origin: org.orbisgis/h2spatial

  /**
   * Return true if Geometry A is equal to Geometry B
   *
   * @param a Geometry Geometry.
   * @param b Geometry instance
   * @return true if Geometry A is equal to Geometry B
   */
  public static Boolean geomEquals(Geometry a, Geometry b) {
    if(a==null || b==null) {
      return null;
    }
    return a.equals(b);
  }
}
origin: org.geotools/gt-render

public boolean equals(Object obj) {
  return geometry.equals(obj);
}
origin: org.orbisgis/h2gis-functions

  /**
   * Return true if Geometry A is equal to Geometry B
   *
   * @param a Geometry Geometry.
   * @param b Geometry instance
   * @return true if Geometry A is equal to Geometry B
   */
  public static Boolean geomEquals(Geometry a, Geometry b) {
    if(a==null || b==null) {
      return null;
    }
    return a.equals(b);
  }
}
origin: org.orbisgis/h2gis

  /**
   * Return true if Geometry A is equal to Geometry B
   *
   * @param a Geometry Geometry.
   * @param b Geometry instance
   * @return true if Geometry A is equal to Geometry B
   */
  public static Boolean geomEquals(Geometry a, Geometry b) {
    if(a==null || b==null) {
      return null;
    }
    return a.equals(b);
  }
}
origin: deegree/deegree3

@Override
public boolean equals( Geometry geometry ) {
  JTSGeometryPair jtsGeoms = JTSGeometryPair.createCompatiblePair( this, geometry );
  return jtsGeoms.first.equals( jtsGeoms.second );
}
origin: org.datasyslab/geospark

@Override
public boolean equalsExact(Geometry g, double tolerance)
{
  String type1 = this.getGeometryType();
  String type2 = ((Geometry) g).getGeometryType();
  double radius1 = this.radius;
  double radius2 = ((Circle) g).radius;
  if (type1 != type2) { return false; }
  if (radius1 != radius2) { return false; }
  return this.centerGeometry.equals(((Circle) g).centerGeometry);
}
origin: DataSystemsLab/GeoSpark

@Override
public boolean equalsExact(Geometry g, double tolerance)
{
  String type1 = this.getGeometryType();
  String type2 = ((Geometry) g).getGeometryType();
  double radius1 = this.radius;
  double radius2 = ((Circle) g).radius;
  if (type1 != type2) { return false; }
  if (radius1 != radius2) { return false; }
  return this.centerGeometry.equals(((Circle) g).centerGeometry);
}
origin: BaseXdb/basex

 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return Bln.get(checkGeo(0, qc).equals(checkGeo(1, qc)));
 }
}
origin: org.geotools/gt2-main

/**
 * Compares two geometries for equality.
 */
protected void assertEquals(Geometry expected, Geometry actual) {
  if (expected == actual) {
    return;
  }
  assertNotNull(expected);
  assertNotNull(actual);
  assertTrue(expected.equals(actual));
}
origin: org.geotools/gt2-main

/**
 * Compares two geometries for equality.
 */
protected void assertEquals(String message, Geometry expected, Geometry actual) {
  if (expected == actual) {
    return;
  }
  assertNotNull(message, expected);
  assertNotNull(message, actual);
  assertTrue(message, expected.equals(actual));
}
origin: org.geotools/gt-process-feature

public ClippingFeatureIterator(SimpleFeatureIterator delegate, Geometry clip,
    SimpleFeatureType schema) {
  this.delegate = delegate;
  
  // can we use the fast clipper?
  if(clip.getEnvelope().equals(clip)) {
    this.clipper = new GeometryClipper(clip.getEnvelopeInternal());
  } else {
    this.clip = clip;
  }
    
  fb = new SimpleFeatureBuilder(schema);
}
origin: mapplus/spatial_statistics_for_geotools_udig

public ClipWithGeometryFeatureIterator(SimpleFeatureIterator delegate, Geometry clip,
    SimpleFeatureType schema) {
  this.delegate = delegate;
  // can we use the fast clipper?
  if (clip.getEnvelope().equals(clip)) {
    this.clipper = new GeometryClipper(clip.getEnvelopeInternal());
  } else {
    this.clip = clip;
  }
  builder = new SimpleFeatureBuilder(schema);
}
origin: org.orbisgis/h2gis-functions

/**
 * Return the max distance
 *
 * @return
 */
public Double getDistance() {
  if (geomA == null || geomB == null) {
    return null;
  }
  if (geomA.isEmpty() || geomB.isEmpty()) {
    return 0.0;
  }
  if (geomA.equals(geomB)) {
    sameGeom = true;
  }
  if (maxDistanceFilter == null) {
    computeMaxDistance();
  }
  return maxDistanceFilter.getDistance();
}
origin: org.geotools/gt2-main

public boolean evaluate(Object feature) {
  if (feature instanceof Feature && !validate((Feature)feature))
    return false;
  Geometry left = getLeftGeometry(feature);
  Geometry right = getRightGeometry(feature);
  Envelope envLeft = left.getEnvelopeInternal();
  Envelope envRight = right.getEnvelopeInternal();
  if (envRight.equals(envLeft))
    return left.equals(right);
  else
    return false;
}
origin: org.n52.shetland/shetland

@Override
public boolean equals(Object obj) {
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final ProfileLevel other = (ProfileLevel) obj;
  if ((getLevelStart() == null) ? (other.getLevelStart() != null)
      : !getLevelStart().equals(other.getLevelStart())) {
    return false;
  }
  if ((getLevelEnd() == null) ? (other.getLevelEnd() != null) : !getLevelEnd().equals(other.getLevelEnd())) {
    return false;
  }
  if ((getLocation() == null) ? (other.getLocation() != null) : !getLocation().equals(other.getLocation())) {
    return false;
  }
  return super.equals(obj);
}
origin: org.n52.shetland/shetland

private boolean checkSamplingGeometry(ObservationMergeIndicator indicator, OmObservation observation) {
  return !indicator.isSamplingGeometry()
      || (isSetSpatialFilteringProfileParameter() && observation.isSetSpatialFilteringProfileParameter()
          && getSpatialFilteringProfileParameter().getValue().getValue()
              .equals(observation.getSpatialFilteringProfileParameter().getValue().getValue()));
}
origin: org.geoserver.script/gs-script-core

public void testRun() throws Exception {
  ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
  Name buffer = pf.getNames().iterator().next();
  assertEquals(getNamespace(), buffer.getNamespaceURI());
  assertEquals(getProcessName(), buffer.getLocalPart());
  org.geotools.process.Process p = pf.create(buffer);
  Geometry g = new WKTReader().read("POINT(0 0)");
  Map inputs = new HashMap();
  inputs.put("geom", g);
  inputs.put("distance", 1);
  Map outputs = p.execute(inputs, null);
  Geometry h = (Geometry) outputs.get("result");
  assertTrue(h.equals(g.buffer(1)));
}
com.vividsolutions.jts.geomGeometryequals

Javadoc

Tests whether this geometry is topologically equal to the argument geometry.

This method is included for backward compatibility reasons. It has been superseded by the #equalsTopo(Geometry) method, which has been named to clearly denote its functionality.

This method should NOT be confused with the method #equals(Object), which implements an exact equality comparison.

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

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • getContentResolver (Context)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Option (scala)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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