Thanks Grigory! Another question ;) : When I want to read the COG layer using the S3COGValueReader in order to serve the data as a Tile service (xyz) (our script is inspired by the Geotrellis Landsat Tutorial ), what zoom value should we use? n_m or n ?!
Thanks!
Josée-Anne
De : geotrellis-user-bounces@xxxxxxxxxxxxxxxx <geotrellis-user-bounces@xxxxxxxxxxxxxxxx>
De la part de Grigory Pomadchin
Envoyé : 23 novembre 2018 04:20
À : geotrellis-user@xxxxxxxxxxxxxxxx
Objet : Re: [geotrellis-user] S3COGLayerWriter - update
Hey!
Yeah, it's normal. COGs would be stored in partial pyramids, that partial pyramid will contain zoom levels n_m (from n (base level for the tiff in that folder) to m (min sized overview)). That's how we resolve an issue of too many files (the case when you need
to observe your map on the 0 zoom level, obviously in this case fetching thousands of tiles to perform merge won't be efficient).
In attribute store we have a single json file per layername; that's also normal. Actually most of the data can be calculated on the fly, so there are no needs to store everything for each zoom level.
Best,
Grigory
Thanks! Look like it will work. I might have other questions concerning the COG. For example, in the
catalog, the zoom level is not in the same format than in native geotrellis format (I have 0_0 instead of 0). Also, is it normal to have only one json file in the _attribute folder for this layer even if I have created 14 levels of the pyramids?
Thanks again for your help!
Josée-Anne
De :
geotrellis-user-bounces@xxxxxxxxxxxxxxxx <geotrellis-user-bounces@xxxxxxxxxxxxxxxx>
De la part de Grigory Pomadchin
Envoyé : 22 novembre 2018 12:07
À : geotrellis-user@xxxxxxxxxxxxxxxx
Objet : Re: [geotrellis-user] S3COGLayerWriter - update
Hey, there!
It is quite near to the thing you are inserting into the arguments - you need to put there an Option of a function, try this:
writer.update(layernane, rdd, 0, Some((v1: GeoTiff[Tile], v2: GeoTiff[Tile]) => {
val extent = v1.raster.extent
val tile = v1.raster.tile.combineDouble(v2.raster.tile){ (z1, z2) => {
if(isData(z1) && isData(z2)) (z1 + z2) / 2
Double.NaN // TODO: investigate why returning NODATA is not producing the expected output
GeoTiff(tile,extent,WebMercator)
Hello all!
I’m trying to use the new S3COGLayerWriter to write DEM in an S3 catalog. I managed to use the write to properly add dem data in my COG S3 catalog. However, I’m not able to use
the update on the writer. Can someone share an example of a scala script used to update data in a S3 COG catalog?
Here is the script I’m trying to implement, but I keep having an error :
found : (geotrellis.raster.io.geotiff.SinglebandGeoTiff, geotrellis.raster.io.geotiff.SinglebandGeoTiff) => geotrellis.raster.io.geotiff.SinglebandGeoTiff
[error] required: Option[(geotrellis.raster.io.geotiff.GeoTiff[?], geotrellis.raster.io.geotiff.GeoTiff[?]) => geotrellis.raster.io.geotiff.GeoTiff[?]]
I tried to use GeoTiff type for v1 and v2, but there is no combineDouble method for this type.
val store: S3AttributeStore = S3AttributeStore(bucket, catalog)
val writer = S3COGLayerWriter(store)
writer.update(layername, rdd, z, (v1:SinglebandGeoTiff, v2:SinglebandGeoTiff) => {
val
extent = v1.raster.extent
val
tile = v1.raster.tile.combineDouble(v2.raster.tile){ (z1, z2) => {
if(isData(z1) && isData(z2)) (z1 + z2) /
2
else if
(isData(z1)) z1
else if
(isData(z2)) z2
else{
Double.NaN // TODO: investigate why returning NODATA is not producing the expected output
}
}
}
GeoTiff(tile,extent,WebMercator)
})
Thanks!
Josée-Anne Langlois
_______________________________________________
geotrellis-user mailing list
geotrellis-user@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geotrellis-user
--
С уважением,
Помадчин Григорий.
Skype: daunnc
ICQ: 133662
_______________________________________________
geotrellis-user mailing list
geotrellis-user@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geotrellis-user
--
С уважением,
Помадчин Григорий.
Skype: daunnc
ICQ: 133662
|