Using Freemarker templates to change WMS responses

Until now, the methods of controlling GeoServer output we have focused on have been concerned with the rendered output. We are going to change the track slightly now and take a look at how we can manipulate the response that GeoServer provides to WMS GetFeatureInfo requests.

A GetFeatureInfo request is a standard WMS request that returns the feature information for a given location on a map for one or more layers. In essence, it is the equivalent of a standard feature's information interrogation that one might do in a Desktop GIS. GeoServer receives the request and then calculates if any features of the given layer, or layers, intersect the location specified.

If any features are hit, then they ...

Get Mastering GeoServer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.