The strategic performance advantage of the Cloud-Optimized GeoTiff is the ability to retrieve raster data for a given extent while only pulling the overviews and a byte range from a remote resource.
In Python, the vsicurl and gdal.Warp abstractions make it possible to do this with just a URL an an extent:
vsicurl_url = '/vsicurl/' + url_to_cog
gdal.Warp(output_file,
vsicurl_url,
dstSRS = 'EPSG:4326',
cutlineDSName = jsonFileSliceAoi,
cropToCutline = True)
The newly-minted COG Spark Examples explain how to arrive at a Raster[Tile] using an AttributeStore created as a result of tiling an RDD in a previous step:
//tiling an RDD and writing out the catalog
...
// Create the reader instance to query tiles stored as a Structured COG Layer
val reader = FileCOGLayerReader(attributeStore)
// Read layer at the max persisted zoom level
// Actually it can be any zoom level in this case from the [0; zoom] values range
val layer: TileLayerRDD[SpatialKey] = reader.read[SpatialKey, Tile](LayerId("example_cog_layer", zoom))
// Let's stitch the layer into tile
val raster: Raster[Tile] = layer.stitch
The examples, release notes, and docs for COG support in GeoTrellis all confirm that there is support for tiling data and making it available for clients to consume as a COG. Does GeoTrellis also support the ability to act as a client?
How do you create a FileCOGLayerReader
if you don't have a pre-existing catalog, but do have a URL that supports range requests?