ArcGIS Runtime SDK for iOS: AGSEnvelope Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSEnvelope Class Reference

Description

A geometry that represents a rectangular shape.

An AGSEnvelope is an axis-aligned box described by the coordinates of the lower left corner and the coordinates of the upper right corner. They are commonly used to represent the spatial extent covered by layers or other geometries, or to define an area of interest. They can be used as the geometry for a graphic and as an input for many spatial operations. Although they both represent a geographic area, an AGSEnvelope is distinct from an AGSPolygon, and they cannot always be used interchangeably.

New instances of AGSEnvelope are defined by specifying a minimum and maximum x-coordinate and minimum and maximum y-coordinate, and an AGSSpatialReference. Optionally, a minimum and maximum z-value can be specified to define the depth of the envelope.

See also
AGSGeometry
Since
100
Note
This class represents an immutable envelope geometry, it cannot be modified after being created. Use toBuilder (AGSEnvelope): to get an envelope builder using a copy of this geometry as a starting off point. The builder can then be modified to produce a new geometry.
See also
AGSEnvelopeBuilder to construct or modify envelopes programmatically.
AGSSketchEditor to construct or modify geometries interactively by sketching on a map.
AGSGeometryEngine to perform operations on geometries.
Inheritance diagram for AGSEnvelope:
AGSGeometry AGSObject <AGSJSONSerializable>

Instance Methods

(instancetype) - initWithCenter:width:height:
 
(instancetype) - initWithCenter:width:height:depth:
 
(instancetype) - initWithMin:max:
 
(instancetype) - initWithXMin:yMin:mMin:xMax:yMax:mMax:spatialReference:
 
(instancetype) - initWithXMin:yMin:xMax:yMax:spatialReference:
 
(instancetype) - initWithXMin:yMin:zMin:mMin:xMax:yMax:zMax:mMax:spatialReference:
 
(instancetype) - initWithXMin:yMin:zMin:xMax:yMax:zMax:spatialReference:
 
(BOOL) - isEqualToGeometry:
 
(BOOL) - isEqualToGeometry:
 
(BOOL) - isEqualToGeometry:tolerance:
 
(AGSEnvelopeBuilder *) - toBuilder
 
(nullable id) - toJSON:
 

Class Methods

(instancetype) + envelopeWithCenter:width:height:
 
(instancetype) + envelopeWithCenter:width:height:depth:
 
(instancetype) + envelopeWithMin:max:
 
(instancetype) + envelopeWithXMin:yMin:mMin:xMax:yMax:mMax:spatialReference:
 
(instancetype) + envelopeWithXMin:yMin:xMax:yMax:spatialReference:
 
(instancetype) + envelopeWithXMin:yMin:zMin:mMin:xMax:yMax:zMax:mMax:spatialReference:
 
(instancetype) + envelopeWithXMin:yMin:zMin:xMax:yMax:zMax:spatialReference:
 
(nullable id< AGSJSONSerializable >) + fromJSON:error:
 

Properties

AGSPointcenter
 
double depth
 
AGSGeometryDimension dimension
 
BOOL empty
 
AGSEnvelopeextent
 
AGSGeometryType geometryType
 
BOOL hasCurves
 
BOOL hasM
 
BOOL hasZ
 
double height
 
double mMax
 
double mMin
 
AGSSpatialReferencespatialReference
 
NSDictionary< NSString *, id > * unknownJSON
 
NSDictionary< NSString *, id > * unsupportedJSON
 
double width
 
double xMax
 
double xMin
 
double yMax
 
double yMin
 
double zMax
 
double zMin
 

Method Documentation

◆ envelopeWithCenter:width:height:

+ (instancetype) envelopeWithCenter: (AGSPoint *)  center
width: (double)  width
height: (double)  height 

◆ envelopeWithCenter:width:height:depth:

+ (instancetype) envelopeWithCenter: (AGSPoint *)  center
width: (double)  width
height: (double)  height
depth: (double)  depth 

◆ envelopeWithMin:max:

+ (instancetype) envelopeWithMin: (AGSPoint *)  min
max: (AGSPoint *)  max 

Initializes an envelope geometry with the provided min and max points.

Parameters
minThe min coordinate along x-axis (lower left corner)
maxThe min coordinate along y-axis (lower left corner)
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ envelopeWithXMin:yMin:mMin:xMax:yMax:mMax:spatialReference:

+ (instancetype) envelopeWithXMin: (double)  xMin
yMin: (double)  yMin
mMin: (double)  mMin
xMax: (double)  xMax
yMax: (double)  yMax
mMax: (double)  mMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
mMinThe min measure value
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
mMaxThe max measure value
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ envelopeWithXMin:yMin:xMax:yMax:spatialReference:

+ (instancetype) envelopeWithXMin: (double)  xMin
yMin: (double)  yMin
xMax: (double)  xMax
yMax: (double)  yMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ envelopeWithXMin:yMin:zMin:mMin:xMax:yMax:zMax:mMax:spatialReference:

