GeoMesa Raster Support¶
This tutorial will show you how to:
- Deploy and use the raster data support in GeoMesa
- Prepare and ingest raster data
- Conduct WMS/WCS queries of raster data
For Accumulo deployment, you will need access to an Accumulo 1.7.x, 1.8.x or 1.9.x instance.
Before you begin, you should have these:
- basic knowledge of GeoTools and GeoServer
- access to a GeoServer 2.8.x installation
- an Accumulo user that has both create-table and write permissions
- the Geospatial Data Abstraction Library (GDAL) installed
Before you begin, you should have also set up GeoMesa, using the instructions in GeoMesa Raster.
The Raster support in GeoMesa was produced to support image pyramids in
Currently WMS and WCS (version 1.0.0) queries are supported via the GeoServer plugin.
First, download and extract the example data set NE2_HR_LC_SR_W_DR.zip from Natural Earth (this is the
“large size” raster data for “Natural Earth 2 with Shaded Relief, Water, and Drainages” on this download page).
To ingest the raster image into GeoMesa, you must first produce an image pyramid from this file by using
gdal_retile.py. For an explanation of the parameters used below, see
the gdal_retile documentation.
$ gdal_retile.py -v -pyramidOnly -r lanczos -levels 4 \ -ps 675 675 -targetDir ./ NE2_HR_LC_SR_W_DR.tif
Once the image pyramid has been prepared, ingest the tiles using the GeoMesa command line tools. To do this you will first need to follow the tools deployment instructions in Setting up the Accumulo Command Line Tools. Once the GeoMesa tools have been deployed you will be able to ingest the prepared pyramid:
$ geomesa-accumulo ingest-raster -u username -p password \ -t natearth -f "/path/to/pyramid/1/" -F geotiff
The ingest needs to be repeated per level of the pyramid generated by GDAL. Keep the table name (in this case “natearth”) the same between runs of the ingest. Once this process is complete you will need to register the table into a GeoServer coverage store of the type “GeoMesa Coverage Format”.
When attempting to ingest your own rasters, tiles should be on the order of 128x128 to 1024x1024 pixels.
The GeoMesa GeoServer community module is required to enable registering GeoMesa Raster layers in GeoServer. If you have not already, please follow the instructions in GeoMesa Raster.
Registering in GeoServer¶
To view the ingested pyramid via WMS and WCS you must register the new table in a “Accumulo (Geomesa Raster)” coverage store in the GeoServer UI. Login to your GeoServer and follow these steps:
- Add a new datastore to GeoServer by navigating to the Stores page and then click “Add new Store”.
- Click the “Accumulo (Geomesa Raster)” as an option under “Raster Data Sources”
- Fill in the fields as appropriate to your Accumulo and Zookeeper configurations. The “accumulo.catalog” field must match the name of the table we ingested the demo data to.
- Click “Save”, then click “Publish” when GeoServer prompts you to add the layer.
- Once you have completed registering the layer, you should be able to use the open layers preview for the layer to view the raster via WMS.
WCS version 1.0.0 queries are fairly similar to WMS queries. Try running the following WCS query on the Natural Earth test data table by first modifying and running the following url as needed for your GeoServer configuration.
This will return a GeoTIFF of the extension requested. As in the WMS open layers viewer, the tiles are concatenated together into a mosaic.