Point

class Point : Geometry

A location defined by x and y (and optionally z) coordinates. Point geometries represent discrete locations or entities, such as a geocoded house address, the location of a water meter in a water utility network, or a moving vehicle. Larger geographic entities (such as cities) are often represented as points on small-scale maps. Points can be used as the geometry of features and graphics and are often used to construct more complex geometries. They are also used in a Viewpoint to define the center of the display.

Points store a single set of x,y coordinates that define a location (longitude and latitude, for example), and a SpatialReference. Points can optionally have a Point.z (elevation or altitude) and Point.m (measure) attributes.

For points defined with a geographic spatial reference, the x-coordinate is the longitude (east or west), and the y-coordinate is the latitude (north or south). When geographic coordinates are represented in strings, points are generally written using the form "(latitude, longitude)", where the y-coordinate comes before the x-coordinate. Latitude values south of the equator and longitude values west of the prime meridian are expressed as negative numbers.

Use CoordinateFormatter to convert a latitude and longitude formatted string directly to a Point. The coordinate formatter can also return a latitude and longitude formatted string from an existing Point. Other coordinate notations, such as Military Grid Reference System (MGRS) and United States National Grid (USNG) are also supported.

Points are based upon the parent Geometry class. The geometry class is immutable which means that you can not change its shape once it is created. If you need to modify a point once it has been created, use the PointBuilder class instead. The GeometryBuilder.toGeometry() method provides you with the point object.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(x: Double, y: Double, z: Double, spatialReference: SpatialReference? = null)

Creates a point with an x, y, z and spatial reference. The minimum z-value is -6,356,752 meters, which is the approximate radius of the earth (the WGS 84 datum semi-minor axis). The maximum z-value is 55,000,000 meters.

constructor(x: Double, y: Double, spatialReference: SpatialReference? = null)

Creates a point with an x, y and a spatial reference. Creates a point with x, y for the coordinates and a spatial reference.

constructor(x: Double, y: Double, z: Double? = null, m: Double? = null, spatialReference: SpatialReference? = null)

Creates a point with an x, y, z, m and spatial reference. The minimum z-value is -6,356,752 meters, which is the approximate radius of the earth (the WGS 84 datum semi-minor axis). The maximum z-value is 55,000,000 meters.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val m: Double?

An optional coordinate to define a measure value for the point.

Link copied to clipboard
val x: Double

The x-coordinate for the point. Returns NAN if an error occurs.

Link copied to clipboard
val y: Double

The y-coordinate for the point. Returns NAN if an error occurs.

Link copied to clipboard
val z: Double?

The z-coordinate for the point.

Inherited properties

Link copied to clipboard

Indicates the dimensionality of a Geometry, relating to the number of spatial dimensions in which the geometry may have a size. You can use Geometry.dimension to work out what kind of symbol can be applied to a specific type of geometry. For example, Point and Multipoint are both zero-dimensional point geometries, and both can be displayed using a type of MarkerSymbol. Polygon and Envelope are both 2-dimensional area geometries that can be displayed using a type of FillSymbol.

Link copied to clipboard

The minimum enclosing bounding-box (or Envelope) that covers the geometry.

Link copied to clipboard

True if this geometry contains curve segments, false otherwise. ArcGIS software supports polygon and polyline geometries that contain curve segments (where Segment.isCurve is true, sometimes known as true curves or nonlinear segments). Curves may be present in certain types of data, such as Mobile Map Packages (MMPK) or geometry JSON. When connecting to ArcGIS feature services that support curves (see ArcGISFeatureServiceInfo.supportsTrueCurve), this API retrieves densified versions of curve feature geometries by default.

Link copied to clipboard

True if the geometry has m values (measure values), false otherwise. M is a vertex value that is stored with the geometry. These values typically represent non-spatial measurements or attributes.

Link copied to clipboard

True if the geometry has z-coordinate values, false otherwise. Only 3D geometries contain z-coordinate values. These values typically represent elevation, height, or depth.

Link copied to clipboard

True if the geometry is empty, false otherwise. A geometry is empty if it does not have valid geographic coordinates, even if the SpatialReference is specified. An empty Geometry is a valid object that has no location in space.

Link copied to clipboard

The spatial reference for this geometry. This can be null if the geometry is not associated with a SpatialReference.

Inherited functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

fun equals(right: Geometry, tolerance: Double): Boolean

Checks if two geometries are approximately the same within the given tolerance. This function performs a lightweight comparison of two geometries that might be useful when writing test code. It uses the tolerance to compare each of x, y, and any other values the geometries possess (such as z or m) independently in the manner: abs(value1 - value2) <= tolerance. The single tolerance value is used even if the x, y, z or m units differ. This function does not respect modular arithmetic of spatial references which wrap around, so longitudes of -180 and +180 degrees are considered to differ by 360 degrees.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.