+ (instancetype) envelopeWithXMin: (double)  xMin
yMin: (double)  yMin
zMin: (double)  zMin
mMin: (double)  mMin
xMax: (double)  xMax
yMax: (double)  yMax
zMax: (double)  zMax
mMax: (double)  mMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
zMinThe min coordinate along z-axis
mMinThe min measure value
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
zMaxThe max coordinate along z-axis
mMaxThe max measure value
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ envelopeWithXMin:yMin:zMin:xMax:yMax:zMax:spatialReference:

+ (instancetype) envelopeWithXMin: (double)  xMin
yMin: (double)  yMin
zMin: (double)  zMin
xMax: (double)  xMax
yMax: (double)  yMax
zMax: (double)  zMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
zMinThe min coordinate along z-axis
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
zMaxThe max coordinate along z-axis
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ fromJSON:error:

+ (nullable id<AGSJSONSerializable>) fromJSON: (id)  JSONObject
error: (NSError **)  error 
staticrequiredinherited

Initializes and returns an object from its JSON representation.

Parameters
JSONObjectNSDictionary or NSArray containing the JSON.
errorencountered during the operation, if any.
Since
100

◆ initWithCenter:width:height:

- (instancetype) initWithCenter: (AGSPoint *)  center
width: (double)  width
height: (double)  height 

Initializes an envelope geometry with the provided center and dimensions.

