MapStore Training

Previous topic

Using the GeoLocation Menu

Next topic

Using the Print Plugin

This Page

Using the BBOXQueryForm PluginΒΆ

This section illustrates how you can use the BBOQueryForm Plugin. The BBOX Query Form plugin allows performing queries on feature layers. Using this plugin you can create alphanumeric queries on feature attributes and/or spatial query on a specific region of ??interest. You can also perform spatial queries by drawing Polygon, Circle or Buffer.

Note

This plugin requires another plugin named FeatureGrid in order to show the query results (features). The FeatureGrid allows the User to display vector features in the Map with paging. The User have also the possibility to zoom to a single feature or to a page and to export data in CSV format.

  1. Open the MapComposer.

    ../../_images/bboxquery1.png

    MapComposer with BBOXQueryForm and FeatureGrid plugins.

    Note

    This Viewer configuration provides the World Countries layer that will be used in this section to perform queries. When the user click on the layer node in TOC the BBOXQueryForm will be enabled and automatically configured to perform queries on the selected layer, only if this layer is not a Raster.

  2. At startup the BBOXQueryForm tool is disabled. Click on the World Countries layer in TOC:

    ../../_images/layerselection.png

    Layer selection in order to enable the plugin.

    After that the plugin will be enabled. So the User can perform a query through:

    1. The Region Of Interest (ROI): The User have to select first the spatial tool using the dropdown on top of the panel. Then the User can draw the ROI accordingly the Selection method (by default Bounding Box).

      ../../_images/spatial.png

      Selection of the Region Of Interest.

      Note

      By default the User can select the ROI drawing the BBOX. Other possible selection are:

      • Cricle
      • Polygon
      • Buffer
    2. Query by attributes: With this tool the User can search features specifying an OGC filter directly from the GUI.

      ../../_images/attributes.png

      Selection of the Region Of Interest.

      Note

      The OGC Filter is built through OpenLayers using the FeatureType’s attributes returned by a DescribeFeatureType request made to GeoServer.

  3. Select Bounding Box as Selection Method and then click on the SetROI button. Draw a BBOX on the Map with the mouse (left click in a point of the Map and drag, then release the mouse).

    ../../_images/query1.png

    Draw a BBOX.

    When the BBOX it was drawn a tooltip show a Summary Selection (for example selected Area and Perimeter for Polygons).

  1. Now expand the Query by attribute fill fields in order to make the OGC filter. Use:

    • Match: any

    • Attribute: GEOUNIT (selected from the dropdown)

    • Logical Operator: like

    • Value: S*

      ../../_images/query2.png

      Build the OGC Filter.

  2. Click on Query button.

  3. The result is shown in the FeatureGrid panel. Click on Display on map button in order to highlight features on Map.

    ../../_images/query3.png

    Results in FeatureGrid.

    ../../_images/query4.png

    Display features in the Map.

    Note

    The User can select a Row of the Features list in order to highlight the related feature in the Map.

  4. Click on the magnifying glass icon (first column of the feature in the Grid) in order to perform the zoom the the selected feature.

    ../../_images/query5.png

    Single feature selection.

  5. Export selected data as CSV format. Click on Export to CSV and select for example on Single Page.

    ../../_images/query6.png

    Export data in CSV format.

    ../../_images/query7.png