Class Point
Represents a single point.
APoint
is topologically valid if and only if:
- The coordinate which defines it if any) is a valid coordinate
(i.e. does not have an
NaN
X- or Y-ordinate
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
[Serializable]
public class Point : Geometry, IComparable, IComparable<Geometry>, IPuntal
Constructors
| Edit this page View SourcePoint(Coordinate)
Initializes a new instance of the Point class.
Declaration
public Point(Coordinate coordinate)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | coordinate | The coordinate used for create this Point. |
Remarks
For create this Geometry is used a standard GeometryFactory
with PrecisionModel ==
Floating.
Point(CoordinateSequence, GeometryFactory)
Constructs a Point
with the given coordinate.
Declaration
public Point(CoordinateSequence coordinates, GeometryFactory factory)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequence | coordinates | Contains the single coordinate on which to base this |
GeometryFactory | factory |
Point(double, double)
Initializes a new instance of the Point class.
Declaration
public Point(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | The x coordinate. |
double | y | The y coordinate. |
Remarks
For create this Geometry is used a standard GeometryFactory
with PrecisionModel set to
Floating.
Point(double, double, double)
Initializes a new instance of the Point class.
Declaration
public Point(double x, double y, double z)
Parameters
Type | Name | Description |
---|---|---|
double | x | The x coordinate. |
double | y | The y coordinate. |
double | z | The z coordinate. |
Remarks
For create this Geometry is used a standard GeometryFactory
with PrecisionModel set to
Floating.
Fields
| Edit this page View SourceEmpty
Represents an empty Point
.
Declaration
public static readonly Point Empty
Field Value
Type | Description |
---|---|
Point |
Properties
| Edit this page View SourceBoundary
Gets the boundary of this geometry. Zero-dimensional geometries have no boundary by definition, so an empty GeometryCollection is returned.
Declaration
public override Geometry Boundary { get; }
Property Value
Type | Description |
---|---|
Geometry |
Overrides
| Edit this page View SourceBoundaryDimension
Declaration
public override Dimension BoundaryDimension { get; }
Property Value
Type | Description |
---|---|
Dimension |
Overrides
| Edit this page View SourceCoordinate
Returns a vertex of this geometry
(usually, but not necessarily, the first one),
or null
if the geometry is empty.
Declaration
public override Coordinate Coordinate { get; }
Property Value
Type | Description |
---|---|
Coordinate | A coordinate which is a vertex of this |
Overrides
Remarks
The returned coordinate should not be assumed to be an actual Coordinate
object used in the internal representation.
CoordinateSequence
Declaration
public CoordinateSequence CoordinateSequence { get; }
Property Value
Type | Description |
---|---|
CoordinateSequence |
Coordinates
Declaration
public override Coordinate[] Coordinates { get; }
Property Value
Type | Description |
---|---|
Coordinate[] |
Overrides
| Edit this page View SourceDimension
Declaration
public override Dimension Dimension { get; }
Property Value
Type | Description |
---|---|
Dimension |
Overrides
| Edit this page View SourceGeometryType
Returns the name of this object's interface.
Declaration
public override string GeometryType { get; }
Property Value
Type | Description |
---|---|
string | "Point" |
Overrides
| Edit this page View SourceIsEmpty
Declaration
public override bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceM
Declaration
public double M { get; set; }
Property Value
Type | Description |
---|---|
double |
NumPoints
Declaration
public override int NumPoints { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceOgcGeometryType
Gets the OGC geometry type
Declaration
public override OgcGeometryType OgcGeometryType { get; }
Property Value
Type | Description |
---|---|
OgcGeometryType |
Overrides
| Edit this page View SourceSortIndex
Gets a value to sort the geometry
Declaration
protected override Geometry.SortIndexValue SortIndex { get; }
Property Value
Type | Description |
---|---|
Geometry.SortIndexValue |
Overrides
Remarks
NOTE:
For JTS v1.17 this property's getter has been renamed to getTypeCode()
.
In order not to break binary compatibility we did not follow.
X
Gets a value indicating the x-ordinate of this point
Declaration
public double X { get; set; }
Property Value
Type | Description |
---|---|
double |
Remarks
Deviation from JTS: this implementation does not throw an exception when this property is accessed or set
Y
Gets a value indicating the y-ordinate of this point
Declaration
public double Y { get; set; }
Property Value
Type | Description |
---|---|
double |
Remarks
Deviation from JTS: this implementation does not throw an exception when this property is accessed or set
Z
Declaration
public double Z { get; set; }
Property Value
Type | Description |
---|---|
double |
Methods
| Edit this page View SourceApply(ICoordinateFilter)
Performs an operation with or on this Geometry
's coordinates.
Declaration
public override void Apply(ICoordinateFilter filter)
Parameters
Type | Name | Description |
---|---|---|
ICoordinateFilter | filter | The filter to apply to this |
Overrides
Remarks
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).
Apply(ICoordinateSequenceFilter)
Performs an operation on the coordinates in this Geometry
's CoordinateSequences.
Declaration
public override void Apply(ICoordinateSequenceFilter filter)
Parameters
Type | Name | Description |
---|---|---|
ICoordinateSequenceFilter | filter | The filter to apply |
Overrides
Remarks
If the filter reports that a coordinate value has been changed, GeometryChanged() will be called automatically.
Apply(IEntireCoordinateSequenceFilter)
Performs an operation on this Geometry
's CoordinateSequences.
Declaration
public override void Apply(IEntireCoordinateSequenceFilter filter)
Parameters
Type | Name | Description |
---|---|---|
IEntireCoordinateSequenceFilter | filter | The filter to apply |
Overrides
Remarks
If the filter reports that a coordinate value has been changed, GeometryChanged() will be called automatically.
Apply(IGeometryComponentFilter)
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.
Declaration
public override void Apply(IGeometryComponentFilter filter)
Parameters
Type | Name | Description |
---|---|---|
IGeometryComponentFilter | filter | The filter to apply to this |
Overrides
| Edit this page View SourceApply(IGeometryFilter)
Performs an operation with or on this Geometry
and its
subelement Geometry
s (if any).
Only GeometryCollections and subclasses
have subelement Geometry's.
Declaration
public override void Apply(IGeometryFilter filter)
Parameters
Type | Name | Description |
---|---|---|
IGeometryFilter | filter | The filter to apply to this |
Overrides
| Edit this page View SourceCompareToSameClass(object)
Declaration
protected override int CompareToSameClass(object other)
Parameters
Type | Name | Description |
---|---|---|
object | other |
Returns
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceCompareToSameClass(object, IComparer<CoordinateSequence>)
Declaration
protected override int CompareToSameClass(object other, IComparer<CoordinateSequence> comparer)
Parameters
Type | Name | Description |
---|---|---|
object | other | |
IComparer<CoordinateSequence> | comparer |
Returns
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceComputeEnvelopeInternal()
Declaration
protected override Envelope ComputeEnvelopeInternal()
Returns
Type | Description |
---|---|
Envelope |
Overrides
| Edit this page View SourceCopyInternal()
An internal method to copy subclass-specific geometry data.
Declaration
protected override Geometry CopyInternal()
Returns
Type | Description |
---|---|
Geometry | A copy of the target geometry object. |
Overrides
| Edit this page View SourceEqualsExact(Geometry, double)
Declaration
public override bool EqualsExact(Geometry other, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | other | |
double | tolerance |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetOrdinates(Ordinate)
Gets an array of double ordinate values
Declaration
public override double[] GetOrdinates(Ordinate ordinate)
Parameters
Type | Name | Description |
---|---|---|
Ordinate | ordinate | The ordinate index |
Returns
Type | Description |
---|---|
double[] | An array of ordinate values |
Overrides
| Edit this page View SourceNormalize()
Declaration
public override void Normalize()
Overrides
| Edit this page View SourceReverse()
Computes a new geometry which has all component coordinate sequences in reverse order (opposite orientation) to this one.
Declaration
[Obsolete("Call Geometry.Reverse()")]
public override Geometry Reverse()
Returns
Type | Description |
---|---|
Geometry | A reversed geometry |
Overrides
Remarks
Don't override this function, implement ReverseInternal().
ReverseInternal()
The actual implementation of the Reverse() function for POINT
s.
Declaration
protected override Geometry ReverseInternal()
Returns
Type | Description |
---|---|
Geometry | A reversed geometry |