- Common ways to obtain Geometry

private void myMethod () {Geometry g =

- GeometryCollection gc;gc.getGeometryN(n)
- SimpleFeature feature;(Geometry) feature.getDefaultGeometry()
- String wellKnownText;new WKTReader().read(wellKnownText)
- Smart code suggestions by Codota
}

/** * Tests whether this geometry is * topologically equal to the argument geometry. * <p> * This method is included for backward compatibility reasons. * It has been superseded by the {@link #equalsTopo(Geometry)} method, * which has been named to clearly denote its functionality. * <p> * This method should NOT be confused with the method * {@link #equals(Object)}, which implements * an exact equality comparison. * *@param g the <code>Geometry</code> with which to compare this <code>Geometry</code> *@return true if the two <code>Geometry</code>s are topologically equal * *@see #equalsTopo(Geometry) */ public boolean equals(Geometry g) { return equalsTopo(g); }

/** * Tests whether this geometry is * topologically equal to the argument geometry. * <p> * This method is included for backward compatibility reasons. * It has been superseded by the {@link #equalsTopo(Geometry)} method, * which has been named to clearly denote its functionality. * <p> * This method should NOT be confused with the method * {@link #equals(Object)}, which implements * an exact equality comparison. * *@param g the <code>Geometry</code> with which to compare this <code>Geometry</code> *@return true if the two <code>Geometry</code>s are topologically equal * *@see #equalsTopo(Geometry) */ public boolean equals(Geometry g) { if (g == null) return false; return equalsTopo(g); }

public static Boolean equals(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { return getGeometry(geom1).equalsTopo(getGeometry(geom2)); }

public static Boolean equals(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { return getGeometry(geom1).equalsTopo(getGeometry(geom2)); }

public static Boolean equals(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { return getGeometry(geom1).equalsTopo(getGeometry(geom2)); }

if (!jtsPolygon.convexHull().equalsTopo(jtsPolygon)) { errHandler.addError(ErrorSeverity.ERROR, ErrorMessage.format( ErrorMessageKeys.QUAD_NOT_CONVEX, jtsPolygon.toText()),

## Javadoc

Tests whether this geometry is topologically equal to the argument geometry
as defined by the SFS

`equals`

predicate.
The SFS `equals`

predicate has the following equivalent definitions:

- The two geometries have at least one point in common, and no point of either geometry lies in the exterior of the other geometry.
- The DE-9IM Intersection Matrix for the two geometries matches
the pattern
`T*F**FFF*`

T*F **F FF

**Note**that this method computes**topologically equality**. For structural equality, see #equalsExact(Geometry).## Popular methods of Geometry

- getEnvelopeInternalGets an Envelope containing the minimum and maximum x and y values in this Geometry. If the geometr
- getCoordinatesReturns an array containing the values of all the vertices for this geometry. If the geometry is a c
- isEmptyTests whether the set of points covered by this Geometry is empty.
- getCentroidComputes the centroid of this Geometry. The centroid is equal to the centroid of the set of componen
- getGeometryNReturns an element Geometry from a GeometryCollection(or this, if the geometry is not a collection).
- toTextReturns the Well-known Text representation of this Geometry. For a definition of the Well-known Text
- getNumGeometriesReturns the number of Geometrys in a GeometryCollection(or 1, if the geometry is not a collection).
- getFactoryGets the factory which contains the context in which this geometry was created.
- getGeometryTypeReturns the name of this Geometry's actual class.
- getSRIDReturns the ID of the Spatial Reference System used by the Geometry. JTS supports Spatial Reference
- getCoordinateReturns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordi
- intersectionComputes a Geometry representing the point-set which is common to both this Geometry and the other

## Popular in Java

- Updating database using SQL prepared statement
- findViewById (Activity)
- getApplicationContext (Context)
- getSharedPreferences (Context)
- HttpURLConnection (java.net)An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
- Scanner (java.util)A parser that parses a text string of primitive types and strings with the help of regular expressio
- SortedSet (java.util)SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
- Executor (java.util.concurrent)An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
- Get (org.apache.hadoop.hbase.client)Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
- Join (org.hibernate.mapping)