Skip to content

Instantly share code, notes, and snippets.

@jericks
Created November 18, 2014 03:29
Show Gist options
  • Save jericks/57ea9e7a8ba5ad1f43a0 to your computer and use it in GitHub Desktop.
Save jericks/57ea9e7a8ba5ad1f43a0 to your computer and use it in GitHub Desktop.
import geoscript.layer.*
import geoscript.geom.Bounds
import geoscript.proj.Projection
import javax.imageio.ImageIO
MBTiles mbtiles = new MBTiles(new File("geography-class.mbtiles"))
Raster raster = mbtiles.getRaster(mbtiles.tiles(4)).reproject(new Projection("EPSG:4326")).resample(bbox: new Bounds(-180,-90,180,90,"EPSG:4326"), size: [800,400])
ImageIO.write(raster.image, "png", new File("geography-class.png"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment