NetTopologySuite
|
A representation of a planar, linear vector geometry. More...
Public Member Functions | |
abstract double[] | GetOrdinates (Ordinate ordinate) |
Gets an array of System.Double ordinate values More... | |
virtual IGeometry | GetGeometryN (int n) |
Returns an element Geometry from a GeometryCollection, or More... | |
double | Distance (IGeometry g) |
Returns the minimum distance between this Geometry and another Geometry g. More... | |
bool | IsWithinDistance (IGeometry geom, double distance) |
Tests whether the distance from this Geometry to another is less than or equal to a specified value. More... | |
void | GeometryChanged () |
Notifies this geometry that its coordinates have been changed by an external party (for example, via a ICoordinateFilter). More... | |
void | GeometryChangedAction () |
Notifies this Geometry that its Coordinates have been changed by an external party. When GeometryChanged is called, this method will be called for this Geometry and its component Geometries. More... | |
bool | Disjoint (IGeometry g) |
Tests whether this geometry is disjoint from the argument geometry. More... | |
bool | Touches (IGeometry g) |
Tests whether this geometry touches the argument geometry More... | |
bool | Intersects (IGeometry g) |
Tests whether this geometry intersects the argument geometry. /summary> More... | |
bool | Crosses (IGeometry g) |
bool | Within (IGeometry g) |
Tests whether this geometry is within the specified geometry. More... | |
bool | Contains (IGeometry g) |
bool | Overlaps (IGeometry g) |
Tests whether this geometry overlaps the specified geometry. More... | |
bool | Covers (IGeometry g) |
Tests whether this geometry covers the argument geometry More... | |
bool | CoveredBy (IGeometry g) |
bool | Relate (IGeometry g, string intersectionPattern) |
IntersectionMatrix | Relate (IGeometry g) |
Returns the DE-9IM intersection matrix for the two Geometry s. More... | |
bool | Equals (IGeometry g) |
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
method, which has been named to clearly denote its functionality. This method should NOT be confused with the method
, which implements an exact equality comparison. More... | |
bool | EqualsTopologically (IGeometry g) |
Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS Equals predicate. More... | |
override bool | Equals (Object o) |
Tests whether this geometry is structurally and numerically equal to a given Object . More... | |
override int | GetHashCode () |
Gets a hash code for the Geometry. More... | |
override string | ToString () |
Returns the Well-known Text representation of this Geometry . For a definition of the Well-known Text format, see the OpenGIS Simple Features Specification. More... | |
string | ToText () |
Returns the Well-known Text representation of this Geometry . For a definition of the Well-known Text format, see the OpenGIS Simple Features Specification. More... | |
string | AsText () |
ToText More... | |
byte[] | ToBinary () |
Returns the Well-known Binary representation of this Geometry . For a definition of the Well-known Binary format, see the OpenGIS Simple Features Specification. More... | |
byte[] | AsBinary () |
ToBinary More... | |
XmlReader | ToGMLFeature () |
Returns the feature representation as GML 2.1.1 XML document. This XML document is based on Geometry.xsd schema. NO features or XLink are implemented here! More... | |
IGeometry | Buffer (double distance) |
Computes a buffer area around this geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance) . More... | |
IGeometry | Buffer (double distance, BufferStyle endCapStyle) |
Computes a buffer region around this Geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance) . More... | |
IGeometry | Buffer (double distance, EndCapStyle endCapStyle) |
Computes a buffer region around this Geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance) . More... | |
IGeometry | Buffer (double distance, int quadrantSegments) |
Computes a buffer region around this Geometry having the given width and with a specified accuracy of approximation for circular arcs. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance . Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation. More... | |
IGeometry | Buffer (double distance, int quadrantSegments, BufferStyle endCapStyle) |
Computes a buffer region around this Geometry having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance . Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation. More... | |
IGeometry | Buffer (double distance, int quadrantSegments, EndCapStyle endCapStyle) |
Computes a buffer region around this Geometry having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance . Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation. More... | |
IGeometry | Buffer (double distance, IBufferParameters bufferParameters) |
Computes a buffer region around this Geometry having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance . Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation. More... | |
virtual IGeometry | ConvexHull () |
Returns the smallest convex Polygon that contains all the points in the Geometry . This obviously applies only to Geometry s which contain 3 or more points. More... | |
abstract IGeometry | Reverse () |
IGeometry | Intersection (IGeometry other) |
Computes a Geometry representing the point-set which is common to both this Geometry and the other Geometry. The intersection of two geometries of different dimension produces a result geometry of dimension less than or equal to the minimum dimension of the input geometries. The result geometry may be a heterogenous IGeometryCollection. If the result is empty, it is an atomic geometry with the dimension of the lowest input dimension. Intersection of IGeometryCollections is supported only for homogeneous collection types. Non-empty heterogeneous IGeometryCollection arguments are not supported. More... | |
IGeometry | Union (IGeometry other) |
Computes a Geometry representing the point-set which is contained in both this Geometry and the other Geometry. More... | |
IGeometry | Difference (IGeometry other) |
Computes a Geometry representing the closure of the point-set of the points contained in this Geometry that are not contained in the other Geometry. If the result is empty, it is an atomic geometry with the dimension of the left-hand input. Non-empty IGeometryCollection arguments are not supported. More... | |
IGeometry | SymmetricDifference (IGeometry other) |
Computes a Geometry representing the closure of the point-set which is the union of the points in this Geometry which are not contained in the other Geometry, with the points in the other Geometry not contained in this Geometry . If the result is empty, it is an atomic geometry with the dimension of the highest input dimension. Non-empty IGeometryCollection arguments are not supported. More... | |
IGeometry | Union () |
Computes the union of all the elements of this geometry. More... | |
abstract bool | EqualsExact (IGeometry other, double tolerance) |
Returns true if the two Geometry s are exactly equal, up to a specified tolerance. Two Geometries are exactly within a tolerance equal if:
This method does not test the values of the | |
bool | EqualsExact (IGeometry other) |
Returns true if the two Geometry s are exactly equal. Two Geometries are exactly equal if:
This provides a stricter test of equality than EqualsTopologically, which is more useful in certain situations (such as using geometries as keys in collections). This method does not test the values of the | |
bool | EqualsNormalized (IGeometry g) |
Tests whether two geometries are exactly equal in their normalized forms. More... | |
abstract void | Apply (ICoordinateFilter filter) |
Performs an operation with or on this Geometry 's coordinates. More... | |
abstract void | Apply (ICoordinateSequenceFilter filter) |
abstract void | Apply (IGeometryFilter filter) |
Performs an operation with or on this Geometry and its subelement Geometry s (if any). Only GeometryCollections and subclasses have subelement Geometry's. More... | |
abstract void | Apply (IGeometryComponentFilter filter) |
Performs an operation with or on this Geometry and its component Geometry's. Only GeometryCollections and Polygons have component Geometry's; for Polygons they are the LinearRings of the shell and holes. More... | |
virtual object | Clone () |
abstract void | Normalize () |
Converts this Geometry to normal form (or canonical form ). More... | |
IGeometry | Normalized () |
Creates a new Geometry which is a normalized copy of this Geometry. More... | |
int | CompareTo (object o) |
Returns whether this Geometry is greater than, equal to, or less than another Geometry . More... | |
int | CompareTo (IGeometry geom) |
Returns whether this Geometry is greater than, equal to, or less than another Geometry . More... | |
int | CompareTo (Object o, IComparer< ICoordinateSequence > comp) |
Returns whether this Geometry is greater than, equal to, or less than another Geometry , using the given . More... | |
Static Public Member Functions | |
static bool | HasNullElements (object[] array) |
Returns true if the array contains any null elements. More... | |
static bool | operator== (Geometry obj1, IGeometry obj2) |
static bool | operator!= (Geometry obj1, IGeometry obj2) |
Static Public Attributes | |
static readonly IGeometryFactory | DefaultFactory = GeometryFactory.Default |
A predefined GeometryFactory with PrecisionModel == PrecisionModels.Fixed. More... | |
Protected Member Functions | |
Geometry (IGeometryFactory factory) | |
Creates a new Geometry via the specified GeometryFactory. More... | |
virtual bool | IsEquivalentClass (IGeometry other) |
Returns whether the two Geometry s are equal, from the point of view of the EqualsExact method. Called by EqualsExact . In general, two Geometry classes are considered to be "equivalent" only if they are the same class. An exception is LineString , which is considered to be equivalent to its subclasses. More... | |
void | CheckNotGeometryCollection (IGeometry g) |
Throws an exception if g 's class is GeometryCollection . (its subclasses do not trigger an exception). More... | |
abstract Envelope | ComputeEnvelopeInternal () |
Returns the minimum and maximum x and y values in this Geometry , or a null Envelope if this Geometry is empty. Unlike EnvelopeInternal , this method calculates the Envelope each time it is called; EnvelopeInternal caches the result of this method. More... | |
Static Protected Member Functions | |
static bool | HasNonEmptyElements (IGeometry[] geometries) |
Returns true if the array contains any non-empty Geometry s. More... | |
static int | Compare (List< IGeometry > a, List< IGeometry > b) |
Returns the first non-zero result of CompareTo encountered as the two Collection s are iterated over. If, by the time one of the iterations is complete, no non-zero result has been encountered, returns 0 if the other iteration is also complete. If b completes before a , a positive number is returned; if a before b, a negative number. More... | |
static bool | Equal (Coordinate a, Coordinate b, double tolerance) |
static double[] | CreateArray (int size, double value) |
static double[] | CreateArray (ICoordinateSequence sequence, Ordinate ordinate) |
Properties | |
IGeometryFactory | Factory [get] |
Gets the factory which contains the context in which this point was created. More... | |
object | UserData [get, set] |
Gets/Sets the user data object for this point, if any. More... | |
int | SRID [get, set] |
Sets the ID of the Spatial Reference System used by the Geometry . More... | |
abstract string | GeometryType [get] |
Returns the name of this Geometry's actual class. More... | |
abstract OgcGeometryType | OgcGeometryType [get] |
Gets the OGC geometry type More... | |
IPrecisionModel | PrecisionModel [get] |
Returns the PrecisionModel used by the Geometry . More... | |
abstract Coordinate | Coordinate [get] |
Returns a vertex of this Geometry (usually, but not necessarily, the first one). More... | |
abstract Coordinate[] | Coordinates [get] |
Returns an array containing the values of all the vertices for this geometry. More... | |
abstract int | NumPoints [get] |
Returns the count of this Geometry s vertices. The Geometry s contained by composite Geometry s must be Geometry's; that is, they must implement NumPoints . More... | |
virtual int | NumGeometries [get] |
Returns the number of Geometryes in a GeometryCollection, or 1, if the geometry is not a collection. More... | |
bool | IsSimple [get] |
Tests whether this IGeometry is simple. The SFS definition of simplicity follows the general rule that a Geometry is simple if it has no points of self-tangency, self-intersection or other anomalous points. Simplicity is defined for each IGeometry subclass as follows:
| |
virtual bool | IsValid [get] |
Tests whether this Geometry is topologically valid, according to the OGC SFS specification.For validity rules see the documentation for the specific geometry subclass. More... | |
abstract bool | IsEmpty [get] |
Tests whether the set of points covered in this Geometry is empty. More... | |
virtual double | Area [get] |
Returns the area of this Geometry . Areal Geometries have a non-zero area. They override this function to compute the area. Others return 0.0 More... | |
virtual double | Length [get] |
Returns the length of this Geometry . Linear geometries return their length. Areal geometries return their perimeter. They override this function to compute the length. Others return 0.0 More... | |
IPoint | Centroid [get] |
Computes the centroid of this Geometry . The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid). The centroid of an empty geometry is POINT EMPTY . More... | |
IPoint | InteriorPoint [get] |
Computes an interior point of this Geometry . More... | |
IPoint | PointOnSurface [get] |
InteriorPoint More... | |
virtual Dimension | Dimension [get, set] |
Returns the dimension of this geometry. More... | |
virtual IGeometry | Boundary [get, set] |
Returns the boundary, or an empty geometry of appropriate dimension if this Geometry is empty. For a discussion of this function, see the OpenGIS Simple Features Specification. As stated in SFS Section 2.1.13.1, "the boundary
of a Geometry is a set of Geometries of the next lower dimension." More... | |
virtual Dimension | BoundaryDimension [get, set] |
Returns the dimension of this Geometry s inherent boundary. More... | |
IGeometry | Envelope [get] |
Gets a geometry representing the envelope (bounding box) of this Geometry . More... | |
Envelope | EnvelopeInternal [get] |
Gets an GeoAPI.Geometries.Envelope containing the minimum and maximum x and y values in this Geometry . If the geometry is empty, an empty Envelope is returned. More... | |
bool | IsGeometryCollection [get] |
virtual bool | IsRectangle [get] |
A representation of a planar, linear vector geometry.
Because it is not clear at this time what semantics for spatial analysis methods involving GeometryCollection
s would be useful, GeometryCollection
s are not supported as arguments to binary predicates or the Relate
method.
The spatial analysis methods will return the most specific class possible to represent the result. If the result is homogeneous, a Point
, LineString
, or Polygon
will be returned if the result contains a single element; otherwise, a MultiPoint
, MultiLineString
, or MultiPolygon
will be returned. If the result is heterogeneous a GeometryCollection
will be returned.
Representation of Computed Geometries: The SFS states that the result of a set-theoretic method is the "point-set" result of the usual set-theoretic definition of the operation (SFS 3.2.21.1). However, there are sometimes many ways of representing a point set as a Geometry
. The SFS does not specify an unambiguous representation of a given point set returned from a spatial analysis method. One goal of NTS is to make this specification precise and unambiguous. NTS uses a canonical form for Geometry
s returned from overlay methods. The canonical form is a Geometry
which is simple and noded: Simple means that the Geometry returned will be simple according to the NTS definition of IsSimple
. Noded applies only to overlays involving LineString
s. It means that all intersection points on LineString
s will be present as endpoints of LineString
s in the result. This definition implies that non-simple geometries which are arguments to spatial analysis methods must be subjected to a line-dissolve process to ensure that the results are simple.
Constructed Points And The Precision Model: The results computed by the set-theoretic methods may contain constructed points which are not present in the input Geometry
s. These new points arise from intersections between line segments in the edges of the input Geometry
s. In the general case it is not possible to represent constructed points exactly. This is due to the fact that the coordinates of an intersection point may contain twice as many bits of precision as the coordinates of the input line segments. In order to represent these constructed points explicitly, NTS must truncate them to fit the PrecisionModel
. Unfortunately, truncating coordinates moves them slightly. Line segments which would not be coincident in the exact result may become coincident in the truncated representation. This in turn leads to "topology collapses" – situations where a computed element has a lower dimension than it would in the exact result. When NTS detects topology collapses during the computation of spatial analysis methods, it will throw an exception. If possible the exception will report the location of the collapse.
There are two ways of comparing geometries for equality: structural equality and topological equality.
Structural Equality is provided by the EqualsExact(IGeometry) method. This implements a comparison based on exact, structural pointwise equality. The Equals(object) is a synonym for this method, to provide structural equality semantics for use in collections. It is important to note that structural pointwise equality is easily affected by things like ring order and component order. In many situations it will be desirable to normalize geometries before comparing them (using the Normalized() or Normalize() methods). EqualsNormalized(IGeometry) is provided as a convenience method to compute equality over normalized geometries, but it is expensive to use. Finally, EqualsExact(IGeometry, double) allows using a tolerance value for point comparison.
Topological Equality is provided by the EqualsTopologically(IGeometry) method. It implements the SFS definition of point-set equality defined in terms of the DE-9IM matrix. To support the SFS naming convention, the method Equals(IGeometry) is also provided as a synonym. However, due to the potential for confusion with Equals(object) its use is discouraged.
Since Equals(object) and GetHashCode are overridden, Geometries can be used effectively in .Net collections.
|
protected |
Creates a new Geometry
via the specified GeometryFactory.
factory | The factory |
|
pure virtual |
Performs an operation with or on this Geometry
's coordinates.
If this method modifies any coordinate values, GeometryChanged must be called to update the geometry state. Note that you cannot use this method to modify this Geometry if its underlying CoordinateSequence's #get method returns a copy of the Coordinate, rather than the actual Coordinate stored (if it even stores Coordinate objects at all).
filter | The filter to apply to this Geometry 's coordinates |
summary> Performs an operation on the coordinates in this Geometry
's ICoordinateSequences.
If the filter reports that a coordinate value has been changed, GeometryChanged will be called automatically. /remarks>
filter | The filter to apply |
Implemented in NetTopologySuite.Geometries.Polygon, NetTopologySuite.Geometries.LineString, NetTopologySuite.Geometries.GeometryCollection, and NetTopologySuite.Geometries.Point.
|
pure virtual |
Performs an operation with or on this Geometry
and its subelement Geometry
s (if any). Only GeometryCollections and subclasses have subelement Geometry's.
filter | The filter to apply to this Geometry (and its children, if it is a GeometryCollection ). |
Implemented in NetTopologySuite.Geometries.Polygon, NetTopologySuite.Geometries.LineString, NetTopologySuite.Geometries.GeometryCollection, and NetTopologySuite.Geometries.Point.
|
pure virtual |
Performs an operation with or on this Geometry and its component Geometry's. Only GeometryCollections and Polygons have component Geometry's; for Polygons they are the LinearRings of the shell and holes.
filter | The filter to apply to this Geometry . |
Implemented in NetTopologySuite.Geometries.Polygon, NetTopologySuite.Geometries.LineString, NetTopologySuite.Geometries.GeometryCollection, and NetTopologySuite.Geometries.Point.
byte [] NetTopologySuite.Geometries.Geometry.AsBinary | ( | ) |
string NetTopologySuite.Geometries.Geometry.AsText | ( | ) |
IGeometry NetTopologySuite.Geometries.Geometry.Buffer | ( | double | distance | ) |
Computes a buffer area around this geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance)
.
Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The buffer geometry is constructed using 8 segments per quadrant to approximate the circular arcs.
The end cap style is BufferStyle.CapRound
.
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty IPolygonal. This is also the result for the buffers of degenerate (zero-area) polygons.
distance | The width of the buffer (may be positive, negative or 0), interpreted according to the PrecisionModel of the Geometry . |
TopologyException | If a robustness error occurs |
IGeometry NetTopologySuite.Geometries.Geometry.Buffer | ( | double | distance, |
BufferStyle | endCapStyle | ||
) |
Computes a buffer region around this Geometry
having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance)
.
The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty IPolygonal.
distance | The width of the buffer, interpreted according to the PrecisionModel of the Geometry . |
endCapStyle | Cap Style to use for compute buffer. |
TopologyException | If a robustness error occurs |
IGeometry NetTopologySuite.Geometries.Geometry.Buffer | ( | double | distance, |
EndCapStyle | endCapStyle | ||
) |
Computes a buffer region around this Geometry
having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius Abs(distance)
.
The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty IPolygonal.
distance | The width of the buffer, interpreted according to the PrecisionModel of the Geometry . |
endCapStyle | Cap Style to use for compute buffer. |
TopologyException | If a robustness error occurs |
IGeometry NetTopologySuite.Geometries.Geometry.Buffer | ( | double | distance, |
int | quadrantSegments | ||
) |
Computes a buffer region around this Geometry
having the given width and with a specified accuracy of approximation for circular arcs. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance
. Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation.
Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The quadrantSegments
argument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circle
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty IPolygonal. This is also the result for the buffers of degenerate (zero-area) polygons.
distance | The width of the buffer (may be positive, negative or 0), interpreted according to the PrecisionModel of the Geometry . |
quadrantSegments | The number of segments to use to approximate a quadrant of a circle. |
TopologyException | If a robustness error occurs |
IGeometry NetTopologySuite.Geometries.Geometry.Buffer | ( | double | distance, |
int | quadrantSegments, | ||
BufferStyle | endCapStyle | ||
) |
Computes a buffer region around this Geometry
having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance
. Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation.
Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The quadrantSegments
argument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circle
The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty IPolygonal. This is also the result for the buffers of degenerate (zero-area) polygons.
distance | The width of the buffer, interpreted according to the PrecisionModel of the Geometry . |
quadrantSegments | The number of segments to use to approximate a quadrant of a circle. |
endCapStyle | Cap Style to use for compute buffer. |
TopologyException | If a robustness error occurs |
IGeometry NetTopologySuite.Geometries.Geometry.Buffer | ( | double | distance, |
int | quadrantSegments, | ||
EndCapStyle | endCapStyle | ||
) |
Computes a buffer region around this Geometry
having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance
. Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation.
Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The quadrantSegments
argument allows controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circle
The end cap style specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty IPolygonal. This is also the result for the buffers of degenerate (zero-area) polygons.
distance | The width of the buffer, interpreted according to the PrecisionModel of the Geometry . |
quadrantSegments | The number of segments to use to approximate a quadrant of a circle. |
endCapStyle | Cap Style to use for compute buffer. |
TopologyException | If a robustness error occurs |
IGeometry NetTopologySuite.Geometries.Geometry.Buffer | ( | double | distance, |
IBufferParameters | bufferParameters | ||
) |
Computes a buffer region around this Geometry
having the given width and with a specified number of segments used to approximate curves. The buffer of a Geometry is the Minkowski sum of the Geometry with a disc of radius distance
. Curves in the buffer polygon are approximated with line segments. This method allows specifying the accuracy of that approximation.
Mathematically-exact buffer area boundaries can contain circular arcs. To represent these arcs using linear geometry they must be approximated with line segments. The bufferParameters
argument has a property QuadrantSegments
controlling the accuracy of the approximation by specifying the number of line segments used to represent a quadrant of a circle
The EndCapStyle
property of the bufferParameters
argument specifies the buffer geometry that will be created at the ends of linestrings. The styles provided are:
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty IPolygonal. This is also the result for the buffers of degenerate (zero-area) polygons.
distance | The width of the buffer, interpreted according to the PrecisionModel of the Geometry . |
bufferParameters | This argument type has a number of properties that control the construction of the buffer, including QuadrantSegments , EndCapStyle , JoinStyle , and MitreLimit |
TopologyException | If a robustness error occurs |
|
protected |
Throws an exception if g
's class is GeometryCollection
. (its subclasses do not trigger an exception).
g | The Geometry to check. |
ArgumentException | if g is a GeometryCollection , but not one of its subclasses. |
|
virtual |
|
staticprotected |
Returns the first non-zero result of CompareTo
encountered as the two Collection
s are iterated over. If, by the time one of the iterations is complete, no non-zero result has been encountered, returns 0 if the other iteration is also complete. If b
completes before a
, a positive number is returned; if a before b, a negative number.
a | A Collection of IComparable s. |
b | A Collection of IComparable s. |
compareTo
result, if any; otherwise, zero.int NetTopologySuite.Geometries.Geometry.CompareTo | ( | object | o | ) |
Returns whether this Geometry
is greater than, equal to, or less than another Geometry
.
If their classes are different, they are compared using the following ordering:
If the two Geometry
s have the same class, their first elements are compared. If those are the same, the second elements are compared, etc.
o
, as defined in "Normal Form For Geometry" in the NTS Technical Specifications. int NetTopologySuite.Geometries.Geometry.CompareTo | ( | IGeometry | geom | ) |
Returns whether this Geometry
is greater than, equal to, or less than another Geometry
.
If their classes are different, they are compared using the following ordering:
If the two Geometry
s have the same class, their first elements are compared. If those are the same, the second elements are compared, etc.
o
, as defined in "Normal Form For Geometry" in the NTS Technical Specifications. int NetTopologySuite.Geometries.Geometry.CompareTo | ( | Object | o, |
IComparer< ICoordinateSequence > | comp | ||
) |
Returns whether this Geometry
is greater than, equal to, or less than another Geometry
, using the given .
If their classes are different, they are compared using the following ordering:
If the two Geometry
s have the same class, their first elements are compared. If those are the same, the second elements are compared, etc.
o
, as defined in "Normal Form For Geometry" in the NTS Technical Specifications.
|
protectedpure virtual |
Returns the minimum and maximum x and y values in this Geometry
, or a null Envelope
if this Geometry
is empty. Unlike EnvelopeInternal
, this method calculates the Envelope
each time it is called; EnvelopeInternal
caches the result of this method.
Implemented in NetTopologySuite.Geometries.GeometryCollection, NetTopologySuite.Geometries.Polygon, NetTopologySuite.Geometries.LineString, and NetTopologySuite.Geometries.Point.
bool NetTopologySuite.Geometries.Geometry.Contains | ( | IGeometry | g | ) |
|
virtual |
Returns the smallest convex Polygon
that contains all the points in the Geometry
. This obviously applies only to Geometry
s which contain 3 or more points.
Geometry
's points.summary> Computes a new geometry which has all component coordinate sequences in reverse order (opposite orientation) to this one. /summary>
Reimplemented in NetTopologySuite.Geometries.Polygon.
bool NetTopologySuite.Geometries.Geometry.CoveredBy | ( | IGeometry | g | ) |
summary> Tests whether the elements in the DE-9IM IntersectionMatrix for the two Geometry
s match the elements in intersectionPattern
.
The pattern is a 9-character string, with symbols drawn from the following set:
>0 (dimension 0) item>1 (dimension 1) item>2 (dimension 2) item>T ( matches 0, 1 or 2) item>F ( matches FALSE) item>* ( matches any value)
For more information on the DE-9IM, see the OpenGIS Simple Features Specification.
g | the Geometry with which to compare this Geometry |
intersectionPattern | the pattern against which to check the intersection matrix for the two Geometry s |
true
if the DE-9IM intersection matrix for the two Geometry
s match intersectionPattern
bool NetTopologySuite.Geometries.Geometry.Covers | ( | IGeometry | g | ) |
Tests whether this geometry covers the argument geometry
The covers
predicate has the following equivalent definitions:
[T*****FF*]
or[T****FF]
or[***T**FF*]
or[****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.
true
if this Geometry
covers g summary>Tests whether this geometry is covered by the specified geometry.
The CoveredBy
predicate has the following equivalent definitions:
[T*F**F***]
[*TF**F***]
[**FT*F***]
[**F*TF***]
g.Covers(this) == true
CoveredBy
is the converse of Covers) If either geometry is empty, the value of this predicate is false
.
This predicate is similar to Within, but is more inclusive (i.e. returns true
for more cases).
/remarks> param name="g">the Geometry
with which to compare this Geometry
returns>true
if this Geometry
is covered by g
seealso cref="Within"/> seealso cref="Covers"/>
IGeometry NetTopologySuite.Geometries.Geometry.Difference | ( | IGeometry | other | ) |
Computes a Geometry
representing the closure of the point-set of the points contained in this Geometry
that are not contained in the other
Geometry. If the result is empty, it is an atomic geometry with the dimension of the left-hand input. Non-empty IGeometryCollection arguments are not supported.
other | The Geometry with which to compute the difference. |
bool NetTopologySuite.Geometries.Geometry.Disjoint | ( | IGeometry | g | ) |
Tests whether this geometry is disjoint from the argument geometry.
The Disjoint
predicate has the following equivalent definitions:
FF*FF****
. !g.intersects(this) == true
Disjoint
is the inverse of Intersects
) true
if the two Geometry
s are disjoint.double NetTopologySuite.Geometries.Geometry.Distance | ( | IGeometry | g | ) |
|
staticprotected |
a | |
b | |
tolerance |
bool NetTopologySuite.Geometries.Geometry.Equals | ( | IGeometry | g | ) |
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
method, which has been named to clearly denote its functionality. This method should NOT be confused with the method
, which implements an exact equality comparison.
true
if the two Geometry
s are topologically equal.override bool NetTopologySuite.Geometries.Geometry.Equals | ( | Object | o | ) |
Tests whether this geometry is structurally and numerically equal to a given Object
.
If the argument Object
is not a Geometry
, the result is false
. Otherwise, the result is computed using
.
This method is provided to fulfill the Java contract for value-based object equality. In conjunction with
it provides semantics which are most useful for using Geometry
s as keys and values in Java collections.
Note that to produce the expected result the input geometries should be in normal form. It is the caller's responsibility to perform this where required (using
or as appropriate).
o | The object to compare |
true
if this geometry is exactly equal to the argument
|
pure virtual |
Returns true if the two Geometry
s are exactly equal, up to a specified tolerance. Two Geometries are exactly within a tolerance equal if:
This method does not test the values of the GeometryFactory
, the SRID
, or the UserData
fields. To properly test equality between different geometries, it is usually necessary to Normalize them first.
other | The Geometry with which to compare this Geometry have identical structure and point values, up to the distance tolerance. |
tolerance | Distance at or below which two Coordinates will be considered equal. |
true
if this and the other Geometry
are of the same class and have equal internal data. Implemented in NetTopologySuite.Geometries.Polygon, NetTopologySuite.Geometries.LineString, NetTopologySuite.Geometries.GeometryCollection, NetTopologySuite.Geometries.Point, NetTopologySuite.Geometries.MultiLineString, NetTopologySuite.Geometries.MultiPolygon, and NetTopologySuite.Geometries.MultiPoint.
bool NetTopologySuite.Geometries.Geometry.EqualsExact | ( | IGeometry | other | ) |
Returns true if the two Geometry
s are exactly equal. Two Geometries are exactly equal if:
This provides a stricter test of equality than EqualsTopologically, which is more useful in certain situations (such as using geometries as keys in collections). This method does not test the values of the GeometryFactory
, the SRID
, or the UserData
fields. To properly test equality between different geometries, it is usually necessary to Normalize them first.
true
if this and the other Geometry
have identical structure and point values. bool NetTopologySuite.Geometries.Geometry.EqualsNormalized | ( | IGeometry | g | ) |
Tests whether two geometries are exactly equal in their normalized forms.
This is a convenience method which creates normalized versions of both geometries before computing
.
This method is relatively expensive to compute. For maximum performance, the client should instead perform normalization on the individual geometries at an appropriate point during processing.
g | A geometry |
bool NetTopologySuite.Geometries.Geometry.EqualsTopologically | ( | IGeometry | g | ) |
Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS Equals
predicate.
The SFS
predicate has the following equivalent definitions:
T*F**FFF*
T*F **F FF*
Note that this method computes topologically equality. For structural equality, see equalsExact(Geometry).
true
if the two s are topologically equalvoid NetTopologySuite.Geometries.Geometry.GeometryChanged | ( | ) |
Notifies this geometry that its coordinates have been changed by an external party (for example, via a ICoordinateFilter).
When this method is called the geometry will flush and/or update any derived information it has cached (such as its GeoAPI.Geometries.Envelope ). The operation is applied to all component Geometries.
void NetTopologySuite.Geometries.Geometry.GeometryChangedAction | ( | ) |
Notifies this Geometry that its Coordinates have been changed by an external party. When GeometryChanged is called, this method will be called for this Geometry and its component Geometries.
|
virtual |
Returns an element Geometry from a GeometryCollection, or
this
, if the geometry is not a collection.
n | The index of the geometry element. |
Reimplemented in NetTopologySuite.Geometries.GeometryCollection.
override int NetTopologySuite.Geometries.Geometry.GetHashCode | ( | ) |
Gets a hash code for the Geometry.
|
pure virtual |
Gets an array of System.Double ordinate values
ordinate | The ordinate index |
Implemented in NetTopologySuite.Geometries.Polygon, NetTopologySuite.Geometries.GeometryCollection, NetTopologySuite.Geometries.Point, and NetTopologySuite.Geometries.LineString.
|
staticprotected |
|
static |
Returns true if the array contains any null
elements.
array | an array to validate. |
true
if any of array
s elements are null
.IGeometry NetTopologySuite.Geometries.Geometry.Intersection | ( | IGeometry | other | ) |
Computes a Geometry
representing the point-set which is common to both this Geometry
and the other
Geometry. The intersection of two geometries of different dimension produces a result geometry of dimension less than or equal to the minimum dimension of the input geometries. The result geometry may be a heterogenous IGeometryCollection. If the result is empty, it is an atomic geometry with the dimension of the lowest input dimension. Intersection of IGeometryCollections is supported only for homogeneous collection types. Non-empty heterogeneous IGeometryCollection arguments are not supported.
other | The Geometry with which to compute the intersection. |
Geometry
s.TopologyException | if a robustness error occurs. |
ArgumentException | if the argument is a non-empty heterogenous GeometryCollection |
bool NetTopologySuite.Geometries.Geometry.Intersects | ( | IGeometry | g | ) |
Tests whether this geometry intersects the argument geometry. /summary>
The Intersects
predicate has the following equivalent definitions:
[T********]
or[*T*******]
or[***T*****]
or[****T****]
!g.disjoint(this)
Intersects
is the inverse of Disjoint
) true
if the two Geometry
s intersect.Disjoint summary> Tests whether this geometry crosses the specified geometry. /summary>
The Crosses
predicate has the following equivalent definitions:
[T*T******]
for P/L, P/A, and L/A situations [T*****T**]
for L/P, A/P, and A/L situations) [0********]
for L/L situations For any other combination of dimensions this predicate returns
.
The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. In order to make the relation symmetric, NTS extends the definition to apply to L/P, A/P and A/L situations as well.
true
if the two Geometry
s cross.
|
protectedvirtual |
Returns whether the two Geometry
s are equal, from the point of view of the EqualsExact
method. Called by EqualsExact
. In general, two Geometry
classes are considered to be "equivalent" only if they are the same class. An exception is LineString
, which is considered to be equivalent to its subclasses.
true
if the classes of the two Geometry
s are considered to be equal by the equalsExact
method. Reimplemented in NetTopologySuite.Geometries.LineString.
bool NetTopologySuite.Geometries.Geometry.IsWithinDistance | ( | IGeometry | geom, |
double | distance | ||
) |
|
pure virtual |
Converts this Geometry
to normal form (or canonical form ).
Normal form is a unique representation for Geometry
s. It can be used to test whether two Geometry
s are equal in a way that is independent of the ordering of the coordinates within them. Normal form equality is a stronger condition than topological equality, but weaker than pointwise equality.
The definitions for normal form use the standard lexicographical ordering for coordinates. "Sorted in order of coordinates" means the obvious extension of this ordering to sequences of coordinates.
NOTE that this method mutates the value of this geometry in-place. If this is not safe and/or wanted, the geometry should be cloned prior to normalization.
Implemented in NetTopologySuite.Geometries.Polygon, NetTopologySuite.Geometries.LineString, NetTopologySuite.Geometries.GeometryCollection, and NetTopologySuite.Geometries.Point.
IGeometry NetTopologySuite.Geometries.Geometry.Normalized | ( | ) |
|
static |
obj1 | |
obj2 |
|
static |
obj1 | |
obj2 |
bool NetTopologySuite.Geometries.Geometry.Overlaps | ( | IGeometry | g | ) |
Tests whether this geometry overlaps the specified geometry.
The Overlaps
predicate has the following equivalent definitions:
[T*T***T**]
(for two points or two surfaces) or [1*T***T**]
(for two curves) If the geometries are of different dimension this predicate returns false
.
IntersectionMatrix NetTopologySuite.Geometries.Geometry.Relate | ( | IGeometry | g | ) |
IGeometry NetTopologySuite.Geometries.Geometry.SymmetricDifference | ( | IGeometry | other | ) |
Computes a Geometry
representing the closure of the point-set which is the union of the points in this Geometry
which are not contained in the other
Geometry, with the points in the other
Geometry not contained in this Geometry
. If the result is empty, it is an atomic geometry with the dimension of the highest input dimension. Non-empty IGeometryCollection arguments are not supported.
other | The Geometry with which to compute the symmetric difference. |
byte [] NetTopologySuite.Geometries.Geometry.ToBinary | ( | ) |
XmlReader NetTopologySuite.Geometries.Geometry.ToGMLFeature | ( | ) |
Returns the feature representation as GML 2.1.1 XML document. This XML document is based on Geometry.xsd
schema. NO features or XLink are implemented here!
override string NetTopologySuite.Geometries.Geometry.ToString | ( | ) |
string NetTopologySuite.Geometries.Geometry.ToText | ( | ) |
bool NetTopologySuite.Geometries.Geometry.Touches | ( | IGeometry | g | ) |
Tests whether this geometry touches the argument geometry
The Touches
predicate has the following equivalent definitions:
FT*******
, F**T*****
or F***T****
. If both geometries have dimension 0, the predicate returns false
, since points have only interiors. This predicate is symmetric.
IGeometry NetTopologySuite.Geometries.Geometry.Union | ( | IGeometry | other | ) |
Computes a Geometry
representing the point-set which is contained in both this Geometry
and the other
Geometry.
The method may be used on arguments of different dimension, but it does not support IGeometryCollection arguments.
The union of two geometries of different dimension produces a result geometry of dimension equal to the maximum dimension of the input geometries. The result geometry may be a heterogenous IGeometryCollection. If the result is empty, it is an atomic geometry with the dimension of the highest input dimension.
Unioning ILineStrings has the effect of noding and dissolving the input linework. In this context "noding" means that there will be a node or endpoint in the result for every endpoint or line segment crossing in the input. "Dissolving" means that any duplicate (i.e. coincident) line segments or portions of line segments will be reduced to a single line segment in the result. If merged linework is required, the LineMerger class can be used.
Non-empty IGeometryCollection arguments are not supported.
other | the Geometry with which to compute the union |
Geometry
and the points of other
TopologyException | Thrown if a robustness error occurs |
ArgumentException | Thrown if either input is a non-empty GeometryCollection |
IGeometry NetTopologySuite.Geometries.Geometry.Union | ( | ) |
Computes the union of all the elements of this geometry.
This method supports IGeometryCollections (which the other overlay operations currently do not).
The result obeys the following contract:
TopologyException | Thrown if a robustness error occurs |
bool NetTopologySuite.Geometries.Geometry.Within | ( | IGeometry | g | ) |
Tests whether this geometry is within the specified geometry.
The
predicate has the following equivalent definitions:
[T*F**F***]
g.contains(this) == true
Within
is the converse of Contains) An implication of the definition is that "The boundary of a geometry is not within the Polygon". In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false
(As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) For a predicate with similar behaviour but avoiding this subtle limitation, see CoveredBy.
true
if this Geometry
is within other
.Contains CoveredBy summary> Tests whether this geometry contains the argument geometry.
The Contains
predicate has the following equivalent definitions:
[T*****FF*]
g.within(this)
Contains
is the converse of Within) An implication of the definition is that "Geometries do not
contain their boundary". In other words, if a geometry A is a subset of the points in the boundary of a geometry B, B.Contains(A) == false
. (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) For a predicate with similar behaviour but avoiding this subtle limitation, see Covers.
|
static |
A predefined GeometryFactory with PrecisionModel ==
PrecisionModels.Fixed.
|
get |
Returns the area of this Geometry
. Areal Geometries have a non-zero area. They override this function to compute the area. Others return 0.0
|
getset |
Returns the boundary, or an empty geometry of appropriate dimension if this Geometry
is empty. For a discussion of this function, see the OpenGIS Simple Features Specification. As stated in SFS Section 2.1.13.1, "the boundary
of a Geometry is a set of Geometries of the next lower dimension."
Geometry
.NOTE: make abstract, remove setter and change geoapi
|
getset |
Returns the dimension of this Geometry
s inherent boundary.
Dimension.False
if the boundary is the empty point. NOTE: make abstract, remove setter and change geoapi
|
get |
Computes the centroid of this Geometry
. The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid). The centroid of an empty geometry is POINT EMPTY
.
|
get |
|
get |
Returns an array containing the values of all the vertices for this geometry.
If the geometry is a composite, the array will contain all the vertices for the components, in the order in which the components occur in the geometry.
In general, the array cannot be assumed to be the actual internal storage for the vertices. Thus modifying the array may not modify the geometry itself. Use the ICoordinateSequence.SetOrdinate method (possibly on the components) to modify the underlying data. If the coordinates are modified, IGeometry.GeometryChanged must be called afterwards.
Geometry
.
|
getset |
Returns the dimension of this geometry.
The dimension of a geometry is is the topological dimension of its embedding in the 2-D Euclidean plane. In the NTS spatial model, dimension values are in the set {0,1,2}.
Note that this is a different concept to the dimension of the vertex Coordinates. The geometry dimension can never be greater than the coordinate dimension. For example, a 0-dimensional geometry (e.g. a Point) may have a coordinate dimension of 3 (X,Y,Z).
|
get |
Gets a geometry representing the envelope (bounding box) of this Geometry
.
If this Geometry
is
Point
Point
LineString
, Polygon
whose vertices are (minx, miny), (maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny).
|
get |
Gets an GeoAPI.Geometries.Envelope containing the minimum and maximum x and y values in this Geometry
. If the geometry is empty, an empty Envelope
is returned.
The returned object is a copy of the one maintained internally, to avoid aliasing issues. For best performance, clients which access this envelope frequently should cache the return value.
|
get |
Gets the factory which contains the context in which this point was created.
|
get |
|
get |
|
get |
|
get |
|
get |
Tests whether this IGeometry is simple. The SFS definition of simplicity follows the general rule that a Geometry is simple if it has no points of self-tangency, self-intersection or other anomalous points. Simplicity is defined for each IGeometry subclass as follows:
IsSimple
tests for this condition and reports false
if it is not met. (This is a looser test than checking for validity). Linear rings have the same semantics. Linear geometries are simple iff they do not self-intersect at points other than boundary points. Zero-dimensional geometries (points) are simple iff they have no repeated points. Empty Geometry
s are always simple.
true
if this Geometry
is simple
|
get |
|
get |
|
get |
Returns the number of Geometryes in a GeometryCollection, or 1, if the geometry is not a collection.
|
get |
|
get |
Gets the OGC geometry type
|
get |
|
get |
Returns the PrecisionModel
used by the Geometry
.
|
getset |
Sets the ID of the Spatial Reference System used by the Geometry
.
NOTE: This method should only be used for exceptional circumstances or for backwards compatibility. Normally the SRID should be set on the IGeometryFactory used to create the geometry. SRIDs set using this method will not be propagated to geometries returned by constructive methods.
|
getset |
Gets/Sets the user data object for this point, if any.
A simple scheme for applications to add their own custom data to a Geometry. An example use might be to add an object representing a Coordinate Reference System. Note that user data objects are not present in geometries created by construction methods.