Imagery is the most commonly requested basemap of all the Esri base maps available. It provides the spatial context for your authoritative data that vector base maps cannot. Many questions can be easily answered by visually inspecting the imagery, for example how far is that tree away from the power line? or is that a new swimming pool that does not have a building permit?
There is though more to imagery though than visually inspecting in the Red, Green and Blue visual spectrum. Many of today’s satellites capture information in the Yellow, Near Infrared and Far Infrared portions of the electromagnetic spectrum. In fact the latest World View satellite has 16 bands. So how can this extra analytical data be accessed in a web service?
Image services provide an underutilised feature called functions. These are algorithms that can be applied to an image service on-the-fly to reveal hidden information in the imagery. When an image service published, it is not just the visible band that can be published but all bands from a satellite image can be made available. In its simplest form a function can swap these bands being used to display. For example from Red, Green, Blue to Infrared, Red, Green. Another common analysis is Vegetation health through an NDVI analysis. The difference in chlorophyll reluctance and absorbance of plants in the Infrared and Red portion of the spectrum. The best part about using functions is that they are only calculated on the portion of image shown on the screen at the resolution displayed and no new image is created, just an interpretation of the image, all performed server side on-the-fly and then sent to the client. There are some very good examples on the Amazon Landsat 8 demonstrator site found at http://www.esri.com/landing-pages/software/landsat/unlock-earths-secrets
So how are functions created? Well they are a component of an image service, defined as a Raster Function Template, that can be accessed through the REST end point. By default there are no functions on an image service so they need to be added to the service. There are three stages to applying a function to an image service.
It is first necessary to create a function template and this is done through ArcMap.
- In ArcMap, with an image loaded, open the Image Analysis window (click Window > Image Analysis).
- Select the image layer in the Image Analysis window and click the Add Function button.
- The Raster Function Editor window opens containing a default function chain. The Identity function exists when there is no other function. Once you add a function, the Identity function disappears as it is no longer necessary
- Right-click the Identity function, click Insert and then click the function you want to add. A full list of functions is available at http://arcg.is/1RPzg1W
- When you add a function, it is inserted above the function you clicked.
- Modify its settings and click OK the image is updated to reflect the function.
With the function added to the image it is now possible to save it as a template for a raster function on an image service.There are several locations where you have access to a function chain, such as:
- On the Function tab on the Layer Properties dialog box.
- On the Raster Function Editor opened from the Image Analysis window.
In both these locations you can export the function chain to a template.
- Access the function chain.
- Right click the first item () under the Function Chain and click Export as Template
- The function chain opens in the Raster Function Template Editor
- This template must be edited so you can apply it using other raster data, because in its current state, it is set up to work with the data in the function chain from which it was exported. For example, you need to set or clear some variables, such as the input raster datasets. Full details can be found at http://arcg.is/2095WZ2
- Click OK on the Raster Function Properties dialog box to save the changes to the variables.
- Click File > Save to save the raster function template
Now to apply the function to your image service.
- If the image service is published and running, stop it.
- Access the image service properties.
- From the left menu of the Service Editor dialog box, click Function.
- Click the Manage button to open the Manage Raster Function Templates dialog box.
- Add one or more .rft.xml files you created earlier to the list.
- Optionally, choose a raster function template to apply by default by selecting it in the Default drop-down menu.
- Click OK to close the dialog boxes.
- Re-publish the image service.
You can now access the different capabilities of the image service from your web browser. The following rest endpoint easily show the various raster functions in the RasterFunction Infos: tag
Try the raster functions. They reduce the need for additional image services.