diff --git a/store/src/main/scala/geotrellis/store/GeoTrellisPath.scala b/store/src/main/scala/geotrellis/store/GeoTrellisPath.scala index 3b85b27513..7c845f8e2d 100644 --- a/store/src/main/scala/geotrellis/store/GeoTrellisPath.scala +++ b/store/src/main/scala/geotrellis/store/GeoTrellisPath.scala @@ -55,9 +55,9 @@ object GeoTrellisPath { implicit def toGeoTrellisDataPath(path: String): GeoTrellisPath = parse(path) def parseOption(path: String): Option[GeoTrellisPath] = { - val layerNameParam: String = "layer" - val zoomLevelParam: String = "zoom" - val bandCountParam: String = "band_count" + val layerNameParam = "layer" + val zoomLevelParam = "zoom" + val bandCountParam = "band_count" val uri = UrlWithAuthority.parseOption(path).fold(Url.parse(path))(identity) val queryString = uri.query @@ -79,9 +79,9 @@ object GeoTrellisPath { } catalogPath.fold(Option.empty[GeoTrellisPath]) { catalogPath => - val maybeLayerName: Option[String] = queryString.param(layerNameParam) - val maybeZoomLevel: Option[Int] = queryString.param(zoomLevelParam).map(_.toInt) - val bandCount: Option[Int] = queryString.param(bandCountParam).map(_.toInt) + val maybeLayerName = queryString.param(layerNameParam) + val maybeZoomLevel = queryString.param(zoomLevelParam).map(_.toInt) + val bandCount = queryString.param(bandCountParam).map(_.toInt) (maybeLayerName, maybeZoomLevel) match { case (Some(layerName), Some(zoomLevel)) => diff --git a/store/src/test/scala/geotrellis/store/GeoTrellisPathSpec.scala b/store/src/test/scala/geotrellis/store/GeoTrellisPathSpec.scala index 68a048010d..a61d77fd52 100644 --- a/store/src/test/scala/geotrellis/store/GeoTrellisPathSpec.scala +++ b/store/src/test/scala/geotrellis/store/GeoTrellisPathSpec.scala @@ -108,7 +108,7 @@ class GeoTrellisPathSpec extends AnyFunSpec { it("should ignore invalid parameters") { val path = GeoTrellisPath.parse("file:///foo/bar?layer=baz&zoom=1&invalid=not&nope=1") - assert(path == GeoTrellisPath("file:///foo/bar", "baz", 1, None)) + assert(path == GeoTrellisPath("file:///foo/bar?invalid=not&nope=1", "baz", 1, None)) } } }