Skip to content
import Point from "@arcgis/core/geometry/Point.js";
Inheritance:
PointGeometryAccessor
Since
ArcGIS Maps SDK for JavaScript 4.0

A location defined by X, Y, and Z coordinates.

Z-values defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

cache

readonlyinherited Property
Type
Record<string, any>
Inherited from: Geometry

The cache is used to store values computed from geometries that need to be cleared or recomputed upon mutation. An example is the extent of a polygon.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor
Since
ArcGIS Maps SDK for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

extent

readonlyinherited Property
Type
Extent | null | undefined
Inherited from: Geometry

The extent of the geometry. For a point, the extent is null.

hasM

Property
Type
boolean

Indicates if the geometry has M values.

M-values (measure) allow attribute values to be stored at the vertex of a point. A common usage for storing a measurement in the vertices along a linear feature are linear referencing applications.

hasZ

Property
Type
boolean

Indicates if the geometry has z-values (elevation).

Z-values defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service.

latitude

Property
Type
number | null | undefined

The latitude of the point. If the spatial reference is Web Mercator, the latitude will be given in WGS84. In any geographic spatial reference, the latitude will equal the y coordinate. In all other cases the latitude will be null.

longitude

Property
Type
number | null | undefined

The longitude of the point. If the spatial reference is Web Mercator, the longitude will be given in WGS84. In any geographic spatial reference, the longitude will equal the x coordinate. In all other cases the longitude will be null.

m

Property
Type
number | undefined

The m-coordinate of the point in map units.

M-values (measure) allow attribute values to be stored at the vertex of a point. A common usage for storing a measurement in the vertices along a linear feature are linear referencing applications.

spatialReference

autocast inherited Property
Type
SpatialReference
Inherited from: Geometry

The spatial reference of the geometry.

Default value
SpatialReference.WGS84 // wkid: 4326

type

readonly Property
Type
"point"

The string value representing the type of geometry.

x

Property
Type
number

The x-coordinate (easting) of the point in map units.

Default value
0

y

Property
Type
number

The y-coordinate (northing) of the point in map units.

Default value
0

z

Property
Type
number | undefined

The z-coordinate (or elevation) of the point in map units.

Z-values defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
clone(): Point
copy(other: Point): this
distance(other: Point): number
equals(point: Point | null | undefined): boolean
normalize(): this
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters
ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

clone

Method
Signature
clone (): Point

Creates a deep clone of Point object.

Returns
Point

A new instance of a Point object equal to the object used to call .clone().

copy

Method
Signature
copy (other: Point): this

Copies all values from another Point instance.

Parameters
ParameterTypeDescriptionRequired
other

The point to copy from.

Returns
this

Returns this instance.

distance

Method
Signature
distance (other: Point): number

Computes the Euclidean distance between this Point and a given Point. Points must have the same spatial reference.

Parameters
ParameterTypeDescriptionRequired
other

The point to compute the distance to.

Returns
number

Returns the Euclidean distance between this Point and the other Point.

equals

Method
Signature
equals (point: Point | null | undefined): boolean

Determines if the input point is equal to the point calling the function.

Parameters
ParameterTypeDescriptionRequired
point

The input point to test.

Returns
boolean

Returns true if the X, Y, Z coordinates of the input point along with its spatial reference and M value are exactly equal to those of the point calling equals().

normalize

Method
Signature
normalize (): this

Modifies the point geometry in-place by shifting the X-coordinate to within +/- 180 span in map units. You should clone() the point object before calling this method where appropriate.

Returns
this

Returns a point with a normalized x-value.

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.