Skip to content

Interoperability of STAC and non-STAC layers in mapalgebra layers #309

@micpilon

Description

@micpilon

Creating a mapalgebra layer with a time dimension does not work when trying to make a STAC source layer interact with another layer (i.e. a single COG). The typical behavior is that the service starts without error, but a Key not found error for the stacsourceconf layer is triggered at the first GetMap request.

COG

msi-2000 = {
        type = "rastersourceconf"
        name = "msi-2000"
        title = "Probability of MSI presence in 2000"
        source = "s3://../store/eo4ce/msi/msi-2000-cog.tif"
	default-style = "default"
        styles = [ ]
}

STAC

msi = {
    	type = "stacsourceconf"
    	name = "msi" 
    	title = "Probability of the annual minimum snow and ice presence over Canada"
    	layer = "eo4ce-msi" 
    	asset = "cog" 
    	asset-limit = 1000 
    	source = "http://localhost:9090/" 
    	default-time = true
    	default-style = "default"
    	styles = [ ]
}

Combination of COG and STAC

msi-difference-2000 = {
    	type = "mapalgebrasourceconf"
    	name = "msi-difference-2000"
    	title = "Evolution of the annual minimum snow and ice presence since 2000 (%)"
		algebra = {
			"args" : [
				{
					"name" : "msi",
					"symbol" : "rasterV"
				},
				{
					"name" : "msi-2000",
					"symbol" : "rasterV"
				}
			],
			"symbol" : "-"
		}
    	default-style = "default"
    	styles = []
}

This configuration generates a WMS-T and the layer msi-difference-2000 is offered in the server's capabilities. However, a GetMap request such as:

..?service=WMS&
request=GetMap&
version=1.3.0&
layers=msi-difference-2000&
styles&
format=image%2Fpng&
transparent=false&
dbl=100.0&
width=1176&
height=800&
crs=EPSG%3A3857&
bbox=-8845904.409386879%2C10580107.707120959%2C-7407665.285173003%2C11558501.66917121

Throws:

java.util.NoSuchElementException: key not found: msi
	at scala.collection.MapLike.default(MapLike.scala:235)
	at scala.collection.MapLike.default$(MapLike.scala:234)
	at scala.collection.AbstractMap.default(Map.scala:65)
	at scala.collection.MapLike.apply(MapLike.scala:144)
	at scala.collection.MapLike.apply$(MapLike.scala:143)
	at scala.collection.AbstractMap.apply(Map.scala:65)
	at geotrellis.server.LayerExtent$.$anonfun$apply$9(LayerExtent.scala:54)
	at cats.Parallel$.$anonfun$parTraverse$1(Parallel.scala:136)
	at cats.instances.ListInstances$$anon$1.$anonfun$traverse$2(list.scala:78)
	at cats.instances.ListInstances$$anon$1.loop$2(list.scala:68)
	at cats.instances.ListInstances$$anon$1.$anonfun$foldRight$1(list.scala:68)
	at cats.Eval$$anon$6.$anonfun$start$3(Eval.scala:275)
	at cats.Eval$.loop$1(Eval.scala:336)
	at cats.Eval$.cats$Eval$$evaluate(Eval.scala:368)
	at cats.Eval$Defer.value(Eval.scala:257)
	at cats.instances.ListInstances$$anon$1.traverse(list.scala:77)
	at cats.instances.ListInstances$$anon$1.traverse(list.scala:16)
	at cats.Parallel$.parTraverse(Parallel.scala:136)
	at cats.syntax.ParallelTraversableOps$.parTraverse$extension(parallel.scala:99)
	at geotrellis.server.LayerExtent$.$anonfun$apply$8(LayerExtent.scala:51)
	at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:145)
	at cats.effect.internals.IORunLoop$RestartCallback.signal(IORunLoop.scala:366)
	at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:387)
	at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:330)
	at cats.effect.internals.IOShift$Tick.run(IOShift.scala:36)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

I can provide you with samples if needed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions