Viewing Raster Data with GeoTrellis 0.8.1

Viewing Raster Data with GeoTrellis 0.8.1

GeoTrellis 0.8.1 is out, and with it is a new way to view your Raster data in an easy an informative way. In this blog post, we’ll take a look at some Pennsylvania elevation data using the new GeoTrellis admin tool.

The data that we’ll be viewing is from the National Elevation Database (ND) developed by the U.S. Geological Survey. In a tutorial on the GeoTrellis documentation site, we saw how to get the data and convert the GeoTIFF rasters into the ARG format required by GeoTrellis. With GeoTrellis 0.8.1, when you use the geotrellis-server project to develop REST services with GeoTrellis, you have the option to also serve an administration tool on the /admin path of the Jetty server. You only have to make sure that some options in your application configuration are set correctly (or not set, as these are the defaults). The settings are geotrellis.admin.serve-site = “yes” and geotrellis.admin.serve-from-jar = “yes”. The first setting tells the GeoTrellis server to start the services required by the admin site. The second tells the GeoTrellis server to serve up the static files that make up the admin site. The javascript, css and html files that make up the site are packaged into the goetrellis-server JAR.

Starting the admin tool

If we run the server (see the tutorial or the README on the github page for the code for how to run the server), we can go to http://localhost:8880/admin/ and get to the admin site:

In this case, the admin site is showing data from a catalog that I have locally. The catalog’s name is “Catalog of Rob’s Data”, and it has a number of data stores (indicated by the folders on the left). The catalog that the admin site displays is the one set in the configuration as geotrellis.catalog. For more information about the GeoTrellis catalog, see the overview section on the subject in the documentation.

We can open up the ‘NED data’ data store and select Philadelphia to visualize the raster:

The raster fits over the base map perfectly. This is because both the base layer and the raster have a projection of Web Mercator (ESPG:3857); if the raster was not in that projection, it would be places in an incorrect spot on the map (although you would still be able to view it).

Changing the base layer

We can choose another base layer using the Leaflet layer chooser on the right side of the map:

Let’s change it to the Stamen Toner layer, and increase the opacity of the raster using the Opacity slider, in order to get a more clear view of the coloring:

Now we can zoom the map to a region we’re interested in. Here I’ve zoomed to the Walnut street bridge from center city to West Philly. Anyone who’s biked that way can tell you that the elevation increase looks correct!

Changing the Color Ramp

To see the raster in a different color ramp, we can use the ‘Color Ramps’ chooser:
Here I’ve selected a much brighter ramp. Notice the legend in the top left, showing the relative values of the different color breaks.

Seeing Raster Values

Often when viewing a raster, you want some way to see the underlying values at a certain point. With the GeoTrellis admin tool, this is easy. Just click the map and you’ll get a 7×7 grid of values centered at the point where you clicked. The highlighted cell is the value directly under the mouse click. Here I’m looking at values on the hill…
…which as we would expect read higher than the values by the water:
That wraps up our tour of the GeoTrellis admin tool. Happy mapping!