ArcGIS Runtime SDK for iOS
100.15
|
A location defined by x and y (and optionally z) coordinates.
AGSPoint
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 an AGSViewpoint
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 an AGSSpatialReference
. Points can optionally have a z-value (commonly used to describe elevation or altitude) and an m-value (commonly used for measurement relative to the geometry).
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 AGSCoordinateFormatter
to convert a latitude and longitude formatted string directly to an AGSPoint
. The coordinate formatter can also return a latitude and longitude formatted string from an existing AGSPoint
. 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 AGSGeometry
class. The AGSGeometry
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 AGSPointBuilder
class instead. The toGeometry (AGSGeometryBuilder)
method will provide you with the AGSPoint
object.
toBuilder (AGSPoint):
to get a point builder. AGSPointBuilder
to construct or modify points programmatically. AGSSketchEditor
to construct or modify geometries interactively by sketching on a map. AGSGeometryEngine
to perform operations on geometries. Instance Methods | |
(instancetype) | - initWithCLLocationCoordinate2D: |
(instancetype) | - initWithX:y:m:spatialReference: |
(instancetype) | - initWithX:y:spatialReference: |
(instancetype) | - initWithX:y:z:m:spatialReference: |
(instancetype) | - initWithX:y:z:spatialReference: |
(BOOL) | - isEqualToGeometry: |
(BOOL) | - isEqualToGeometry: |
(BOOL) | - isEqualToGeometry:tolerance: |
(AGSPointBuilder *) | - toBuilder |
(CLLocationCoordinate2D) | - toCLLocationCoordinate2D |
(nullable id) | - toJSON: |
Class Methods | |
(nullable id< AGSJSONSerializable >) | + fromJSON:error: |
(instancetype) | + pointWithCLLocationCoordinate2D: |
(instancetype) | + pointWithX:y:m:spatialReference: |
(instancetype) | + pointWithX:y:spatialReference: |
(instancetype) | + pointWithX:y:z:m:spatialReference: |
(instancetype) | + pointWithX:y:z:spatialReference: |
Properties | |
AGSGeometryDimension | dimension |
BOOL | empty |
AGSEnvelope * | extent |
AGSGeometryType | geometryType |
BOOL | hasCurves |
BOOL | hasM |
BOOL | hasZ |
double | m |
AGSSpatialReference * | spatialReference |
NSDictionary< NSString *, id > * | unknownJSON |
NSDictionary< NSString *, id > * | unsupportedJSON |
double | x |
double | y |
double | z |
|
staticrequiredinherited |
Initializes and returns an object from its JSON representation.
JSONObject | NSDictionary or NSArray containing the JSON. |
error | encountered during the operation, if any. |
- (instancetype) initWithCLLocationCoordinate2D: | (CLLocationCoordinate2D) | locationCoordinate |
Initializes a point geometry with the provided location information.
locationCoordinate | of the device |
toBuilder:
to get a builder to further modify the geometry. - (instancetype) initWithX: | (double) | x | |
y: | (double) | y | |
m: | (double) | m | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values.
x | The position along x-axis |
y | The position along y-axis |
m | The measure value |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. - (instancetype) initWithX: | (double) | x | |
y: | (double) | y | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values.
x | The position along x-axis |
y | The position along y-axis |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. - (instancetype) initWithX: | (double) | x | |
y: | (double) | y | |
z: | (double) | z | |
m: | (double) | m | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values. 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.
x | The position along x-axis |
y | The position along y-axis |
z | The position along z-axis |
m | The measure value |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. - (instancetype) initWithX: | (double) | x | |
y: | (double) | y | |
z: | (double) | z | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values. 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.
x | The position along x-axis |
y | The position along y-axis |
z | The position along z-axis |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. - (BOOL) isEqualToGeometry: | (AGSGeometry *) | other |
Compares whether two geometries are equal.
other | The other geometry object to compare this geometry object to. |
YES
if the geometries are equal. - (BOOL) isEqualToGeometry: | (AGSPoint *) | other |
Compares whether two point geometries are equal.
other | point to compare this point to |
- (BOOL) isEqualToGeometry: | (AGSGeometry *) | other | |
tolerance: | (double) | tolerance | |
Compares two geometry objects for equality to within some tolerance.
other | The other geometry object to compare this geometry object to. |
tolerance | The tolerance. |
YES
if the geometries are equal within the given tolerance, otherwise NO
. + (instancetype) pointWithCLLocationCoordinate2D: | (CLLocationCoordinate2D) | locationCoordinate |
Initializes a point geometry with the provided location information.
locationCoordinate | of the device |
toBuilder:
to get a builder to further modify the geometry. + (instancetype) pointWithX: | (double) | x | |
y: | (double) | y | |
m: | (double) | m | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values.
x | The position along x-axis |
y | The position along y-axis |
m | The measure value |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. + (instancetype) pointWithX: | (double) | x | |
y: | (double) | y | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values.
x | The position along x-axis |
y | The position along y-axis |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. + (instancetype) pointWithX: | (double) | x | |
y: | (double) | y | |
z: | (double) | z | |
m: | (double) | m | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values. 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.
x | The position along x-axis |
y | The position along y-axis |
z | The position along z-axis |
m | The measure value |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. + (instancetype) pointWithX: | (double) | x | |
y: | (double) | y | |
z: | (double) | z | |
spatialReference: | (nullable AGSSpatialReference *) | spatialReference | |
Initializes a point geometry with the provided coordinate values. 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.
x | The position along x-axis |
y | The position along y-axis |
z | The position along z-axis |
spatialReference | The coordinate system that the coordinate values use. |
toBuilder:
to get a builder to further modify the geometry. - (AGSPointBuilder*) toBuilder |
Returns a builder using a copy of this geometry as a starting off point. The builder can be used to make modifications to the geometry.
Implements AGSGeometry.
- (CLLocationCoordinate2D) toCLLocationCoordinate2D |
Converts current point into CLLocationCoordinate2D.
|
requiredinherited |
Returns JSON representation for this object.
error | encountered during the operation, if any. |
NSDictionary
or NSArray
containing the JSON. Reimplemented in AGSPortalItem.
|
readnonatomicassigninherited |
The dimension of this geometry object.
AGSGeometryDimension::AGSGeometryDimensionUnknown
if an error occurs.
|
readnonatomicassigninherited |
Indicates whether this geometry has any vertices.
|
readnonatomicstronginherited |
Smallest, rectangular bounding-box that covers the geometry.
|
readnonatomicassigninherited |
The type of this geometry.
|
readnonatomicassigninherited |
YES
if this geometry contains curve segments, NO
otherwise.
The ArcGIS Platform supports polygon and polyline geometries that contain curve segments (where AGSSegment::curve
is YES
, sometimes known as true curves or nonlinear segments). Curves may be present in certain types of data - for example Mobile Map Packages (MMPK) or geometry JSON. When connecting to ArcGIS feature services that support curves (AGSArcGISFeatureServiceInfo::supportsTrueCurve
), ArcGIS Runtime retrieves densified versions of curve feature geometries by default.
If a polygon or polyline geometry contains curve segments, this property is YES
. Prior to v100.12, it was not possible to access curve segments, and only AGSLineSegment
instances would be returned when iterating through the segments in an AGSPolygon
or AGSPolyline
object, irrespective of this property.
From v100.12, you can use curve segments when using an AGSMultipartBuilder
to create or edit polygon and polyline geometries, and also get curve segments when iterating through the segments of existing AGSMultipart
geometries when this property returns YES
. You can also choose to return true curves from feature services by using AGSArcGISRuntimeEnvironment::serviceCurveGeometryMode
.
AGSGeometryBuilder::hasCurves
, AGSPart::hasCurves
, AGSSegment::curve
, AGSCubicBezierSegment
, AGSEllipticArcSegment
|
readnonatomicassigninherited |
Indicates whether this geometry contains m (measure) values.
|
readnonatomicassigninherited |
Indicates whether this geometry contains z coordinate values. Only 3D geometries contain z values.
|
readnonatomicassign |
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 will have m-values (AGSGeometry::hasM
will be YES
). 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.
AGSGeometry::hasM
to check if the geometry has measure values.
|
readnonatomicstronginherited |
The spatial reference associated with the gometry. It specifies the coordinate system for the geometry's x, y, and z coordinate values.
|
readrequirednonatomiccopyinherited |
A dictionary of values that was in the source JSON but was unparsed by API.
NSDictionary
containing the unknown JSON.
|
readnonatomiccopyinherited |
A dictionary of values that are supported by the REST API, but not exposed through the SDK API.
NSDictionary
containing the unsupported JSON.
|
readnonatomicassign |
The position along x-axis.
|
readnonatomicassign |
The position along y-axis.
|
readnonatomicassign |
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 an AGSSceneView
. 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 AGSPoint
and AGSEnvelope
. Since AGSMultipoint
, AGSPolyline
, and AGSPolygon
are created from a collection of AGSPoint
, 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 will have z-values (AGSGeometry::hasZ
will be YES
). 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 will have z-values. An AGSGeometry
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 AGSGeometry::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
.
AGSGeometry::hasZ
to check if the geometry has z values.