Customising Identify results (GFI - Get Feature Info)

“GetFeatureInfo is a WMS standard call that allows one to retrieve information about features and coverages displayed in a map”

The map can be composed of various layers, and GetFeatureInfo can be instructed to return multiple feature descriptions, which may be of different types. GetFeatureInfo can generate output in various formats:

  • GML2, plain text
  • GeoJSON
  • HTML

When clicking on a map layer information about the underlying data is retrieved and shown to the user. The structure of how the response is shown can be customized through the attribute table or through GeoServer Get Feature info templates.

You try:

Goal: Customize the appearance of get feature info for a single layer

  • Load the layer in the exercise data
  • View the layer. Click on any spatial feature on the map. An identify panel will popup and show you the attributes of the feature you have clicked.
  • Click on Editing Tool and select Wizard under the Metadata tab
  • Page the metadata wizard until you reach the last page where you can see the attributes of the layer.
  • Change the display type of some attributes to match the Options table
  • Update your changes
  • Click on a map feature again and visualize the results.
  • Use the layer to create a map.
  • In map view click on the feature and visualize the attributes. The identify panel is bigger in the map view or map creation page.

Todo
If you are an advanced user you can customize the look of your identify panel by writing HTML in the attribute table under the metadata wizard

Name Expectation

descrip

Display type - URL

images

Display type - Image

video

Display type - Video (mp4)

descrip

Label - Station Link

video

Label - Police in Action

More about viewing layer attributes

An attribute is an additional information (non-spatial) about a geographic feature. Attributes allow you to understand the properties of the geographic feature. Users can query, visualize, and analyze the data. The attributes are usually stored in a table and linked to the feature by a unique identifier. When creating spatial features the data types that can be created are dependent on the data provider used i.e PostgreSQL, Geopackage, and Esri Shapefile.

The main field types of an attribute are

  • Character data
  • Numeric data
  • Date time
  • Blob

In GeoNode when an attribute contains a URL or links to videos you can decide what you want to do when you identify the feature with that URL. The default behavior is just to see the links as normal data but after customizing the way you want to visualize this you can have videos automatically play or have URL show as proper links.

Check your knowledge:

  1. Is it possible to only show a subset of the atrributes when identifying features:

    1. No
    2. Yes
  2. If I wanted to view the identify results as a table I would:

    1. Ask the administrator to write new function to do this
    2. Use the custom templates and write some custom HTML to achieve this
    3. It is not possible to do this in the GeoNode
  3. Why would a user want to give an attribute name a new label:

    1. To showcase the powers of GeoNode
    2. To give meaningful decsription for attribute columns.

Further reading:

Download the sample data for the lesson.