Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

TODO: Changing / Creating new zoom level (Upsampling / Downsampling) #13

Closed
aklink opened this issue Dec 8, 2017 · 5 comments
Closed
Assignees

Comments

@aklink
Copy link
Member

aklink commented Dec 8, 2017

We need to be able to change resolution / zoom levels if merging (mosaicing or layer stacking) layers with different zoom levels. Current approach selects highest zoom level common to all layers, but it fails if there is no common zoom level.
Also it would be nice to be able to set resolution to a specific value (alos between two zoom levels).

We will try to use ZoomResample for it:

https://github.com/locationtech/geotrellis/blob/master/spark/src/test/scala/geotrellis/spark/resample/ZoomResampleSpec.scala

https://github.com/locationtech/geotrellis/blob/master/spark/src/main/scala/geotrellis/spark/resample/ZoomResample.scala

An other approach is using Regrid:

https://github.com/locationtech/geotrellis/blob/master/spark/src/test/scala/geotrellis/spark/regrid/RegridSpec.scala

https://github.com/locationtech/geotrellis/blob/master/spark/src/main/scala/geotrellis/spark/regrid/Regrid.scala

@aklink aklink self-assigned this Dec 8, 2017
@aklink
Copy link
Member Author

aklink commented Dec 12, 2017

Pull request #14

Add biggis.landuse.spark.examples ZoomResampleLayer to create specific Zoom Level of Layer

ZoomResampleLayer(layerNameIn: String, zoomIn: String, layerNameOut: String, zoomOut: String)(implicit catalogPath: String, sc: SparkContext)

Usage (external call):
ZoomResampleLayer layerNameIn zoomIn layerNameOut zoomOut /path/to/catalog

@aklink
Copy link
Member Author

aklink commented Dec 12, 2017

See also Geotrellis Pull Request: locationtech/geotrellis#2511

@aklink
Copy link
Member Author

aklink commented Jan 18, 2018

For now, issue closed

Uses a wrapper resampleLayerToZoom around geotrellis.spark.resample.ZoomResampleMultibandMethods (not yet in Geotrellis master, pull request pending, using local copy):

  implicit def resampleLayerToZoom(rdd: MultibandTileLayerRDD[SpatialKey], zoomLevelIn: Int, zoomLevelOut: Int)(implicit sc: SparkContext): MultibandTileLayerRDD[SpatialKey] = {
    geotrellis.spark.resample.Implicits.withZoomResampleMultibandMethods(rdd).resampleToZoom(zoomLevelIn, zoomLevelOut)
  }

Combined with Pyramid.up for 'both way' resampling:

    val outputRdd : SpatialMultibandRDD = 
      if(zoomOut > zoomIn) resampleLayerToZoom(inputRdd, zoomIn.toInt, zoomOut.toInt)   // UpSample (DownLevel) using ZoomResample
      else if(zoomOut < zoomIn) Pyramid.up( inputRdd, ZoomedLayoutScheme(inputRdd.metadata.crs), zoomOut.toInt)._2  // DownSample (UpLevel) using Pyramid.up
      else inputRdd

@aklink aklink closed this as completed Jan 18, 2018
@aklink
Copy link
Member Author

aklink commented Feb 26, 2018

MultibandTile Support added to Geotrellis:
locationtech/geotrellis@3dbcc4f

@aklink
Copy link
Member Author

aklink commented Feb 26, 2018

see locationtech/geotrellis#2569

aklink added a commit that referenced this issue Feb 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant