This is GDAL static library builded for ios platform, with swift binding
For installation GDAL you can use Swift Package Manager or Cocoapods
Use Xcode menu File -> Add Package Dependencies... and add this repository url in search field.
https://github.com/syngenta/gdal-swift.git
pod 'gdal-swift', :git => 'https://github.com/syngenta/gdal-swift.git'
Class for getting tiles from visual and NDVI tif files
let provider = TileProvider()
guard let path = Bundle.main.path(forResource: "file", ofType: "tif") else {
return
}
let coordinates = TileCoordinates(x: 19747, y: 11083, z: 15)
do {
// tileSize by default 256
let data = try provider.visible(path: path, coordinates: coordinates, tileSize: 256)
print(data) // tile in Data type
} catch let error {
print(error)
}
For running Demo run commands:
cd Demo
open Demo.xcodeproj
For compilation gdal static library run this commands:
cd gdal-buld
./build-gdal-combined-lib.sh
After success compilation you will find gdal.xcframework.zip file in gdal-buld folder.
Then you should upload this file to Releases section in this repository.
Upload file url example:
https://github.com/syngenta/gdal-swift/releases/download/1.0.0/gdal.xcframework.zip
After uploading you need to change url in two files Package.swift and prepare_gdal.sh
File located in root folder. You need to change url and checksum in this file.
For caclulation checksum you can use this command:
swift package compute-checksum gdal.xcframework.zip
File located in Sources/gdal/ folder. You need to change url in this file.