GPKGTileBoundingBoxUtils

Objective-C

@interface GPKGTileBoundingBoxUtils : NSObject

Swift

class GPKGTileBoundingBoxUtils : NSObject

Tile Bounding Box utility methods

  • Get the overlapping bounding box between the two bounding boxes

    Declaration

    Objective-C

    + (GPKGBoundingBox *)overlapWithBoundingBox:(GPKGBoundingBox *)boundingBox
                                 andBoundingBox:(GPKGBoundingBox *)boundingBox2;

    Swift

    class func overlap(with boundingBox: GPKGBoundingBox!, andBoundingBox boundingBox2: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    boundingBox2

    bounding box 2

    Return Value

    bounding box

  • Get the overlapping bounding box between the two bounding boxes

    Declaration

    Objective-C

    + (GPKGBoundingBox *)overlapWithBoundingBox:(GPKGBoundingBox *)boundingBox
                                 andBoundingBox:(GPKGBoundingBox *)boundingBox2
                                  andAllowEmpty:(BOOL)allowEmpty;

    Swift

    class func overlap(with boundingBox: GPKGBoundingBox!, andBoundingBox boundingBox2: GPKGBoundingBox!, andAllowEmpty allowEmpty: Bool) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    boundingBox2

    bounding box 2

    allowEmpty

    allow empty latitude and/or longitude ranges when determining overlap

    Return Value

    bounding box

  • Get the overlapping bounding box between the two bounding boxes adjusting the second box to an Anti-Meridian complementary version based upon the max longitude

    Declaration

    Objective-C

    + (GPKGBoundingBox *)overlapWithBoundingBox:(GPKGBoundingBox *)boundingBox
                                 andBoundingBox:(GPKGBoundingBox *)boundingBox2
                               withMaxLongitude:(double)maxLongitude;

    Swift

    class func overlap(with boundingBox: GPKGBoundingBox!, andBoundingBox boundingBox2: GPKGBoundingBox!, withMaxLongitude maxLongitude: Double) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    boundingBox2

    bounding box 2

    maxLongitude

    max longitude of the world for the current bounding box units

    Return Value

    bounding box

  • Get the overlapping bounding box between the two bounding boxes adjusting the second box to an Anti-Meridian complementary version based upon the max longitude

    Declaration

    Objective-C

    + (GPKGBoundingBox *)overlapWithBoundingBox:(GPKGBoundingBox *)boundingBox
                                 andBoundingBox:(GPKGBoundingBox *)boundingBox2
                               withMaxLongitude:(double)maxLongitude
                                  andAllowEmpty:(BOOL)allowEmpty;

    Swift

    class func overlap(with boundingBox: GPKGBoundingBox!, andBoundingBox boundingBox2: GPKGBoundingBox!, withMaxLongitude maxLongitude: Double, andAllowEmpty allowEmpty: Bool) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    boundingBox2

    bounding box 2

    maxLongitude

    max longitude of the world for the current bounding box units

    allowEmpty

    allow empty latitude and/or longitude ranges when determining overlap

    Return Value

    bounding box

  • Determine if the point is within the bounding box

    Declaration

    Objective-C

    + (BOOL)isPoint:(SFPoint *)point inBoundingBox:(GPKGBoundingBox *)boundingBox;

    Swift

    class func isPoint(_ point: SFPoint!, in boundingBox: GPKGBoundingBox!) -> Bool

    Parameters

    point

    bounding box

    boundingBox

    bounding box

    Return Value

    YES if within the bounding box

  • Determine if the point is within the bounding box

    Declaration

    Objective-C

    + (BOOL)isPoint:(SFPoint *)point
           inBoundingBox:(GPKGBoundingBox *)boundingBox
        withMaxLongitude:(double)maxLongitude;

    Swift

    class func isPoint(_ point: SFPoint!, in boundingBox: GPKGBoundingBox!, withMaxLongitude maxLongitude: Double) -> Bool

    Parameters

    point

    bounding box

    boundingBox

    bounding box

    maxLongitude

    max longitude of the world for the current bounding box units

    Return Value

    YES if within the bounding box

  • Get the union bounding box combining the two bounding boxes

    Declaration

    Objective-C

    + (GPKGBoundingBox *)unionWithBoundingBox:(GPKGBoundingBox *)boundingBox
                               andBoundingBox:(GPKGBoundingBox *)boundingBox2;

    Swift

    class func union(with boundingBox: GPKGBoundingBox!, andBoundingBox boundingBox2: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    boundingBox2

    bounding box 2

    Return Value

    bounding box

  • Get the X pixel for where the longitude fits into the bounding box

    Declaration

    Objective-C

    + (double)xPixelWithWidth:(int)width
               andBoundingBox:(GPKGBoundingBox *)boundingBox
                 andLongitude:(double)longitude;

    Swift

    class func xPixel(withWidth width: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andLongitude longitude: Double) -> Double

    Parameters

    width

    width

    boundingBox

    bounding box

    longitude

    longitude

    Return Value

    x pixel

  • Get the longitude from the pixel location, bounding box, and image width

    Declaration

    Objective-C

    + (double)longitudeFromPixelWithWidth:(int)width
                           andBoundingBox:(GPKGBoundingBox *)boundingBox
                                 andPixel:(double)pixel;

    Swift

    class func longitudeFromPixel(withWidth width: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andPixel pixel: Double) -> Double

    Parameters

    width

    width

    boundingBox

    bounding box

    pixel

    x pixel

    Return Value

    longitude

  • Get the longitude from the pixel location, bounding box, tile bounding box (when different from bounding box), and image width

    Declaration

    Objective-C

    + (double)longitudeFromPixelWithWidth:(int)width
                           andBoundingBox:(GPKGBoundingBox *)boundingBox
                       andTileBoundingBox:(GPKGBoundingBox *)tileBoundingBox
                                 andPixel:(double)pixel;

    Swift

    class func longitudeFromPixel(withWidth width: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andTileBoundingBox tileBoundingBox: GPKGBoundingBox!, andPixel pixel: Double) -> Double

    Parameters

    width

    width

    boundingBox

    bounding box

    tileBoundingBox

    tile bounding box

    pixel

    x pixel

    Return Value

    longitude

  • Get the Y pixel for where the latitude fits into the bounding box

    Declaration

    Objective-C

    + (double)yPixelWithHeight:(int)height
                andBoundingBox:(GPKGBoundingBox *)boundingBox
                   andLatitude:(double)latitude;

    Swift

    class func yPixel(withHeight height: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andLatitude latitude: Double) -> Double

    Parameters

    height

    height

    boundingBox

    bounding box

    latitude

    latitude

    Return Value

    y pixel

  • Get the latitude from the pixel location, bounding box, and image height

    Declaration

    Objective-C

    + (double)latitudeFromPixelWithHeight:(int)height
                           andBoundingBox:(GPKGBoundingBox *)boundingBox
                                 andPixel:(double)pixel;

    Swift

    class func latitudeFromPixel(withHeight height: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andPixel pixel: Double) -> Double

    Parameters

    height

    height

    boundingBox

    bounding box

    pixel

    y pixel

    Return Value

    latitude

  • Get the latitude from the pixel location, bounding box, tile bounding box (when different from bounding box), and image height

    Declaration

    Objective-C

    + (double)latitudeFromPixelWithHeight:(int)height
                           andBoundingBox:(GPKGBoundingBox *)boundingBox
                       andTileBoundingBox:(GPKGBoundingBox *)tileBoundingBox
                                 andPixel:(double)pixel;

    Swift

    class func latitudeFromPixel(withHeight height: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andTileBoundingBox tileBoundingBox: GPKGBoundingBox!, andPixel pixel: Double) -> Double

    Parameters

    height

    height

    boundingBox

    bounding box

    tileBoundingBox

    tile bounding box

    pixel

    y pixel

    Return Value

    latitude

  • Get the tile bounding box from the XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundingBoxWithX:(int)x andY:(int)y andZoom:(int)zoom;

    Swift

    class func boundingBoxWith(x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Web Mercator tile bounding box from the XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)webMercatorBoundingBoxWithX:(int)x
                                                andY:(int)y
                                             andZoom:(int)zoom;

    Swift

    class func webMercatorBoundingBoxWith(x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    web mercator bounding box

  • Get the Web Mercator tile bounding box from the XYZ tile grid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)webMercatorBoundingBoxWithTileGrid:(GPKGTileGrid *)tileGrid
                                                    andZoom:(int)zoom;

    Swift

    class func webMercatorBoundingBox(with tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    tileGrid

    tile grid

    zoom

    zoom

    Return Value

    web mercator bounding box

  • Get the Projected tile bounding box from the XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxWithEpsg:(NSNumber *)epsg
                                                 andX:(int)x
                                                 andY:(int)y
                                              andZoom:(int)zoom;

    Swift

    class func projectedBoundingBox(withEpsg epsg: NSNumber!, andX x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    epsg

    epsg code

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxWithAuthority:(NSString *)authority
                                                   andCode:(NSNumber *)code
                                                      andX:(int)x
                                                      andY:(int)y
                                                   andZoom:(int)zoom;

    Swift

    class func projectedBoundingBox(withAuthority authority: String!, andCode code: NSNumber!, andX x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    authority

    projection authority

    code

    authority code

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxWithProjection:
                             (PROJProjection *)projection
                                                       andX:(int)x
                                                       andY:(int)y
                                                    andZoom:(int)zoom;

    Swift

    class func projectedBoundingBox(with projection: PROJProjection!, andX x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    projection

    projection

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the XYZ tile tileGrid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxWithEpsg:(NSNumber *)epsg
                                          andTileGrid:(GPKGTileGrid *)tileGrid
                                              andZoom:(int)zoom;

    Swift

    class func projectedBoundingBox(withEpsg epsg: NSNumber!, andTileGrid tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    epsg

    epsg code

    tileGrid

    tile grid

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the XYZ tile tileGrid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxWithAuthority:(NSString *)authority
                                                   andCode:(NSNumber *)code
                                               andTileGrid:(GPKGTileGrid *)tileGrid
                                                   andZoom:(int)zoom;

    Swift

    class func projectedBoundingBox(withAuthority authority: String!, andCode code: NSNumber!, andTileGrid tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    authority

    projection authority

    code

    authority code

    tileGrid

    tile grid

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the XYZ tile tileGrid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxWithProjection:
                             (PROJProjection *)projection
                                                andTileGrid:(GPKGTileGrid *)tileGrid
                                                    andZoom:(int)zoom;

    Swift

    class func projectedBoundingBox(with projection: PROJProjection!, andTileGrid tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    projection

    projection

    tileGrid

    tile grid

    zoom

    zoom level

    Return Value

    bounding box

  • Get the WGS84 tile bounding box from the XYZ tile tileGrid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundingBoxAsWGS84WithTileGrid:(GPKGTileGrid *)tileGrid
                                                andZoom:(int)zoom;

    Swift

    class func boundingBoxAsWGS84(with tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    tileGrid

    tile grid

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxFromWGS84WithEpsg:(NSNumber *)epsg
                                                          andX:(int)x
                                                          andY:(int)y
                                                       andZoom:(int)zoom;

    Swift

    class func projectedBoundingBoxFromWGS84(withEpsg epsg: NSNumber!, andX x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    epsg

    epsg code

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxFromWGS84WithAuthority:
                             (NSString *)authority
                                                            andCode:(NSNumber *)code
                                                               andX:(int)x
                                                               andY:(int)y
                                                            andZoom:(int)zoom;

    Swift

    class func projectedBoundingBoxFromWGS84(withAuthority authority: String!, andCode code: NSNumber!, andX x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    authority

    projection authority

    code

    authority code

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxFromWGS84WithProjection:
                             (PROJProjection *)projection
                                                                andX:(int)x
                                                                andY:(int)y
                                                             andZoom:(int)zoom;

    Swift

    class func projectedBoundingBoxFromWGS84(with projection: PROJProjection!, andX x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    projection

    projection

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)projectedBoundingBoxFromWGS84WithEpsg:(NSNumber *)epsg
                                                   andTileGrid:
                                                       (GPKGTileGrid *)tileGrid
                                                       andZoom:(int)zoom;

    Swift

    class func projectedBoundingBoxFromWGS84(withEpsg epsg: NSNumber!, andTileGrid tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    epsg

    epsg code

    tileGrid

    tile grid

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)
        projectedBoundingBoxFromWGS84WithAuthority:(NSString *)authority
                                           andCode:(NSNumber *)code
                                       andTileGrid:(GPKGTileGrid *)tileGrid
                                           andZoom:(int)zoom;

    Swift

    class func projectedBoundingBoxFromWGS84(withAuthority authority: String!, andCode code: NSNumber!, andTileGrid tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    authority

    projection authority

    code

    authority code

    tileGrid

    tile grid

    zoom

    zoom level

    Return Value

    bounding box

  • Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)
        projectedBoundingBoxFromWGS84WithProjection:(PROJProjection *)projection
                                        andTileGrid:(GPKGTileGrid *)tileGrid
                                            andZoom:(int)zoom;

    Swift

    class func projectedBoundingBoxFromWGS84(with projection: PROJProjection!, andTileGrid tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    projection

    projection

    tileGrid

    tile grid

    zoom

    zoom level

    Return Value

    bounding box

  • Get the tile grid for the location specified as WGS84

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridFromWGS84Point:(SFPoint *)point andZoom:(int)zoom;

    Swift

    class func tileGrid(fromWGS84Point point: SFPoint!, andZoom zoom: Int32) -> GPKGTileGrid!

    Parameters

    point

    WGS84 point

    zoom

    zoom level

    Return Value

    tile grid

  • Get the tile grid for the location specified as the projection

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridFromPoint:(SFPoint *)point
                                andZoom:(int)zoom
                          andProjection:(PROJProjection *)projection;

    Swift

    class func tileGrid(from point: SFPoint!, andZoom zoom: Int32, andProjection projection: PROJProjection!) -> GPKGTileGrid!

    Parameters

    point

    point

    zoom

    zoom level

    projection

    point projection

    Return Value

    tile grid

  • Get the tile grid for the location specified as web mercator

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridFromWebMercatorPoint:(SFPoint *)point
                                           andZoom:(int)zoom;

    Swift

    class func tileGrid(fromWebMercatorPoint point: SFPoint!, andZoom zoom: Int32) -> GPKGTileGrid!

    Parameters

    point

    point

    zoom

    zoom level

    Return Value

    tile grid

  • Get the tile grid that includes the entire tile bounding box

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridWithWebMercatorBoundingBox:
                          (GPKGBoundingBox *)webMercatorBoundingBox
                                                 andZoom:(int)zoom;

    Swift

    class func tileGrid(withWebMercatorBoundingBox webMercatorBoundingBox: GPKGBoundingBox!, andZoom zoom: Int32) -> GPKGTileGrid!

    Parameters

    webMercatorBoundingBox

    web mercator bounding box

    zoom

    zoom level

    Return Value

    tile grid

  • Get the bounds of the XYZ tile at the point and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)tileBoundsInProjection:(PROJProjection *)projection
                                       andPoint:(SFPoint *)point
                                        andZoom:(int)zoom;

    Swift

    class func tileBounds(in projection: PROJProjection!, andPoint point: SFPoint!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    projection

    point and bounding box projection

    point

    point location

    zoom

    zoom level

    Return Value

    bounding box

  • Get the WGS84 bounds of the XYZ tile at the WGS84 point and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)tileBoundsForWGS84Point:(SFPoint *)point andZoom:(int)zoom;

    Swift

    class func tileBounds(forWGS84Point point: SFPoint!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    point

    WGS84 point

    zoom

    zoom level

    Return Value

    WGS84 bounding box

  • Get the web mercator bounds of the XYZ tile at the web mercator point and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)tileBoundsForWebMercatorPoint:(SFPoint *)point
                                               andZoom:(int)zoom;

    Swift

    class func tileBounds(forWebMercatorPoint point: SFPoint!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    point

    web mercator point

    zoom

    zoom level

    Return Value

    web mercator bounding box

  • Get the bounds of the WGS84 tile at the point and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)wgs84TileBoundsInProjection:(PROJProjection *)projection
                                            andPoint:(SFPoint *)point
                                             andZoom:(int)zoom;

    Swift

    class func wgs84TileBounds(in projection: PROJProjection!, andPoint point: SFPoint!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    projection

    point and bounding box projection

    point

    point location

    zoom

    zoom level

    Return Value

    bounding box

  • Get the WGS84 bounds of the WGS84 tile at the WGS84 point and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)wgs84TileBoundsForWGS84Point:(SFPoint *)point
                                              andZoom:(int)zoom;

    Swift

    class func wgs84TileBounds(forWGS84Point point: SFPoint!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    point

    WGS84 point

    zoom

    zoom level

    Return Value

    WGS84 bounding box

  • Get the web mercator bounds of the WGS84 tile at the web mercator point and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)wgs84TileBoundsForWebMercatorPoint:(SFPoint *)point
                                                    andZoom:(int)zoom;

    Swift

    class func wgs84TileBounds(forWebMercatorPoint point: SFPoint!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    point

    web mercator point

    zoom

    zoom level

    Return Value

    web mercator bounding box

  • Convert the bounding box coordinates to a new web mercator bounding box

    Declaration

    Objective-C

    + (GPKGBoundingBox *)toWebMercatorWithBoundingBox:
        (GPKGBoundingBox *)boundingBox;

    Swift

    class func toWebMercator(with boundingBox: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    bounding box

    Return Value

    web mercator bounding box

  • Get the tile size in meters

    Declaration

    Objective-C

    + (double)tileSizeWithTilesPerSide:(int)tilesPerSide;

    Swift

    class func tileSize(withTilesPerSide tilesPerSide: Int32) -> Double

    Parameters

    tilesPerSide

    tiles per side

    Return Value

    meters

  • Get the zoom level from the tile size in meters

    Declaration

    Objective-C

    + (double)zoomLevelOfTileSize:(double)tileSize;

    Swift

    class func zoomLevel(ofTileSize tileSize: Double) -> Double

    Parameters

    tileSize

    tile size in meters

    Return Value

    zoom level

  • Get the tile size in length units

    Declaration

    Objective-C

    + (double)tileSizeWithTilesPerSide:(int)tilesPerSide
                        andTotalLength:(double)totalLength;

    Swift

    class func tileSize(withTilesPerSide tilesPerSide: Int32, andTotalLength totalLength: Double) -> Double

    Parameters

    tilesPerSide

    tiles per side

    totalLength

    total length

    Return Value

    tile size

  • Get the zoom level from the tile size in length units

    Declaration

    Objective-C

    + (double)zoomLevelOfTileSize:(double)tileSize
                   andTotalLength:(double)totalLength;

    Swift

    class func zoomLevel(ofTileSize tileSize: Double, andTotalLength totalLength: Double) -> Double

    Parameters

    tileSize

    tile size in units

    totalLength

    total length

    Return Value

    zoom level

  • Get the tile size in length units at the zoom level

    Declaration

    Objective-C

    + (double)tileSizeWithZoom:(int)zoom andTotalLength:(double)totalLength;

    Swift

    class func tileSize(withZoom zoom: Int32, andTotalLength totalLength: Double) -> Double

    Parameters

    zoom

    zoom level

    totalLength

    total length

    Return Value

    tile size in units

  • Get the tile width in degrees

    Declaration

    Objective-C

    + (double)tileWidthDegreesWithTilesPerSide:(int)tilesPerSide;

    Swift

    class func tileWidthDegrees(withTilesPerSide tilesPerSide: Int32) -> Double

    Parameters

    tilesPerSide

    tiles per side

    Return Value

    degrees

  • Get the tile height in degrees

    Declaration

    Objective-C

    + (double)tileHeightDegreesWithTilesPerSide:(int)tilesPerSide;

    Swift

    class func tileHeightDegrees(withTilesPerSide tilesPerSide: Int32) -> Double

    Parameters

    tilesPerSide

    tiles per side

    Return Value

    degrees

  • Get the tiles per side, width and height, at the zoom level

    Declaration

    Objective-C

    + (int)tilesPerSideWithZoom:(int)zoom;

    Swift

    class func tilesPerSide(withZoom zoom: Int32) -> Int32

    Parameters

    zoom

    zoom level

    Return Value

    tiles per side

  • Get the tile size in meters at the zoom level

    Declaration

    Objective-C

    + (double)tileSizeWithZoom:(int)zoom;

    Swift

    class func tileSize(withZoom zoom: Int32) -> Double

    Parameters

    zoom

    zoom level

    Return Value

    tile size in meters

  • Get the tolerance distance in meters for the zoom level and pixels length

    Declaration

    Objective-C

    + (double)toleranceDistanceWithZoom:(int)zoom andPixels:(int)pixels;

    Swift

    class func toleranceDistance(withZoom zoom: Int32, andPixels pixels: Int32) -> Double

    Parameters

    zoom

    zoom level

    pixels

    pixel length

    Return Value

    tolerance distance in meters

  • Get the tolerance distance in meters for the zoom level and pixels length

    Declaration

    Objective-C

    + (double)toleranceDistanceWithZoom:(int)zoom
                          andPixelWidth:(int)pixelWidth
                         andPixelHeight:(int)pixelHeight;

    Swift

    class func toleranceDistance(withZoom zoom: Int32, andPixelWidth pixelWidth: Int32, andPixelHeight pixelHeight: Int32) -> Double

    Parameters

    zoom

    zoom level

    pixelWidth

    pixel width

    pixelHeight

    pixel height

    Return Value

    tolerance distance in meters

  • Get the standard y tile location as TMS or a TMS y location as standard

    Declaration

    Objective-C

    + (int)yAsOppositeTileFormatWithZoom:(int)zoom andY:(int)y;

    Swift

    class func yAsOppositeTileFormat(withZoom zoom: Int32, andY y: Int32) -> Int32

    Parameters

    zoom

    zoom

    y

    y

    Return Value

    opposite y format

  • Get the zoom level from the tiles per side

    Declaration

    Objective-C

    + (int)zoomFromTilesPerSide:(int)tilesPerSide;

    Swift

    class func zoom(fromTilesPerSide tilesPerSide: Int32) -> Int32

    Parameters

    tilesPerSide

    tiles per side

    Return Value

    zoom level

  • Get the tile grid

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridWithTotalBoundingBox:(GPKGBoundingBox *)totalBox
                                    andMatrixWidth:(int)matrixWidth
                                   andMatrixHeight:(int)matrixHeight
                                    andBoundingBox:(GPKGBoundingBox *)boundingBox;

    Swift

    class func tileGrid(withTotalBoundingBox totalBox: GPKGBoundingBox!, andMatrixWidth matrixWidth: Int32, andMatrixHeight matrixHeight: Int32, andBoundingBox boundingBox: GPKGBoundingBox!) -> GPKGTileGrid!

    Parameters

    totalBox

    total bounding box

    matrixWidth

    matrix width

    matrixHeight

    matrix height

    boundingBox

    bounding box

    Return Value

    tile grid

  • Get the tile column of the longitude in constant units

    Declaration

    Objective-C

    + (int)tileColumnWithTotalBoundingBox:(GPKGBoundingBox *)totalBox
                           andMatrixWidth:(int)matrixWidth
                             andLongitude:(double)longitude;

    Swift

    class func tileColumn(withTotalBoundingBox totalBox: GPKGBoundingBox!, andMatrixWidth matrixWidth: Int32, andLongitude longitude: Double) -> Int32

    Parameters

    totalBox

    total bounding box

    matrixWidth

    matrix width

    longitude

    longitude in constant units

    Return Value

    tile column

  • Get the tile row of the latitude in constant units

    Declaration

    Objective-C

    + (int)tileRowWithTotalBoundingBox:(GPKGBoundingBox *)totalBox
                       andMatrixHeight:(int)matrixHeight
                           andLatitude:(double)latitude;

    Swift

    class func tileRow(withTotalBoundingBox totalBox: GPKGBoundingBox!, andMatrixHeight matrixHeight: Int32, andLatitude latitude: Double) -> Int32

    Parameters

    totalBox

    total bounding box

    matrixHeight

    matrix height

    latitude

    latitude in constant units

    Return Value

    tile row

  • Get the bounding box of the tile column and row in the tile matrix using the total bounding box

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundingBoxWithTotalBoundingBox:(GPKGBoundingBox *)totalBox
                                           andTileMatrix:
                                               (GPKGTileMatrix *)tileMatrix
                                           andTileColumn:(int)tileColumn
                                              andTileRow:(int)tileRow;

    Swift

    class func boundingBox(withTotalBoundingBox totalBox: GPKGBoundingBox!, andTileMatrix tileMatrix: GPKGTileMatrix!, andTileColumn tileColumn: Int32, andTileRow tileRow: Int32) -> GPKGBoundingBox!

    Parameters

    totalBox

    total bounding box

    tileMatrix

    tile matrix

    tileColumn

    tile column

    tileRow

    tile row

    Return Value

    bounding box

  • Get the bounding box of the tile column and row in the tile width and height bounds using the total bounding box

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundingBoxWithTotalBoundingBox:(GPKGBoundingBox *)totalBox
                                      andTileMatrixWidth:(int)tileMatrixWidth
                                     andTileMatrixHeight:(int)tileMatrixHeight
                                           andTileColumn:(int)tileColumn
                                              andTileRow:(int)tileRow;

    Swift

    class func boundingBox(withTotalBoundingBox totalBox: GPKGBoundingBox!, andTileMatrixWidth tileMatrixWidth: Int32, andTileMatrixHeight tileMatrixHeight: Int32, andTileColumn tileColumn: Int32, andTileRow tileRow: Int32) -> GPKGBoundingBox!

    Parameters

    totalBox

    total bounding box

    tileMatrixWidth

    matrix width

    tileMatrixHeight

    matrix height

    tileColumn

    tile column

    tileRow

    tile row

    Return Value

    bounding box

  • Get the bounding box of the tile grid in the tile matrix using the total bounding box

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundingBoxWithTotalBoundingBox:(GPKGBoundingBox *)totalBox
                                           andTileMatrix:
                                               (GPKGTileMatrix *)tileMatrix
                                             andTileGrid:(GPKGTileGrid *)tileGrid;

    Swift

    class func boundingBox(withTotalBoundingBox totalBox: GPKGBoundingBox!, andTileMatrix tileMatrix: GPKGTileMatrix!, andTileGrid tileGrid: GPKGTileGrid!) -> GPKGBoundingBox!

    Parameters

    totalBox

    total bounding box

    tileMatrix

    tile matrix

    tileGrid

    tile grid

    Return Value

    bounding box

  • Get the bounding box of the tile grid in the tile width and height bounds using the total bounding box

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundingBoxWithTotalBoundingBox:(GPKGBoundingBox *)totalBox
                                      andTileMatrixWidth:(int)tileMatrixWidth
                                     andTileMatrixHeight:(int)tileMatrixHeight
                                             andTileGrid:(GPKGTileGrid *)tileGrid;

    Swift

    class func boundingBox(withTotalBoundingBox totalBox: GPKGBoundingBox!, andTileMatrixWidth tileMatrixWidth: Int32, andTileMatrixHeight tileMatrixHeight: Int32, andTileGrid tileGrid: GPKGTileGrid!) -> GPKGBoundingBox!

    Parameters

    totalBox

    total bounding box

    tileMatrixWidth

    matrix width

    tileMatrixHeight

    matrix height

    tileGrid

    tile grid

    Return Value

    bounding box

  • Get the zoom level of where the web mercator bounding box fits into the complete world

    Declaration

    Objective-C

    + (int)zoomLevelWithWebMercatorBoundingBox:
        (GPKGBoundingBox *)webMercatorBoundingBox;

    Swift

    class func zoomLevel(withWebMercatorBoundingBox webMercatorBoundingBox: GPKGBoundingBox!) -> Int32

    Parameters

    webMercatorBoundingBox

    web mercator bounding box

    Return Value

    zoom level

  • Get the location bearing a distance from a current location

    Declaration

    Objective-C

    + (CLLocationCoordinate2D)locationWithBearing:(double)bearing
                                      andDistance:(double)meters
                                     fromLocation:(CLLocationCoordinate2D)location;

    Swift

    class func location(withBearing bearing: Double, andDistance meters: Double, fromLocation location: CLLocationCoordinate2D) -> CLLocationCoordinate2D

    Parameters

    bearing

    bearing

    meters

    meters

    location

    from location

    Return Value

    to location

  • Get the bearing from a location to a location

    Declaration

    Objective-C

    + (double)bearingFromLocation:(CLLocationCoordinate2D)from
                    andToLocation:(CLLocationCoordinate2D)to;

    Swift

    class func bearing(fromLocation from: CLLocationCoordinate2D, andToLocation to: CLLocationCoordinate2D) -> Double

    Parameters

    from

    from location

    to

    to location

    Return Value

    bearing

  • Get the distance between two locations

    Declaration

    Objective-C

    + (double)distanceBetweenLocation:(CLLocationCoordinate2D)location1
                          andLocation:(CLLocationCoordinate2D)location2;

    Swift

    class func distanceBetweenLocation(_ location1: CLLocationCoordinate2D, andLocation location2: CLLocationCoordinate2D) -> Double

    Parameters

    location1

    location 1

    location2

    location 2

    Return Value

    distance in meters

  • Get the location point between two locations

    Declaration

    Objective-C

    + (CLLocationCoordinate2D)pointBetweenFromLocation:(CLLocationCoordinate2D)from
                                         andToLocation:(CLLocationCoordinate2D)to;

    Swift

    class func pointBetween(fromLocation from: CLLocationCoordinate2D, andToLocation to: CLLocationCoordinate2D) -> CLLocationCoordinate2D

    Parameters

    from

    from location

    to

    to location

    Return Value

    between point

  • Bound the web mercator bounding box within the limits

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundWebMercatorBoundingBox:(GPKGBoundingBox *)boundingBox;

    Swift

    class func boundWebMercatorBoundingBox(_ boundingBox: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    web mercator bounding box

    Return Value

    bounding box

  • Bound the upper and lower bounds of the WGS84 bounding box with web mercator limits

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundWgs84BoundingBoxWithWebMercatorLimits:
        (GPKGBoundingBox *)boundingBox;

    Swift

    class func boundWgs84BoundingBox(withWebMercatorLimits boundingBox: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    wgs84 bounding box

    Return Value

    bounding box

  • Bound the upper and lower bounds of the degrees bounding box with web mercator limits

    Declaration

    Objective-C

    + (GPKGBoundingBox *)boundDegreesBoundingBoxWithWebMercatorLimits:
        (GPKGBoundingBox *)boundingBox;

    Swift

    class func boundDegreesBoundingBox(withWebMercatorLimits boundingBox: GPKGBoundingBox!) -> GPKGBoundingBox!

    Parameters

    boundingBox

    degrees bounding box

    Return Value

    bounding box

  • Get a rectangle using the tile width, height, bounding box, and the bounding box section within the outer box to build the rectangle from

    Declaration

    Objective-C

    + (CGRect)rectangleWithWidth:(int)width
                       andHeight:(int)height
                  andBoundingBox:(GPKGBoundingBox *)boundingBox
                      andSection:(GPKGBoundingBox *)boundingBoxSection;

    Swift

    class func rectangle(withWidth width: Int32, andHeight height: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andSection boundingBoxSection: GPKGBoundingBox!) -> CGRect

    Parameters

    width

    width

    height

    height

    boundingBox

    full bounding box

    boundingBoxSection

    rectangle bounding box section

    Return Value

    rectangle

  • Get a rectangle with rounded point boundaries using the tile width, height, bounding box, and the bounding box section within the outer box to build the rectangle from

    Declaration

    Objective-C

    + (CGRect)roundedRectangleWithWidth:(int)width
                              andHeight:(int)height
                         andBoundingBox:(GPKGBoundingBox *)boundingBox
                             andSection:(GPKGBoundingBox *)boundingBoxSection;

    Swift

    class func roundedRectangle(withWidth width: Int32, andHeight height: Int32, andBoundingBox boundingBox: GPKGBoundingBox!, andSection boundingBoxSection: GPKGBoundingBox!) -> CGRect

    Parameters

    width

    width

    height

    height

    boundingBox

    full bounding box

    boundingBoxSection

    rectangle bounding box section

    Return Value

    rectangle

  • Get the WGS84 tile grid for the point specified as WGS84

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridWGS84FromWGS84Point:(SFPoint *)point
                                          andZoom:(int)zoom;

    Swift

    class func tileGridWGS84(fromWGS84Point point: SFPoint!, andZoom zoom: Int32) -> GPKGTileGrid!

    Parameters

    point

    point

    zoom

    zoom level

    Return Value

    tile grid

  • Get the WGS84 tile grid for the point specified as the projection

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridWGS84FromPoint:(SFPoint *)point
                                     andZoom:(int)zoom
                               andProjection:(PROJProjection *)projection;

    Swift

    class func tileGridWGS84(from point: SFPoint!, andZoom zoom: Int32, andProjection projection: PROJProjection!) -> GPKGTileGrid!

    Parameters

    point

    point

    zoom

    zoom level

    projection

    projection

    Return Value

    tile grid

  • Get the WGS84 tile grid for the point specified as web mercator

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridWGS84FromWebMercatorPoint:(SFPoint *)point
                                                andZoom:(int)zoom;

    Swift

    class func tileGridWGS84(fromWebMercatorPoint point: SFPoint!, andZoom zoom: Int32) -> GPKGTileGrid!

    Parameters

    point

    point

    zoom

    zoom level

    Return Value

    tile grid

  • Get the WGS84 tile grid that includes the entire tile bounding box

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGridWithWgs84BoundingBox:
                          (GPKGBoundingBox *)wgs84BoundingBox
                                           andZoom:(int)zoom;

    Swift

    class func tileGrid(withWgs84BoundingBox wgs84BoundingBox: GPKGBoundingBox!, andZoom zoom: Int32) -> GPKGTileGrid!

    Parameters

    wgs84BoundingBox

    wgs84 bounding box

    zoom

    zoom level

    Return Value

    tile grid

  • Get the WGS84 tile bounding box from the WGS84 XYZ tile coordinates and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)wgs84BoundingBoxWithX:(int)x andY:(int)y andZoom:(int)zoom;

    Swift

    class func wgs84BoundingBoxWith(x: Int32, andY y: Int32, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    x

    x

    y

    y

    zoom

    zoom level

    Return Value

    web mercator bounding box

  • Get the WGS84 tile bounding box from the WGS84 tile grid and zoom level

    Declaration

    Objective-C

    + (GPKGBoundingBox *)wgs84BoundingBoxWithTileGrid:(GPKGTileGrid *)tileGrid
                                              andZoom:(int)zoom;

    Swift

    class func wgs84BoundingBox(with tileGrid: GPKGTileGrid!, andZoom zoom: Int32) -> GPKGBoundingBox!

    Parameters

    tileGrid

    tile grid

    zoom

    zoom

    Return Value

    wgs84 bounding box

  • Get the tiles per latitude side at the zoom level

    Declaration

    Objective-C

    + (int)tilesPerWgs84LatSideWithZoom:(int)zoom;

    Swift

    class func tilesPerWgs84LatSide(withZoom zoom: Int32) -> Int32

    Parameters

    zoom

    zoom level

    Return Value

    tiles per latitude side

  • Get the tiles per longitude side at the zoom level

    Declaration

    Objective-C

    + (int)tilesPerWgs84LonSideWithZoom:(int)zoom;

    Swift

    class func tilesPerWgs84LonSide(withZoom zoom: Int32) -> Int32

    Parameters

    zoom

    zoom level

    Return Value

    tiles per longitude side

  • Get the tile height in degrees latitude

    Declaration

    Objective-C

    + (double)tileSizeLatWithWgs84TilesPerSide:(int)tilesPerLat;

    Swift

    class func tileSizeLat(withWgs84TilesPerSide tilesPerLat: Int32) -> Double

    Parameters

    tilesPerLat

    tiles per latitude side

    Return Value

    degrees

  • Get the tile height in degrees longitude

    Declaration

    Objective-C

    + (double)tileSizeLonWithWgs84TilesPerSide:(int)tilesPerLon;

    Swift

    class func tileSizeLon(withWgs84TilesPerSide tilesPerLon: Int32) -> Double

    Parameters

    tilesPerLon

    tiles per longitude side

    Return Value

    degrees

  • Get the tile grid starting from the tile grid and current zoom to the new zoom level

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGrid:(GPKGTileGrid *)tileGrid
                      zoomFrom:(int)fromZoom
                            to:(int)toZoom;

    Swift

    class func tileGrid(_ tileGrid: GPKGTileGrid!, zoomFrom fromZoom: Int32, to toZoom: Int32) -> GPKGTileGrid!

    Parameters

    tileGrid

    current tile grid

    fromZoom

    current zoom level

    toZoom

    new zoom level

    Return Value

    tile grid at new zoom level

  • Get the tile grid starting from the tile grid and zooming in / increasing the number of levels

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGrid:(GPKGTileGrid *)tileGrid
                  zoomIncrease:(int)zoomLevels;

    Swift

    class func tileGrid(_ tileGrid: GPKGTileGrid!, zoomIncrease zoomLevels: Int32) -> GPKGTileGrid!

    Parameters

    tileGrid

    current tile grid

    zoomLevels

    number of zoom levels to increase by

    Return Value

    tile grid at new zoom level

  • Get the tile grid starting from the tile grid and zooming out / decreasing the number of levels

    Declaration

    Objective-C

    + (GPKGTileGrid *)tileGrid:(GPKGTileGrid *)tileGrid
                  zoomDecrease:(int)zoomLevels;

    Swift

    class func tileGrid(_ tileGrid: GPKGTileGrid!, zoomDecrease zoomLevels: Int32) -> GPKGTileGrid!

    Parameters

    tileGrid

    current tile grid

    zoomLevels

    number of zoom levels to decrease by

    Return Value

    tile grid at new zoom level

  • Get the new tile grid min value starting from the tile grid min and zooming in / increasing the number of levels

    Declaration

    Objective-C

    + (int)tileGridMin:(int)min zoomIncrease:(int)zoomLevels;

    Swift

    class func tileGridMin(_ min: Int32, zoomIncrease zoomLevels: Int32) -> Int32

    Parameters

    min

    tile grid min value

    zoomLevels

    number of zoom levels to increase by

    Return Value

    tile grid min value at new zoom level

  • Get the new tile grid max value starting from the tile grid max and zooming in / increasing the number of levels

    Declaration

    Objective-C

    + (int)tileGridMax:(int)max zoomIncrease:(int)zoomLevels;

    Swift

    class func tileGridMax(_ max: Int32, zoomIncrease zoomLevels: Int32) -> Int32

    Parameters

    max

    tile grid max value

    zoomLevels

    number of zoom levels to increase by

    Return Value

    tile grid max value at new zoom level

  • Get the new tile grid min value starting from the tile grid min and zooming out / decreasing the number of levels

    Declaration

    Objective-C

    + (int)tileGridMin:(int)min zoomDecrease:(int)zoomLevels;

    Swift

    class func tileGridMin(_ min: Int32, zoomDecrease zoomLevels: Int32) -> Int32

    Parameters

    min

    tile grid min value

    zoomLevels

    number of zoom levels to decrease by

    Return Value

    tile grid min value at new zoom level

  • Get the new tile grid max value starting from the tile grid max and zooming out / decreasing the number of levels

    Declaration

    Objective-C

    + (int)tileGridMax:(int)max zoomDecrease:(int)zoomLevels;

    Swift

    class func tileGridMax(_ max: Int32, zoomDecrease zoomLevels: Int32) -> Int32

    Parameters

    max

    tile grid max value

    zoomLevels

    number of zoom levels to decrease by

    Return Value

    tile grid max value at new zoom level