GPKGBoundingBox

Objective-C

@interface GPKGBoundingBox : NSObject <NSMutableCopying>

Swift

class GPKGBoundingBox : NSObject, NSMutableCopying

Bounding box with longitude and latitude range

  • Longitude range

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDecimalNumber *minLongitude;

    Swift

    var minLongitude: NSDecimalNumber! { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDecimalNumber *maxLongitude

    Swift

    var maxLongitude: NSDecimalNumber! { get set }
  • Latitude range

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDecimalNumber *minLatitude;

    Swift

    var minLatitude: NSDecimalNumber! { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDecimalNumber *maxLatitude

    Swift

    var maxLatitude: NSDecimalNumber! { get set }
  • Create a new WGS84 bounding box with world bounds (degrees)

    Declaration

    Objective-C

    + (GPKGBoundingBox *)worldWGS84;

    Swift

    class func worldWGS84() -> GPKGBoundingBox!

    Return Value

    new bounding box

  • Create a new Web Mercator bounding box with world bounds (meters)

    Declaration

    Objective-C

    + (GPKGBoundingBox *)worldWebMercator;

    Swift

    class func worldWebMercator() -> GPKGBoundingBox!

    Return Value

    new bounding box

  • Create a new WGS84 bounding box bounded by Web Mercator limits

    Declaration

    Objective-C

    + (GPKGBoundingBox *)worldWGS84WithWebMercatorLimits;

    Swift

    class func worldWGS84WithWebMercatorLimits() -> GPKGBoundingBox!

    Return Value

    new bounding box

  • Initialize with degrees representing the entire world

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    new bounding box

  • Initialize with number range

    Declaration

    Objective-C

    - (instancetype)initWithMinLongitude:(NSDecimalNumber *)minLongitude
                          andMinLatitude:(NSDecimalNumber *)minLatitude
                         andMaxLongitude:(NSDecimalNumber *)maxLongitude
                          andMaxLatitude:(NSDecimalNumber *)maxLatitude;

    Swift

    init!(minLongitude: NSDecimalNumber!, andMinLatitude minLatitude: NSDecimalNumber!, andMaxLongitude maxLongitude: NSDecimalNumber!, andMaxLatitude maxLatitude: NSDecimalNumber!)

    Parameters

    minLongitude

    minimum longitude

    minLatitude

    minimum latitude

    maxLongitude

    maximum longitude

    maxLatitude

    maximum latitude

    Return Value

    new bounding box

  • Initialize with double range

    Declaration

    Objective-C

    - (instancetype)initWithMinLongitudeDouble:(double)minLongitude
                          andMinLatitudeDouble:(double)minLatitude
                         andMaxLongitudeDouble:(double)maxLongitude
                          andMaxLatitudeDouble:(double)maxLatitude;

    Swift

    init!(minLongitudeDouble minLongitude: Double, andMinLatitudeDouble minLatitude: Double, andMaxLongitudeDouble maxLongitude: Double, andMaxLatitudeDouble maxLatitude: Double)

    Parameters

    minLongitude

    minimum longitude

    minLatitude

    minimum latitude

    maxLongitude

    maximum longitude

    maxLatitude

    maximum latitude

    Return Value

    new bounding box

  • Initialize with double range

    Declaration

    Objective-C

    - (instancetype)initWithMinLongitudeValue:(double)minLongitude
                          andMinLatitudeValue:(double)minLatitude
                         andMaxLongitudeValue:(double)maxLongitude
                          andMaxLatitudeValue:(double)maxLatitude;

    Swift

    init!(minLongitudeValue minLongitude: Double, andMinLatitudeValue minLatitude: Double, andMaxLongitudeValue maxLongitude: Double, andMaxLatitudeValue maxLatitude: Double)

    Parameters

    minLongitude

    minimum longitude

    minLatitude

    minimum latitude

    maxLongitude

    maximum longitude

    maxLatitude

    maximum latitude

    Return Value

    new bounding box

  • Initialize with existing bounding box

    Declaration

    Objective-C

    - (instancetype)initWithBoundingBox:(GPKGBoundingBox *)boundingBox;

    Swift

    init!(boundingBox: GPKGBoundingBox!)

    Parameters

    boundingBox

    bounding box

    Return Value

    new bounding box

  • Initialize with geometry envelope

    Declaration

    Objective-C

    - (instancetype)initWithEnvelope:(SFGeometryEnvelope *)envelope;

    Swift

    init!(envelope: SFGeometryEnvelope!)

    Parameters

    envelope

    geometry envelope

    Return Value

    new bounding box

  • Initialize with geometry

    Declaration

    Objective-C

    - (instancetype)initWithGeometry:(SFGeometry *)geometry;

    Swift

    init!(geometry: SFGeometry!)

    Parameters

    geometry

    geometry

    Return Value

    new bounding box

  • Get the min longitude double value

    Declaration

    Objective-C

    - (double)minLongitudeValue;

    Swift

    func minLongitudeValue() -> Double

    Return Value

    min longitude

  • Set the min longitude double value

    Declaration

    Objective-C

    - (void)setMinLongitudeValue:(double)minLongitude;

    Swift

    func setMinLongitudeValue(_ minLongitude: Double)

    Parameters

    minLongitude

    min longitude

  • Get the min latitude double value

    Declaration

    Objective-C

    - (double)minLatitudeValue;

    Swift

    func minLatitudeValue() -> Double

    Return Value

    min latitude

  • Set the min latitude double value

    Declaration

    Objective-C

    - (void)setMinLatitudeValue:(double)minLatitude;

    Swift

    func setMinLatitudeValue(_ minLatitude: Double)

    Parameters

    minLatitude

    min latitude

  • Get the max longitude double value

    Declaration

    Objective-C

    - (double)maxLongitudeValue;

    Swift

    func maxLongitudeValue() -> Double

    Return Value

    max longitude

  • Set the max longitude double value

    Declaration

    Objective-C

    - (void)setMaxLongitudeValue:(double)maxLongitude;

    Swift

    func setMaxLongitudeValue(_ maxLongitude: Double)

    Parameters

    maxLongitude

    max longitude

  • Get the max latitude double value

    Declaration

    Objective-C

    - (double)maxLatitudeValue;

    Swift

    func maxLatitudeValue() -> Double

    Return Value

    max latitude

  • Set the max latitude double value

    Declaration

    Objective-C

    - (void)setMaxLatitudeValue:(double)maxLatitude;

    Swift

    func setMaxLatitudeValue(_ maxLatitude: Double)

    Parameters

    maxLatitude

    max latitude

  • Get the longitude range

    Declaration

    Objective-C

    - (NSDecimalNumber *)longitudeRange;

    Swift

    func longitudeRange() -> NSDecimalNumber!

    Return Value

    longitude range

  • Get the longitude range

    Declaration

    Objective-C

    - (double)longitudeRangeValue;

    Swift

    func longitudeRangeValue() -> Double

    Return Value

    longitude range

  • Get the latitude range

    Declaration

    Objective-C

    - (NSDecimalNumber *)latitudeRange;

    Swift

    func latitudeRange() -> NSDecimalNumber!

    Return Value

    latitude range

  • Get the latitude range

    Declaration

    Objective-C

    - (double)latitudeRangeValue;

    Swift

    func latitudeRangeValue() -> Double

    Return Value

    latitude range

  • Get the bounding box centroid point

    Declaration

    Objective-C

    - (SFPoint *)centroid;

    Swift

    func centroid() -> SFPoint!

    Return Value

    centroid point

  • Get the bounding box centroid point

    Declaration

    Objective-C

    + (SFPoint *)centroidOfBoundingBox:(GPKGBoundingBox *)boundingBox;

    Swift

    class func centroid(of boundingBox: GPKGBoundingBox!) -> SFPoint!

    Parameters

    boundingBox

    bounding box

    Return Value

    centroid point

  • Get the centroid for the bounding box and projection

    Declaration

    Objective-C

    - (SFPoint *)centroidInProjection:(PROJProjection *)projection;

    Swift

    func centroid(in projection: PROJProjection!) -> SFPoint!

    Parameters

    projection

    projection of the bounding box

    Return Value

    centroid point

  • Get the centroid for the bounding box and projection

    Declaration

    Objective-C

    + (SFPoint *)centroidOfBoundingBox:(GPKGBoundingBox *)boundingBox
                          inProjection:(PROJProjection *)projection;

    Swift

    class func centroid(of boundingBox: GPKGBoundingBox!, in projection: PROJProjection!) -> SFPoint!

    Parameters

    boundingBox

    bounding box

    projection

    projection of the bounding box

    Return Value

    centroid point

  • Get the centroid for the bounding box in degrees

    Declaration

    Objective-C

    - (SFPoint *)degreesCentroid;

    Swift

    func degreesCentroid() -> SFPoint!

    Return Value

    centroid point

  • Get the centroid for a bounding box in degrees

    Declaration

    Objective-C

    + (SFPoint *)degreesCentroidOfBoundingBox:(GPKGBoundingBox *)boundingBox;

    Swift

    class func degreesCentroid(of boundingBox: GPKGBoundingBox!) -> SFPoint!

    Parameters

    boundingBox

    bounding box in degrees

    Return Value

    centroid point

  • Build a Geometry Envelope from the bounding box

    Declaration

    Objective-C

    - (SFGeometryEnvelope *)buildEnvelope;

    Swift

    func buildEnvelope() -> SFGeometryEnvelope!

    Return Value

    geometry envelope

  • Build a Geometry Envelope from the bounding box

    Declaration

    Objective-C

    + (SFGeometryEnvelope *)buildEnvelopeFromBoundingBox:
        (GPKGBoundingBox *)boundingBox;

    Swift

    class func buildEnvelope(from boundingBox: GPKGBoundingBox!) -> SFGeometryEnvelope!

    Parameters

    boundingBox

    bounding box

    Return Value

    geometry envelope

  • Build a geometry representation of the bounding box

    Declaration

    Objective-C

    - (SFGeometry *)buildGeometry;

    Swift

    func buildGeometry() -> SFGeometry!

    Return Value

    geometry, polygon or point

  • Build a geometry representation of the bounding box

    Declaration

    Objective-C

    + (SFGeometry *)buildGeometryFromBoundingBox:(GPKGBoundingBox *)boundingBox;

    Swift

    class func buildGeometry(from boundingBox: GPKGBoundingBox!) -> SFGeometry!

    Parameters

    boundingBox

    bounding box

    Return Value

    geometry, polygon or point

  • Determine if equal to the provided bounding box

    Declaration

    Objective-C

    - (BOOL)equals:(GPKGBoundingBox *)boundingBox;

    Swift

    func equals(_ boundingBox: GPKGBoundingBox!) -> Bool

    Parameters

    boundingBox

    bounding box

    Return Value

    true if equal, false if not

  • Get a Map Rectangle representing the bounding box

    Declaration

    Objective-C

    - (MKMapRect)mapRect;

    Swift

    func mapRect() -> MKMapRect

    Return Value

    map rectangle

  • Get a Coordinate Region of the bounding box

    Declaration

    Objective-C

    - (MKCoordinateRegion)coordinateRegion;

    Swift

    func coordinateRegion() -> MKCoordinateRegion

    Return Value

    Coordinate Region

  • Get the Span of the bounding box

    Declaration

    Objective-C

    - (MKCoordinateSpan)span;

    Swift

    func span() -> MKCoordinateSpan

    Return Value

    Span

  • Get the center of the bounding box

    Declaration

    Objective-C

    - (CLLocationCoordinate2D)center;

    Swift

    func center() -> CLLocationCoordinate2D

    Return Value

    center location

  • Get with width and height of the bounding box in meters

    Declaration

    Objective-C

    - (struct GPKGBoundingBoxSize)sizeInMeters;

    Swift

    func sizeInMeters() -> GPKGBoundingBoxSize

    Return Value

    bounding box size

  • If the bounding box spans the Anti-Meridian, attempt to get a complementary bounding box using the max longitude of the unit projection

    Declaration

    Objective-C

    - (GPKGBoundingBox *)complementaryWithMaxLongitude:
        (double)maxProjectionLongitude;

    Swift

    func complementary(withMaxLongitude maxProjectionLongitude: Double) -> GPKGBoundingBox!

    Parameters

    maxProjectionLongitude

    max longitude of the world for the current bounding box units

    Return Value

    complementary bounding box or nil if none

  • If the bounding box spans the Anti-Meridian, attempt to get a complementary WGS84 bounding box

    Declaration

    Objective-C

    - (GPKGBoundingBox *)complementaryWgs84;

    Swift

    func complementaryWgs84() -> GPKGBoundingBox!

    Return Value

    complementary bounding box or nil if none

  • If the bounding box spans the Anti-Meridian, attempt to get a complementary Web Mercator bounding box

    Declaration

    Objective-C

    - (GPKGBoundingBox *)complementaryWebMercator;

    Swift

    func complementaryWebMercator() -> GPKGBoundingBox!

    Return Value

    complementary bounding box or nil if none

  • Bound the bounding box longitudes within the min and max possible projection values. This may result in a max longitude numerically lower than the min longitude.

    Declaration

    Objective-C

    - (GPKGBoundingBox *)boundCoordinatesWithMaxLongitude:
        (double)maxProjectionLongitude;

    Swift

    func boundCoordinates(withMaxLongitude maxProjectionLongitude: Double) -> GPKGBoundingBox!

    Parameters

    maxProjectionLongitude

    max longitude of the world for the current bounding box units

    Return Value

    bounded bounding box

  • Bound the bounding box coordinates within WGS84 range values

    Declaration

    Objective-C

    - (GPKGBoundingBox *)boundWgs84Coordinates;

    Swift

    func boundWgs84Coordinates() -> GPKGBoundingBox!

    Return Value

    bounded bounding box

  • Bound the bounding box coordinates within Web Mercator range values

    Declaration

    Objective-C

    - (GPKGBoundingBox *)boundWebMercatorCoordinates;

    Swift

    func boundWebMercatorCoordinates() -> GPKGBoundingBox!

    Return Value

    bounded bounding box

  • Expand the bounding box max longitude above the max possible projection value if needed to create a bounding box where the max longitude is numerically larger than the min longitude.

    Declaration

    Objective-C

    - (GPKGBoundingBox *)expandCoordinatesWithMaxLongitude:
        (double)maxProjectionLongitude;

    Swift

    func expandCoordinates(withMaxLongitude maxProjectionLongitude: Double) -> GPKGBoundingBox!

    Parameters

    maxProjectionLongitude

    max longitude of the world for the current bounding box units

    Return Value

    expanded bounding box

  • Expand the bounding box max longitude above the max WGS84 projection value if needed to create a bounding box where the max longitude is numerically larger than the min longitude.

    Declaration

    Objective-C

    - (GPKGBoundingBox *)expandWgs84Coordinates;

    Swift

    func expandWgs84Coordinates() -> GPKGBoundingBox!

    Return Value

    expanded bounding box

  • Expand the bounding box max longitude above the max Web Mercator projection value if needed to create a bounding box where the max longitude is numerically larger than the min longitude.

    Declaration

    Objective-C

    - (GPKGBoundingBox *)expandWebMercatorCoordinates;

    Swift

    func expandWebMercatorCoordinates() -> GPKGBoundingBox!

    Return Value

    expanded bounding box

  • Transform the bounding box using the provided projection transform

    Declaration

    Objective-C

    - (GPKGBoundingBox *)transform:(SFPGeometryTransform *)transform;

    Swift

    func transform(_ transform: SFPGeometryTransform!) -> GPKGBoundingBox!

    Parameters

    transform

    geometry transform

    Return Value

    transformed bounding box

  • Determine if intersects with the provided bounding box

    Declaration

    Objective-C

    - (BOOL)intersects:(GPKGBoundingBox *)boundingBox;

    Swift

    func intersects(_ boundingBox: GPKGBoundingBox!) -> Bool

    Parameters

    boundingBox

    bounding box

    Return Value

    true if intersects

  • Determine if intersects with the provided bounding box

    Declaration

    Objective-C

    - (BOOL)intersects:(GPKGBoundingBox *)boundingBox
        withAllowEmpty:(BOOL)allowEmpty;

    Swift

    func intersects(_ boundingBox: GPKGBoundingBox!, withAllowEmpty allowEmpty: Bool) -> Bool

    Parameters

    boundingBox

    bounding box

    allowEmpty

    allow empty ranges when determining intersection

    Return Value

    true if intersects

  • Get the overlapping bounding box with the provided bounding box

    Declaration

    Objective-C

    - (GPKGBoundingBox *)overlap:(GPKGBoundingBox *)boundingBox;

    Swift

    func overlap(_ boundingBox: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    Return Value

    bounding box

  • Get the overlapping bounding box with the provided bounding box

    Declaration

    Objective-C

    - (GPKGBoundingBox *)overlap:(GPKGBoundingBox *)boundingBox
                  withAllowEmpty:(BOOL)allowEmpty;

    Swift

    func overlap(_ boundingBox: GPKGBoundingBox!, withAllowEmpty allowEmpty: Bool) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    allowEmpty

    allow empty ranges when determining overlap

    Return Value

    bounding box

  • Get the union bounding box with the provided bounding box

    Declaration

    Objective-C

    - (GPKGBoundingBox *)union:(GPKGBoundingBox *)boundingBox;

    Swift

    func union(_ boundingBox: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    Return Value

    bounding box

  • Determine if inclusively contains the provided bounding box

    Declaration

    Objective-C

    - (BOOL)contains:(GPKGBoundingBox *)boundingBox;

    Swift

    func contains(_ boundingBox: GPKGBoundingBox!) -> Bool

    Parameters

    boundingBox

    bounding box

    Return Value

    true if contains

  • Expand the bounding box to an equally sized width and height bounding box

    Declaration

    Objective-C

    - (GPKGBoundingBox *)squareExpand;

    Swift

    func squareExpand() -> GPKGBoundingBox!

    Return Value

    new square expanded bounding box

  • Expand the bounding box to an equally sized width and height bounding box with optional empty edge buffer

    Declaration

    Objective-C

    - (GPKGBoundingBox *)squareExpandWithBuffer:(double)bufferPercentage;

    Swift

    func squareExpand(withBuffer bufferPercentage: Double) -> GPKGBoundingBox!

    Parameters

    bufferPercentage

    bounding box edge buffer percentage. A value of 0.1 adds a 10% buffer on each side of the squared bounding box.

    Return Value

    new square expanded bounding box

  • Determine if the bounding box is of a single point

    Declaration

    Objective-C

    - (BOOL)isPoint;

    Swift

    func isPoint() -> Bool

    Return Value

    true if a single point bounds