Parameters
centerThe coorinates of the envelope's center
widthof the envelope (in units specified by the center's spatial reference)
heightof the envelope (in units specified by the center's spatial reference)
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100.1

◆ initWithCenter:width:height:depth:

- (instancetype) initWithCenter: (AGSPoint *)  center
width: (double)  width
height: (double)  height
depth: (double)  depth 

Initializes an envelope geometry with the provided center and dimensions.

Parameters
centerThe coorinates of the envelope's center
widthof the envelope (in units specified by the center's spatial reference)
heightof the envelope (in units specified by the center's spatial reference)
depthof the envelope (in meters)
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100.1

◆ initWithMin:max:

- (instancetype) initWithMin: (AGSPoint *)  min
max: (AGSPoint *)  max 

Initializes an envelope geometry with the provided min and max points.

The spatial reference of both input points must match and will be the spatial reference of the resulting envelope. The min and max points can be any opposing corners of the envelope and the resulting envelope will always have min less than or equal to max.

Parameters
minThe min corner of the envelope
maxThe max corner of the envelope
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ initWithXMin:yMin:mMin:xMax:yMax:mMax:spatialReference:

- (instancetype) initWithXMin: (double)  xMin
yMin: (double)  yMin
mMin: (double)  mMin
xMax: (double)  xMax
yMax: (double)  yMax
mMax: (double)  mMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
mMinThe min measure value
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
mMaxThe max measure value
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ initWithXMin:yMin:xMax:yMax:spatialReference:

- (instancetype) initWithXMin: (double)  xMin
yMin: (double)  yMin
xMax: (double)  xMax
yMax: (double)  yMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ initWithXMin:yMin:zMin:mMin:xMax:yMax:zMax:mMax:spatialReference:

- (instancetype) initWithXMin: (double)  xMin
yMin: (double)  yMin
zMin: (double)  zMin
mMin: (double)  mMin
xMax: (double)  xMax
yMax: (double)  yMax
zMax: (double)  zMax
mMax: (double)  mMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
zMinThe min coordinate along z-axis
mMinThe min measure value
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
zMaxThe max coordinate along z-axis
mMaxThe max measure value
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ initWithXMin:yMin:zMin:xMax:yMax:zMax:spatialReference:

- (instancetype) initWithXMin: (double)  xMin
yMin: (double)  yMin
zMin: (double)  zMin
xMax: (double)  xMax
yMax: (double)  yMax
zMax: (double)  zMax
spatialReference: (nullable AGSSpatialReference *)  spatialReference 

Initializes an envelope geometry with the provided coordinate values.

Parameters
xMinThe min coordinate along x-axis (lower left corner)
yMinThe min coordinate along y-axis (lower left corner)
zMinThe min coordinate along z-axis
xMaxThe max coordinate along x-axis (upper right corner)
yMaxThe max coordinate along y-axis (upper right corner)
zMaxThe max coordinate along z-axis
spatialReferenceThe coordinate system that the coordinate values use.
Returns
An initialized envelope geometry
Note
The envelope geometry is immutable, it cannot be modified after being created. Use toBuilder: to get a builder to further modify the geometry.
Since
100

◆ isEqualToGeometry: [1/2]

- (BOOL) isEqualToGeometry: (AGSEnvelope *)  other

Compares whether two envelope geometries are equal.

Parameters
otherenvelope to compare this envelope to
Returns
YES if the envelopes are equal
Since
100

◆ isEqualToGeometry: [2/2]

- (BOOL) isEqualToGeometry: (AGSGeometry *)  other

Compares whether two geometries are equal.

Parameters
otherThe other geometry object to compare this geometry object to.
Returns
YES if the geometries are equal.
Since
100

◆ isEqualToGeometry:tolerance:

- (BOOL) isEqualToGeometry: (AGSGeometry *)  other
tolerance: (double)  tolerance 

Compares two geometry objects for equality to within some tolerance.

Parameters
otherThe other geometry object to compare this geometry object to.
toleranceThe tolerance.
Returns
YES if the geometries are equal within the given tolerance, otherwise NO.
Since
100

◆ toBuilder

- (AGSEnvelopeBuilder*) toBuilder

Returns a builder using a copy of this geometry as a starting off point. The builder can then be modified to produce a new geometry.

Returns
builder that can be used to build envelope geometries.
Since
100
Note
Operations on the builder affect only its own internal copy of the geometry. They do not affect this geometry.

Implements AGSGeometry.

◆ toJSON:

- (nullable id) toJSON: (NSError **)  error
requiredinherited

Returns JSON representation for this object.

Parameters
errorencountered during the operation, if any.
Returns
NSDictionary or NSArray containing the JSON.
Since
100

Reimplemented in AGSPortalItem.

Property Documentation

◆ center

- (AGSPoint*) center
readnonatomicstrong

The geographic center of the envelope.

Since
100

◆ depth

- (double) depth
readnonatomicassign

◆ dimension

- (AGSGeometryDimension) dimension
readnonatomicassigninherited

The dimension of this geometry object.

Note
The property will be AGSGeometryDimension::AGSGeometryDimensionUnknown if an error occurs.
Since
100

◆ empty

- (BOOL) empty
readnonatomicassigninherited

Indicates whether this geometry has any vertices.

Since
100

◆ extent

- (AGSEnvelope*) extent
readnonatomicstronginherited

Smallest, rectangular bounding-box that covers the geometry.

Since
100

◆ geometryType

- (AGSGeometryType) geometryType
readnonatomicassigninherited

The type of this geometry.

Since
100

◆ hasCurves

- (BOOL) hasCurves
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.

See also
AGSGeometryBuilder::hasCurves, AGSPart::hasCurves, AGSSegment::curve, AGSCubicBezierSegment, AGSEllipticArcSegment
Since
100

◆ hasM

- (BOOL) hasM
readnonatomicassigninherited

Indicates whether this geometry contains m (measure) values.

Since
100

◆ hasZ

- (BOOL) hasZ
readnonatomicassigninherited

Indicates whether this geometry contains z coordinate values. Only 3D geometries contain z values.

Since
100

◆ height

- (double) height
readnonatomicassign

The height of the envelope (along y-axis)

Since
100

◆ mMax

- (double) mMax
readnonatomicassign

The max measure value.

Since
100
See also
AGSGeometry::hasM to check if the geometry has measure values.

◆ mMin

- (double) mMin
readnonatomicassign

The min measure value.

Since
100
See also
AGSGeometry::hasM to check if the geometry has measure values.

◆ spatialReference

- (AGSSpatialReference*) spatialReference
readnonatomicstronginherited

The spatial reference associated with the gometry. It specifies the coordinate system for the geometry's x, y, and z coordinate values.

Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

◆ unknownJSON

- (NSDictionary<NSString*,id>*) unknownJSON
readrequirednonatomiccopyinherited

A dictionary of values that was in the source JSON but was unparsed by API.

Returns
NSDictionary containing the unknown JSON.
Since
100

◆ unsupportedJSON

- (NSDictionary<NSString*,id>*) unsupportedJSON
readnonatomiccopyinherited

A dictionary of values that are supported by the REST API, but not exposed through the SDK API.

Returns
NSDictionary containing the unsupported JSON.
Since
100

◆ width

- (double) width
readnonatomicassign

The width of the envelope (along x-axis).

Since
100

◆ xMax

- (double) xMax
readnonatomicassign

The max coordinate along x-axis (upper right corner)

Since
100

◆ xMin

- (double) xMin
readnonatomicassign

The min coordinate along x-axis (lower left corner)

Since
100

◆ yMax

- (double) yMax
readnonatomicassign

The max coordinate along y-axis (upper right corner)

Since
100

◆ yMin

- (double) yMin
readnonatomicassign

The min coordinate along y-axis (lower left corner)

Since
100

◆ zMax

- (double) zMax
readnonatomicassign

The max coordinate along z-axis. Only applicable for 3D envelope geometries.

Since
100
See also
AGSGeometry::hasZ to check if the geometry has z-values.

◆ zMin

- (double) zMin
readnonatomicassign

The min coordinate along z-axis. Only applicable for 3D envelope geometries.

Since
100
See also
AGSGeometry::hasZ to check if the geometry has z-values.