From 025bfacbf8b29af2376ed03ddcfb3a8052486754 Mon Sep 17 00:00:00 2001 From: Terence Tuhinanshu Date: Wed, 29 May 2024 16:05:57 -0400 Subject: [PATCH] Add credit, source --- api/src/main/scala/package.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/src/main/scala/package.scala b/api/src/main/scala/package.scala index 50372bf..199fce0 100644 --- a/api/src/main/scala/package.scala +++ b/api/src/main/scala/package.scala @@ -24,6 +24,8 @@ package object geoprocessing { type RasterLayer = TileLayerCollection[SpatialKey] type GeoJSONString = String + // The following is taken from https://github.com/geotrellis/geotrellis-server/tree/feature/stac-example-simple/stac-simple-example/src/main/scala/geotrellis/example by @pomadchin + implicit class AssetsMapOps(private val assets: Map[String, StacAsset]) extends AnyVal { def select(selector: Regex): Option[StacAsset] = assets.find { case (k, _) => selector.findFirstIn(k).nonEmpty }.map(_._2) }