- 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 Tabnine
}

/** * 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

- Running tasks concurrently on multiple threads
- getSupportFragmentManager (FragmentActivity)
- getContentResolver (Context)
- setRequestProperty (URLConnection)
- FileInputStream (java.io)An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
- SimpleDateFormat (java.text)Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
- Hashtable (java.util)A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
- Servlet (javax.servlet)Defines methods that all servlets must implement. A servlet is a small Java program that runs within
- Reflections (org.reflections)Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
- LoggerFactory (org.slf4j)The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
- Top 17 Free Sublime Text Plugins