GPKGTileDaoUtils

Objective-C

@interface GPKGTileDaoUtils : NSObject

Swift

class GPKGTileDaoUtils : NSObject

Tile Data Access Object utilities

  • Adjust the tile matrix lengths if needed. Check if the tile matrix width and height need to expand to account for pixel * number of pixels fitting into the tile matrix lengths

    Declaration

    Objective-C

    + (void)adjustTileMatrixLengthsWithTileMatrixSet:
                (GPKGTileMatrixSet *)tileMatrixSet
                                     andTileMatrices:
                                         (NSArray<GPKGTileMatrix *> *)tileMatrices;

    Swift

    class func adjustTileMatrixLengths(with tileMatrixSet: GPKGTileMatrixSet!, andTileMatrices tileMatrices: [GPKGTileMatrix]!)

    Parameters

    tileMatrixSet

    tile matrix set

    tileMatrices

    tile matrices

  • Get the zoom level for the provided width and height in the default units

    Declaration

    Objective-C

    + (NSNumber *)zoomLevelWithWidths:(NSArray *)widths
                           andHeights:(NSArray *)heights
                      andTileMatrices:(NSArray<GPKGTileMatrix *> *)tileMatrices
                            andLength:(double)length;

    Swift

    class func zoomLevel(withWidths widths: [Any]!, andHeights heights: [Any]!, andTileMatrices tileMatrices: [GPKGTileMatrix]!, andLength length: Double) -> NSNumber!

    Parameters

    widths

    widths

    heights

    heights

    tileMatrices

    tile matrices

    length

    length in default units

    Return Value

    zoom level

  • Get the zoom level for the provided width and height in the default units

    Declaration

    Objective-C

    + (NSNumber *)zoomLevelWithWidths:(NSArray *)widths
                           andHeights:(NSArray *)heights
                      andTileMatrices:(NSArray<GPKGTileMatrix *> *)tileMatrices
                             andWidth:(double)width
                            andHeight:(double)height;

    Swift

    class func zoomLevel(withWidths widths: [Any]!, andHeights heights: [Any]!, andTileMatrices tileMatrices: [GPKGTileMatrix]!, andWidth width: Double, andHeight height: Double) -> NSNumber!

    Parameters

    widths

    sorted widths

    heights

    sorted heights

    tileMatrices

    tile matrices

    width

    in default units

    height

    in default units

    Return Value

    tile matrix zoom level

  • Get the closest zoom level for the provided width and height in the default units

    Declaration

    Objective-C

    + (NSNumber *)closestZoomLevelWithWidths:(NSArray *)widths
                                  andHeights:(NSArray *)heights
                             andTileMatrices:
                                 (NSArray<GPKGTileMatrix *> *)tileMatrices
                                   andLength:(double)length;

    Swift

    class func closestZoomLevel(withWidths widths: [Any]!, andHeights heights: [Any]!, andTileMatrices tileMatrices: [GPKGTileMatrix]!, andLength length: Double) -> NSNumber!

    Parameters

    widths

    sorted widths

    heights

    sorted heights

    tileMatrices

    tile matrices

    length

    in default units

    Return Value

    tile matrix zoom level

  • Get the closest zoom level for the provided width and height in the default units

    Declaration

    Objective-C

    + (NSNumber *)closestZoomLevelWithWidths:(NSArray *)widths
                                  andHeights:(NSArray *)heights
                             andTileMatrices:
                                 (NSArray<GPKGTileMatrix *> *)tileMatrices
                                    andWidth:(double)width
                                   andHeight:(double)height;

    Swift

    class func closestZoomLevel(withWidths widths: [Any]!, andHeights heights: [Any]!, andTileMatrices tileMatrices: [GPKGTileMatrix]!, andWidth width: Double, andHeight height: Double) -> NSNumber!

    Parameters

    widths

    sorted widths

    heights

    sorted heights

    tileMatrices

    tile matrices

    width

    in default units

    height

    in default units

    Return Value

    tile matrix zoom level

  • Get the approximate zoom level for the provided length in the default units. Tiles may or may not exist for the returned zoom level. The approximate zoom level is determined using a factor of 2 from the zoom levels with tiles.

    Declaration

    Objective-C

    + (NSNumber *)approximateZoomLevelWithWidths:(NSArray *)widths
                                      andHeights:(NSArray *)heights
                                 andTileMatrices:
                                     (NSArray<GPKGTileMatrix *> *)tileMatrices
                                       andLength:(double)length;

    Swift

    class func approximateZoomLevel(withWidths widths: [Any]!, andHeights heights: [Any]!, andTileMatrices tileMatrices: [GPKGTileMatrix]!, andLength length: Double) -> NSNumber!

    Parameters

    widths

    sorted widths

    heights

    sorted heights

    tileMatrices

    tile matrices

    length

    length in default units

    Return Value

    actual or approximate tile matrix zoom level

  • Get the approximate zoom level for the provided width and height in the default units. Tiles may or may not exist for the returned zoom level. The approximate zoom level is determined using a factor of 2 from the zoom levels with tiles.

    Declaration

    Objective-C

    + (NSNumber *)approximateZoomLevelWithWidths:(NSArray *)widths
                                      andHeights:(NSArray *)heights
                                 andTileMatrices:
                                     (NSArray<GPKGTileMatrix *> *)tileMatrices
                                        andWidth:(double)width
                                       andHeight:(double)height;

    Swift

    class func approximateZoomLevel(withWidths widths: [Any]!, andHeights heights: [Any]!, andTileMatrices tileMatrices: [GPKGTileMatrix]!, andWidth width: Double, andHeight height: Double) -> NSNumber!

    Parameters

    widths

    sorted widths

    heights

    sorted heights

    tileMatrices

    tile matrices

    width

    width in default units

    height

    height in default units

    Return Value

    actual or approximate tile matrix zoom level

  • Get the max distance length that matches the tile widths and heights

    Declaration

    Objective-C

    + (double)maxLengthWithWidths:(NSArray *)widths andHeights:(NSArray *)heights;

    Swift

    class func maxLength(withWidths widths: [Any]!, andHeights heights: [Any]!) -> Double

    Parameters

    widths

    sorted tile matrix widths

    heights

    sorted tile matrix heights

    Return Value

    max length

  • Get the min distance length that matches the tile widths and heights

    Declaration

    Objective-C

    + (double)minLengthWithWidths:(NSArray *)widths andHeights:(NSArray *)heights;

    Swift

    class func minLength(withWidths widths: [Any]!, andHeights heights: [Any]!) -> Double

    Parameters

    widths

    sorted tile matrix widths

    heights

    sorted tile matrix heights

    Return Value

    min length

  • Get the map zoom level range

    Declaration

    Objective-C

    + (int *)
        mapZoomRangeWithTileMatrixSetDao:(GPKGTileMatrixSetDao *)tileMatrixSetDao
                        andTileMatrixSet:(GPKGTileMatrixSet *)tileMatrixSet
                         andTileMatrices:(NSArray<GPKGTileMatrix *> *)tileMatrices;

    Swift

    class func mapZoomRange(with tileMatrixSetDao: GPKGTileMatrixSetDao!, andTileMatrixSet tileMatrixSet: GPKGTileMatrixSet!, andTileMatrices tileMatrices: [GPKGTileMatrix]!) -> UnsafeMutablePointer<Int32>!

    Parameters

    tileMatrixSetDao

    tile matrix set dao

    tileMatrixSet

    tile matrix set

    tileMatrices

    tile matrices

    Return Value

    map zoom level range, min at index 0, max at index 1

  • Get the map min zoom level

    Declaration

    Objective-C

    + (int)mapMinZoomWithTileMatrixSetDao:(GPKGTileMatrixSetDao *)tileMatrixSetDao
                         andTileMatrixSet:(GPKGTileMatrixSet *)tileMatrixSet
                          andTileMatrices:(NSArray<GPKGTileMatrix *> *)tileMatrices;

    Swift

    class func mapMinZoom(with tileMatrixSetDao: GPKGTileMatrixSetDao!, andTileMatrixSet tileMatrixSet: GPKGTileMatrixSet!, andTileMatrices tileMatrices: [GPKGTileMatrix]!) -> Int32

    Parameters

    tileMatrixSetDao

    tile matrix set dao

    tileMatrixSet

    tile matrix set

    tileMatrices

    tile matrices

    Return Value

    map min zoom level

  • Get the map max zoom level

    Declaration

    Objective-C

    + (int)mapMaxZoomWithTileMatrixSetDao:(GPKGTileMatrixSetDao *)tileMatrixSetDao
                         andTileMatrixSet:(GPKGTileMatrixSet *)tileMatrixSet
                          andTileMatrices:(NSArray<GPKGTileMatrix *> *)tileMatrices;

    Swift

    class func mapMaxZoom(with tileMatrixSetDao: GPKGTileMatrixSetDao!, andTileMatrixSet tileMatrixSet: GPKGTileMatrixSet!, andTileMatrices tileMatrices: [GPKGTileMatrix]!) -> Int32

    Parameters

    tileMatrixSetDao

    tile matrix set dao

    tileMatrixSet

    tile matrix set

    tileMatrices

    tile matrices

    Return Value

    map max zoom level

  • Get the map zoom level

    Declaration

    Objective-C

    + (int)mapZoomWithTileMatrixSetDao:(GPKGTileMatrixSetDao *)tileMatrixSetDao
                      andTileMatrixSet:(GPKGTileMatrixSet *)tileMatrixSet
                         andTileMatrix:(GPKGTileMatrix *)tileMatrix;

    Swift

    class func mapZoom(with tileMatrixSetDao: GPKGTileMatrixSetDao!, andTileMatrixSet tileMatrixSet: GPKGTileMatrixSet!, andTileMatrix tileMatrix: GPKGTileMatrix!) -> Int32

    Parameters

    tileMatrixSetDao

    tile matrix set dao

    tileMatrixSet

    tile matrix set

    tileMatrix

    tile matrix

    Return Value

    map zoom level