GPKGCoverageDataPng

Objective-C

@interface GPKGCoverageDataPng : GPKGCoverageData

Swift

class GPKGCoverageDataPng : GPKGCoverageData

Tiled Gridded Coverage Data, PNG Encoding, Extension

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithGeoPackage:(GPKGGeoPackage *)geoPackage
                            andTileDao:(GPKGTileDao *)tileDao
                              andWidth:(NSNumber *)width
                             andHeight:(NSNumber *)height
                         andProjection:(PROJProjection *)requestProjection;

    Swift

    init!(geoPackage: GPKGGeoPackage!, andTileDao tileDao: GPKGTileDao!, andWidth width: NSNumber!, andHeight height: NSNumber!, andProjection requestProjection: PROJProjection!)

    Parameters

    geoPackage

    GeoPackage

    tileDao

    tile dao

    width

    specified results width

    height

    specified results height

    requestProjection

    request projection

    Return Value

    new instance

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithGeoPackage:(GPKGGeoPackage *)geoPackage
                            andTileDao:(GPKGTileDao *)tileDao;

    Swift

    init!(geoPackage: GPKGGeoPackage!, andTileDao tileDao: GPKGTileDao!)

    Parameters

    geoPackage

    GeoPackage

    tileDao

    tile dao

    Return Value

    new instance

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithGeoPackage:(GPKGGeoPackage *)geoPackage
                            andTileDao:(GPKGTileDao *)tileDao
                         andProjection:(PROJProjection *)requestProjection;

    Swift

    init!(geoPackage: GPKGGeoPackage!, andTileDao tileDao: GPKGTileDao!, andProjection requestProjection: PROJProjection!)

    Parameters

    geoPackage

    GeoPackage

    tileDao

    tile dao

    requestProjection

    request projection

    Return Value

    new instance

  • Get the pixel value as an unsigned short

    Declaration

    Objective-C

    - (unsigned short)pixelValueWithImage:(id)image andX:(int)x andY:(int)y;

    Swift

    func pixelValue(withImage image: Any!, andX x: Int32, andY y: Int32) -> UInt16

    Parameters

    image

    tile image

    x

    x coordinate

    y

    y coordinate

    Return Value

    unsigned short pixel value

  • Get the pixel value as an unsigned short

    Declaration

    Objective-C

    - (unsigned short)pixelValueWithData:(NSData *)imageData
                                    andX:(int)x
                                    andY:(int)y;

    Swift

    func pixelValue(with imageData: Data!, andX x: Int32, andY y: Int32) -> UInt16

    Parameters

    imageData

    image data

    x

    x coordinate

    y

    y coordinate

    Return Value

    unsigned short pixel value

  • Get the pixel values of the image as unsigned shorts

    Declaration

    Objective-C

    - (unsigned short *)pixelValuesWithImage:(id)image;

    Swift

    func pixelValues(withImage image: Any!) -> UnsafeMutablePointer<UInt16>!

    Parameters

    image

    tile image

    Return Value

    unsigned short pixel values

  • Get the pixel values of the image as unsigned shorts

    Declaration

    Objective-C

    - (unsigned short *)pixelValuesWithData:(NSData *)imageData;

    Swift

    func pixelValues(with imageData: Data!) -> UnsafeMutablePointer<UInt16>!

    Parameters

    imageData

    image data

    Return Value

    unsigned short pixel values

  • Validate that the image type is an unsigned short

    Declaration

    Objective-C

    + (void)validateImageType:(id)image;

    Swift

    class func validateImageType(_ image: Any!)

    Parameters

    image

    tile image

  • Get the coverage data value

    Declaration

    Objective-C

    - (NSDecimalNumber *)valueWithGriddedTile:(GPKGGriddedTile *)griddedTile
                                     andImage:(id)image
                                         andX:(int)x
                                         andY:(int)y;

    Swift

    func value(with griddedTile: GPKGGriddedTile!, andImage image: Any!, andX x: Int32, andY y: Int32) -> NSDecimalNumber!

    Parameters

    griddedTile

    gridded tile

    image

    tile image

    x

    x coordinate

    y

    y coordinate

    Return Value

    coverage data value

  • Get the coverage data values

    Declaration

    Objective-C

    - (NSArray *)valuesWithGriddedTile:(GPKGGriddedTile *)griddedTile
                              andImage:(id)image;

    Swift

    func values(with griddedTile: GPKGGriddedTile!, andImage image: Any!) -> [Any]!

    Parameters

    griddedTile

    gridded tile

    image

    tile image

    Return Value

    coverage data values

  • Draw a coverage data image tile from the flat array of unsigned short pixel values of length tileWidth * tileHeight where each pixel is at: (y

    • tileWidth) + x

    Declaration

    Objective-C

    - (id)drawTileWithUnsignedShortPixelValues:(unsigned short *)pixelValues
                                  andTileWidth:(int)tileWidth
                                 andTileHeight:(int)tileHeight;

    Swift

    func drawTile(withUnsignedShortPixelValues pixelValues: UnsafeMutablePointer<UInt16>!, andTileWidth tileWidth: Int32, andTileHeight tileHeight: Int32) -> Any!

    Parameters

    pixelValues

    unsigned short pixel values of length tileWidth * tileHeight

    tileWidth

    tile width

    tileHeight

    tile height

    Return Value

    coverage data image tile

  • Draw a coverage data image tile from the flat array of unsigned short pixel values of length tileWidth * tileHeight where each pixel is at: (y

    • tileWidth) + x

    Declaration

    Objective-C

    - (id)drawTileWithPixelValues:(NSArray *)pixelValues
                     andTileWidth:(int)tileWidth
                    andTileHeight:(int)tileHeight;

    Swift

    func drawTile(withPixelValues pixelValues: [Any]!, andTileWidth tileWidth: Int32, andTileHeight tileHeight: Int32) -> Any!

    Parameters

    pixelValues

    unsigned short pixel values of length tileWidth * tileHeight

    tileWidth

    tile width

    tileHeight

    tile height

    Return Value

    coverage data image tile

  • Draw a coverage data image tile and format as PNG bytes from the flat array of unsigned short pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x

    Declaration

    Objective-C

    - (NSData *)drawTileDataWithPixelValues:(NSArray *)pixelValues
                               andTileWidth:(int)tileWidth
                              andTileHeight:(int)tileHeight;

    Swift

    func drawTileData(withPixelValues pixelValues: [Any]!, andTileWidth tileWidth: Int32, andTileHeight tileHeight: Int32) -> Data!

    Parameters

    pixelValues

    unsigned short pixel values of length tileWidth * tileHeight

    tileWidth

    tile width

    tileHeight

    tile height

    Return Value

    coverage data image tile bytes

  • Draw a coverage data tile from the double array of unsigned short pixel values formatted as short[row][width]

    Declaration

    Objective-C

    - (id)drawTileWithDoubleArrayPixelValues:(NSArray *)pixelValues;

    Swift

    func drawTile(withDoubleArrayPixelValues pixelValues: [Any]!) -> Any!

    Parameters

    pixelValues

    unsigned short pixel values as [row][width]

    Return Value

    coverage data image tile

  • Draw a coverage data tile and format as PNG bytes from the double array of “unsigned short” pixel values formatted as short[row][width]

    Declaration

    Objective-C

    - (NSData *)drawTileDataWithDoubleArrayPixelValues:(NSArray *)pixelValues;

    Swift

    func drawTileData(withDoubleArrayPixelValues pixelValues: [Any]!) -> Data!

    Parameters

    pixelValues

    “unsigned short” pixel values as [row][width]

    Return Value

    coverage data image tile bytes

  • Draw a coverage data image tile from the flat array of coverage data values of length tileWidth * tileHeight where each value is at: (y * tileWidth) + x

    Declaration

    Objective-C

    - (id)drawTileWithGriddedTile:(GPKGGriddedTile *)griddedTile
                        andValues:(NSArray *)values
                     andTileWidth:(int)tileWidth
                    andTileHeight:(int)tileHeight;

    Swift

    func drawTile(with griddedTile: GPKGGriddedTile!, andValues values: [Any]!, andTileWidth tileWidth: Int32, andTileHeight tileHeight: Int32) -> Any!

    Parameters

    griddedTile

    gridded tile

    values

    coverage data values of length tileWidth * tileHeight

    tileWidth

    tile width

    tileHeight

    tile height

    Return Value

    coverage data image tile

  • Draw a coverage data image tile from the double array of coverage data values formatted as Double[row][width]

    Declaration

    Objective-C

    - (id)drawTileWithGriddedTile:(GPKGGriddedTile *)griddedTile
             andDoubleArrayValues:(NSArray *)values;

    Swift

    func drawTile(with griddedTile: GPKGGriddedTile!, andDoubleArrayValues values: [Any]!) -> Any!

    Parameters

    griddedTile

    gridded tile

    values

    coverage data values as [row][width]

    Return Value

    coverage data image tile

  • Get the image as PNG bytes

    Declaration

    Objective-C

    - (NSData *)imageData:(id)image;

    Swift

    func imageData(_ image: Any!) -> Data!

    Parameters

    image

    buffered image

    Return Value

    image bytes

  • Get the pixel at the provided x and y with the image width

    Declaration

    Objective-C

    - (unsigned short)pixelIn:(unsigned short *)pixels
                    withWidth:(int)width
                          atX:(int)x
                         andY:(int)y;

    Swift

    func pixel(in pixels: UnsafeMutablePointer<UInt16>!, withWidth width: Int32, atX x: Int32, andY y: Int32) -> UInt16

    Parameters

    pixels

    pixels array

    width

    image width

    x

    x coordinate

    y

    y coordintate

    Return Value

    pixel value

  • Convert the unsigned short pixel array to a NSArray of numbers

    Declaration

    Objective-C

    - (NSArray *)pixelValuesUnsignedShortToArray:(unsigned short *)pixelValues
                                       withCount:(int)count;

    Swift

    func pixelValuesUnsignedShort(toArray pixelValues: UnsafeMutablePointer<UInt16>!, withCount count: Int32) -> [Any]!

    Parameters

    pixelValues

    pixels values

    count

    pixel count

    Return Value

    pixel array

  • Convert the pixel array to an unsigned short pixel array

    Declaration

    Objective-C

    - (unsigned short *)pixelValuesArrayToUnsignedShort:(NSArray *)pixelValues;

    Swift

    func pixelValuesArray(toUnsignedShort pixelValues: [Any]!) -> UnsafeMutablePointer<UInt16>!

    Parameters

    pixelValues

    pixels values

    Return Value

    unsigned short pixel array

  • Convert the pixel double array to an unsigned short pixel array

    Declaration

    Objective-C

    - (unsigned short *)pixelValuesDoubleArrayToUnsignedShort:
        (NSArray *)pixelValues;

    Swift

    func pixelValuesDoubleArray(toUnsignedShort pixelValues: [Any]!) -> UnsafeMutablePointer<UInt16>!

    Parameters

    pixelValues

    pixels values

    Return Value

    unsigned short pixel array

  • Convert the coverage data array to an unsigned short pixel array

    Declaration

    Objective-C

    - (unsigned short *)pixelValuesOfValues:(NSArray *)values
                            withGriddedTile:(GPKGGriddedTile *)griddedTile;

    Swift

    func pixelValues(ofValues values: [Any]!, with griddedTile: GPKGGriddedTile!) -> UnsafeMutablePointer<UInt16>!

    Parameters

    values

    coverage data values

    griddedTile

    gridded tile

    Return Value

    unsigned short pixel array

  • Convert the coverage data double array to an unsigned short pixel array

    Declaration

    Objective-C

    - (unsigned short *)pixelValuesOfDoubleArrayValues:(NSArray *)values
                                       withGriddedTile:
                                           (GPKGGriddedTile *)griddedTile;

    Swift

    func pixelValues(ofDoubleArrayValues values: [Any]!, with griddedTile: GPKGGriddedTile!) -> UnsafeMutablePointer<UInt16>!

    Parameters

    values

    coverage data values

    griddedTile

    gridded tile

    Return Value

    unsigned short pixel array

  • Create the coverage data tile table with metadata and extension

    Declaration

    Objective-C

    + (GPKGCoverageDataPng *)
        createTileTableWithGeoPackage:(GPKGGeoPackage *)geoPackage
                          andMetadata:(GPKGTileTableMetadata *)metadata;

    Swift

    class func createTileTable(with geoPackage: GPKGGeoPackage!, andMetadata metadata: GPKGTileTableMetadata!) -> GPKGCoverageDataPng!

    Parameters

    geoPackage

    GeoPackage

    metadata

    tile table metadata

    Return Value

    coverage data tiles