This tutorial goes over how to process a single landsat image on a single machine, using GeoTrellis and spark. We will create a server that will serve out tiles onto a web map that represent an NDVI calculation on our image. The calculation of the NDVI and the rendering of the PNG tile will be dynamic and happen per tile request.
Download this landsat image: https://s3.amazonaws.com/geotrellis-sample-datasets/landsat/LC80140322014139LGN00.tar.bz
Un-tar this into data/landsat
The code in src/main/scala/tutorial/MaskRedAndNearInfrared.scala
will do this.
> ./sbt run
Select the tutorial.MaskRedAndNearInfrared
to run.
This will produce data/r-nir.tif
The code in src/main/scala/tutorial/CreateNDVIPng.scala
will do this.
> ./sbt run
Select the tutorial.CreateNDVIPng
to run.
This will produce data/ndvi.png
This step will ingest the multiband image we made a previous step into a indexed tile set that GeoTrellis can quickly read data out of. We'll ingest it as WebMercator tiles, where the tiles are cut according to the Slippy Map tile coordinate representation, at multiple zoom levels.
The code is in the src/main/scala/tutorial/IngestImage.scala
file.
> ./sbt run
Select the tutorial.IngestImage
to run.
Tiles will be generated in the data/catalog
directory.
This step will start a server that will serve out NDVI images onto a web map.
The code is located in the src/main/scala/tutorial/ServeNDVI.scala
file.
> ./sbt run
Select the tutorial.ServeNDVI
to run.
You can now open static/index.html
and see our NDVI tiles on a web map.