Filtering MapsΒΆ

This section shows the GeoServer WMS fitering capabilities.

  1. Navigate to the GeoServer Welcome Page.

  2. Go to the Layer Preview link at the bottom of the lefthand menu and show the geosolutions:WorldCountries layer with OpenLayers ‘Common Format’.

    ../../_images/filtering1.png

    Showing the GeoServer layer prewiew

    ../../_images/filtering2.png

    Show the layer with OpenLayers

  3. From the Filter combo box select ‘CQL’ and enter the following command in the text field:

    POP_EST <= 5000000 AND POP_EST >100000
    
  4. Click ‘Apply Filter’ botton on the right.

    ../../_images/filtering3.png

    Result of the CQL filter

  5. Now enter the following command in the text field:

    DISJOINT(the_geom, POLYGON((-90 40, -90 45, -60 45, -60 40, -90 40))) AND strToLowerCase(NAME) LIKE '%on%'
    
  6. Click ‘Apply Filter’ botton on the right.

    ../../_images/filtering6.png

    Result of the CQL filter

  7. From the Filter combo box select ‘OGC’ and enter the following filter in the text field:

    <Filter><PropertyIsEqualTo><PropertyName>TYPE</PropertyName><Literal>Sovereign country</Literal></PropertyIsEqualTo></Filter>
    
  8. Click ‘Apply Filter’ botton on the right.

    ../../_images/filtering4.png

    Result of the OGC filter

  9. From the Filter combo box select ‘FeatureID’ and enter the following features ids in the text field separated by comma:

    WorldCountries.227,WorldCountries.184,WorldCountries.33
    
  10. Click ‘Apply Filter’ botton on the right.

    ../../_images/filtering5.png

    Result of the FeatureID filter