Point Class

  • Point
  • class Esri::ArcGISRuntime::Point

    Represents a specific location, defined by x and y (and optionally z) coordinates, and a SpatialReference. More...

    Header: #include <Point.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::Geometry

    Public Functions

    Point()
    Point(double x, double y)
    Point(double x, double y, const Esri::ArcGISRuntime::SpatialReference &spatialReference)
    Point(double x, double y, double z)
    Point(double x, double y, double z, const Esri::ArcGISRuntime::SpatialReference &spatialReference)
    Point(const Esri::ArcGISRuntime::Point &other)
    Point(Esri::ArcGISRuntime::Point &&other)
    Point(const Esri::ArcGISRuntime::Geometry &other)
    virtual ~Point() override
    bool isValid() const
    double m() const
    double x() const
    double y() const
    double z() const
    Esri::ArcGISRuntime::Point &operator=(const Esri::ArcGISRuntime::Point &other)
    Esri::ArcGISRuntime::Point &operator=(Esri::ArcGISRuntime::Point &&other)

    Static Public Members

    Esri::ArcGISRuntime::Point createWithM(double x, double y, double m)
    Esri::ArcGISRuntime::Point createWithM(double x, double y, double m, const Esri::ArcGISRuntime::SpatialReference &spatialReference)
    Esri::ArcGISRuntime::Point createWithM(double x, double y, double z, double m)
    Esri::ArcGISRuntime::Point createWithM(double x, double y, double z, double m, const Esri::ArcGISRuntime::SpatialReference &spatialReference)

    Detailed Description

    Point geometries represent discrete locations or entities, such as a geocoded house address, the location of a water meter in a water utility network, a moving vehicle, and so on. 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 z (elevation or altitude) and 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, longitude-formatted string directly to a point, and also return a latitude, 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.

    A point is immutable. Instead of changing the properties of an existing point, you can create new point instances, or use PointBuilder.

    Points are based upon the base 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 the point object.

    Relevant samples:

    Member Function Documentation

    Point::Point()

    Default constructor. Creates an empty Point.

    Point::Point(double x, double y)

    Creates a point with an x, y coordinates.

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.

    Point::Point(double x, double y, const Esri::ArcGISRuntime::SpatialReference &spatialReference)

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

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.
    • spatialReference - The spatial reference for the point.

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

    Point::Point(double x, double y, double z)

    Creates a point with an x, y, z coordinates.

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.
    • z - The z-coordinate for the point.

    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.

    Point::Point(double x, double y, double z, const Esri::ArcGISRuntime::SpatialReference &spatialReference)

    Creates a point with an x, y, z and spatial reference.

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.
    • z - The z-coordinate for the point.
    • spatialReference - The spatial reference for the point.

    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.

    See also SpatialReference.

    Point::Point(const Esri::ArcGISRuntime::Point &other)

    Copy constructor from other Point.

    Point::Point(Esri::ArcGISRuntime::Point &&other)

    Move constructor from other Point.

    [explicit] Point::Point(const Esri::ArcGISRuntime::Geometry &other)

    Converting constructor from other Geometry.

    See also Downcast helper functions.

    [override virtual] Point::~Point()

    Destructor

    [static] Esri::ArcGISRuntime::Point Point::createWithM(double x, double y, double m)

    Returns a point with an x,y coordinates and m-value.

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.
    • m - The m-value for the point.

    [static] Esri::ArcGISRuntime::Point Point::createWithM(double x, double y, double m, const Esri::ArcGISRuntime::SpatialReference &spatialReference)

    Returns a point with an x, y, m and spatial reference.

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.
    • m - The m-value for the point.
    • spatialReference - The spatial reference for the point.

    M-values are used in linear referencing scenarios and may represent things like mile markers along a highway. Like z-values, every geometry can optionally store m-values with the point coordinates that comprise it. The default m-value is NaN. If an m-value is specified when a geometry is created, the new geometry has m-values (Geometry::hasM is true). Note that when you get m-values back from a geometry, the default value of NaN is returned for vertices that do not have m-values. A geometry with m-values is sometimes known as an m-aware geometry.

    See also SpatialReference.

    [static] Esri::ArcGISRuntime::Point Point::createWithM(double x, double y, double z, double m)

    Returns a point with an x, y, z coordinates and m-value.

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.
    • z - The z-coordinate for the point.
    • m - The m-value for the point.

    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.

    Returns a Point with the specified coordinates and m-value. 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.

    M-values are used in linear referencing scenarios and may represent things like mile markers along a highway. Like z-values, every geometry can optionally store m-values with the point coordinates that comprise it. The default m-value is NaN. If an m-value is specified when a geometry is created, the new geometry has m-values (Geometry::hasM is true). Note that when you get m-values back from a geometry, the default value of NaN is returned for vertices that do not have m-values. A geometry with m-values is sometimes known as an m-aware geometry.

    [static] Esri::ArcGISRuntime::Point Point::createWithM(double x, double y, double z, double m, const Esri::ArcGISRuntime::SpatialReference &spatialReference)

    Returns a point with an x, y, z, m and a spatial reference.

    • x - The x-coordinate for the point.
    • y - The y-coordinate for the point.
    • z - The z-coordinate for the point.
    • m - The m-value for the point.
    • spatialReference - The spatial reference for the point.

    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.

    Returns a Point with the specified coordinates and m-value in the given 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.

    M-values are used in linear referencing scenarios and may represent things like mile markers along a highway. Like z-values, every geometry can optionally store m-values with the point coordinates that comprise it. The default m-value is NaN. If an m-value is specified when a geometry is created, the new geometry has m-values (Geometry::hasM is be true). Note that when you get m-values back from a geometry, the default value of NaN is returned for vertices that do not have m-values. A geometry with m-values is sometimes known as an m-aware geometry.

    Geometries can have z-values, indicating values along the z-axis, which is perpendicular to both the x-axis and y-axis. Z-values indicate height above or depth below a surface, or an absolute elevation. For example, z-values are used to draw the locations of geometries in a SceneView. Note that geometries are not considered true 3D shapes and are draped onto surfaces in the view, or in some cases, drawn in a single plane by using z-values. Z-values are stored on Point and Envelope. Because Multipoint, Polyline, and Polygon are created from a collection of Point, all types of geometry can have z-values.

    Whether or not a geometry has z-values is determined when the geometry is created; if you use a method that has a z-value parameter, the new geometry has z-values (Geometry::hasZ is true). If you create geometries using constructors that take z-value parameters, or if you pass into the constructor points or segments that have z-values, the new geometry has z-values. A Geometry with z-values is sometimes known as a z-aware geometry.

    It may be that not all vertices in your geometry have a z-value defined. NaN is a valid z-value used to indicate an unknown z-value. However, the default z-value is 0. When you get z-values from a geometry that does not have z-values, the default is 0. Check the Geometry::hasZ to determine whether a z-value of 0 means that there are no z-values in the geometry or that the z-value in the geometry's coordinates really is 0.

    See also SpatialReference.

    [since Esri::ArcGISRuntime 100.2] bool Point::isValid() const

    Gets whether this Point is valid.

    A Point is valid if it is not empty and geometryType is GeometryType::Point.

    Returns true if valid.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    double Point::m() const

    Returns an optional coordinate to define a measure value for the point.

    M-values are used in linear referencing scenarios and may represent things like mile markers along a highway. Like z-values, every geometry can optionally store m-values with the point coordinates that comprise it. The default m-value is NaN. If an m-value is specified when a geometry is created, the new geometry has m-values (Geometry::hasM is true). Note that when you get m-values back from a geometry, the default value of NaN is returned for vertices that do not have m-values. A geometry with m-values is sometimes known as an m-aware geometry.

    double Point::x() const

    Returns the x-coordinate for the point.

    Returns NaN if an error occurs.

    double Point::y() const

    Returns the y-coordinate for the point.

    Returns NaN if an error occurs.

    double Point::z() const

    Returns the z-coordinate for the point.

    Geometries can have z-values, indicating values along the z-axis, which is perpendicular to both the x-axis and y-axis. Z-values indicate height above or depth below a surface, or an absolute elevation. For example, z-values are used to draw the locations of geometries in a SceneView. Note that geometries are not considered true 3D shapes and are draped onto surfaces in the view, or in some cases, drawn in a single plane by using z-values. Z-values are stored on Point and Envelope. Since Multipoint, Polyline, and Polygon are created from a collection of Point, all types of geometry can have z-values.

    Whether or not a geometry has z-values is determined when the geometry is created; if you use a method that has a z-value parameter, the new geometry has z-values (Geometry::hasZ is true). If you create geometries using constructors that take z-value parameters, or if you pass into the constructor points or segments that have z-values, the new geometry has z-values. A Geometry with z-values is sometimes known as a z-aware geometry.

    It may be that not all vertices in your geometry have a z-value defined. NaN is a valid z-value used to indicate an unknown z-value. However, the default z-value is 0. When you get z-values from a geometry that does not have z-values, the default is 0. Check the Geometry::hasZ to determine whether a z-value of 0 means that there are no z-values in the geometry or that the z-value in the geometry's coordinates really is 0.

    Esri::ArcGISRuntime::Point &Point::operator=(const Esri::ArcGISRuntime::Point &other)

    Assignment operator from other Point.

    Esri::ArcGISRuntime::Point &Point::operator=(Esri::ArcGISRuntime::Point &&other)

    Move operator from other Point.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.