2

This is a tricky one - so bear with me... i'm a Geoserver newbie...

Basically, i have two very similar queries that return species records for a given species in a given geograpic area. One query uses WFS (returns JSON data that I then parse and map on Google maps); the other uses WMS and returns a map with the records just plotted as points.

Despite there being no obvious filtering on the WMS (apart from the species name and bounding box), the WMS only returns a fraction of the records.

I'm running Geoserver 2.3.3 on Windows server 2008. All the data I am querying is in shapefiles.

Here is the WMS query:

    <?xml version="1.0" encoding="UTF-8"?>
<ogc:GetMap xmlns:ogc="http://www.opengis.net/ows" xmlns:gml="http://www.opengis.net/gml" version="1.1.1" service="WMS">

<StyledLayerDescriptor version="1.0.0">

<NamedLayer>
    <Name>wales_lrcs</Name>  
    <NamedStyle>
        <Name>polygon_empty_red</Name>
    </NamedStyle>
</NamedLayer>

<NamedLayer>
    <Name>bis_4_other_species</Name>  
    <UserStyle xmlns="http://www.opengis.net/sld">
      <FeatureTypeStyle>
      <Rule>
      <Filter xmlns="http://www.opengis.net/ogc">
        <And>
          <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
          <ogc:PropertyName>SPECIES</ogc:PropertyName>
          <ogc:Literal>Amanita muscaria*</ogc:Literal>
          </ogc:PropertyIsLike>
        </And>
      </Filter>
      <PointSymbolizer>
        <Geometry>
          <PropertyName xmlns="http://www.opengis.net/ogc">the_geom</PropertyName>
        </Geometry>
        <Graphic>
          <Mark>
            <WellKnownName>SQUARE</WellKnownName>
            <Fill>
              <CssParameter name="fill">#0000CC</CssParameter>
            </Fill>
          </Mark>
          <Size>4</Size>
        </Graphic>
      </PointSymbolizer>
      </Rule>
    </FeatureTypeStyle>
    </UserStyle>
</NamedLayer>

</StyledLayerDescriptor>

<BoundingBox srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
    <gml:coord>
        <gml:X>-5.625</gml:X>
        <gml:Y>51.255</gml:Y>
    </gml:coord>
    <gml:coord>
        <gml:X>-2.395</gml:X>
        <gml:Y>53.572</gml:Y>
    </gml:coord>
</BoundingBox>

<Output>
    <Format>image/png</Format>
    <Transparent>false</Transparent>
    <Size>
        <Width>500</Width>
        <Height>600</Height>
    </Size>
</Output>

<Exceptions>application/vnd.ogc.se+xml</Exceptions>
</ogc:GetMap>

And here is the WFS query:

<wfs:GetFeature 
service="WFS" 
version="1.1.0" 
outputFormat="JSON" 

xmlns:wfs="http://www.opengis.net/wfs" 
xmlns:ogc="http://www.opengis.net/ogc" 
xmlns:gml="http://www.opengis.net/gml" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="bis_workspace:bis_4_other_species">
<ogc:Filter>
    <ogc:And>
        <ogc:DWithin>
            <ogc:PropertyName>the_geom</ogc:PropertyName>
            <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
                <gml:lowerCorner>-5.625 51.255</gml:lowerCorner>
                <gml:upperCorner>-2.395 53.572</gml:upperCorner>
            </gml:Envelope>
            <ogc:Distance units="meter">0</ogc:Distance>
        </ogc:DWithin>
        <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
            <ogc:PropertyName>SPECIES</ogc:PropertyName>
            <ogc:Literal>Amanita muscaria*</ogc:Literal>
        </ogc:PropertyIsLike>
    </ogc:And>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Map from the WMS query (pretty much only one record returned!):

WMS

And the WFS points plotted on Google Maps (returns 32 features):

WFS

Any help would be very much appreciated!

Steve


Here is the output from the Geoserver log with developer debugging turned on. Log is for the WMS query - I'm assuming that's where the issue is:

    2013-09-12 17:01:37,784 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:37,784 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:37,784 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:37,785 DEBUG [org.geoserver] - Thread 18 locking in mode READ
2013-09-12 17:01:37,785 DEBUG [org.geoserver] - Thread 18 got the lock in mode READ
2013-09-12 17:01:37,790 DEBUG [org.geoserver] - Thread 18 releasing the lock in mode READ
2013-09-12 17:01:37,790 DEBUG [org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed
2013-09-12 17:01:37,790 DEBUG [org.geoserver.filters] - Compressing output for mimetype: text/xml; charset=utf-8
2013-09-12 17:01:41,540 DEBUG [org.geoserver.security] - Start searching for expired authentication tokens
2013-09-12 17:01:41,540 DEBUG [org.geoserver.security] - Number of expired authentication tokens found: 0
2013-09-12 17:01:41,540 DEBUG [org.geoserver.security] - End searching for expired authentication tokens
2013-09-12 17:01:43,728 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:43,729 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:43,729 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:43,730 DEBUG [org.geoserver] - Thread 18 locking in mode READ
2013-09-12 17:01:43,730 DEBUG [org.geoserver] - Thread 18 got the lock in mode READ
2013-09-12 17:01:43,738 DEBUG [org.geoserver] - Thread 18 releasing the lock in mode READ
2013-09-12 17:01:43,739 DEBUG [org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed
2013-09-12 17:01:43,739 DEBUG [org.geoserver.filters] - Compressing output for mimetype: text/xml; charset=utf-8
2013-09-12 17:01:43,949 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:43,949 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:43,949 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/web/]
2013-09-12 17:01:43,950 DEBUG [org.geoserver] - Thread 18 locking in mode READ
2013-09-12 17:01:43,950 DEBUG [org.geoserver] - Thread 18 got the lock in mode READ
2013-09-12 17:01:43,952 DEBUG [org.geoserver] - Thread 18 releasing the lock in mode READ
2013-09-12 17:01:43,952 DEBUG [org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed
2013-09-12 17:01:43,952 DEBUG [org.geoserver.filters] - Compressing output for mimetype: text/html; charset=utf-8
2013-09-12 17:01:44,037 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/TestWfsPost]
2013-09-12 17:01:44,037 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/TestWfsPost]
2013-09-12 17:01:44,037 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/TestWfsPost]
2013-09-12 17:01:44,037 DEBUG [org.geoserver.ows.OWSHandlerMapping] - Mapping [/TestWfsPost] to HandlerExecutionChain with handler [org.springframework.web.servlet.mvc.ServletWrappingController@ae2984] and 1 interceptor
2013-09-12 17:01:44,041 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/wms]
2013-09-12 17:01:44,041 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/wms]
2013-09-12 17:01:44,041 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/wms]
2013-09-12 17:01:44,041 DEBUG [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/wms]
2013-09-12 17:01:44,041 DEBUG [org.geoserver.ows.OWSHandlerMapping] - Mapping [/wms] to HandlerExecutionChain with handler [org.geoserver.ows.Dispatcher@1958a34] and 1 interceptor
2013-09-12 17:01:44,042 DEBUG [org.vfny.geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
2013-09-12 17:01:44,042 DEBUG [org.vfny.geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
2013-09-12 17:01:44,042 DEBUG [org.vfny.geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
2013-09-12 17:01:44,042 DEBUG [org.vfny.geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
2013-09-12 17:01:44,042 DEBUG [org.geoserver.ows] - Raw XML request starts with: <?xml version="1.0" encoding="UTF-8"?>
<ogc:GetMap xmlns:ogc="http://www.opengis.net/ows" xmlns:gml="http://www.opengis.net/gml" version="1.1.1" service="WMS">
<StyledLayerDescriptor version="1.0.0">
<NamedLayer>
    <Name>wales_lrcs</Name>  
    <NamedStyle>
        <Name>polygon_empty_red</Name>
    </NamedStyle>
</NamedLayer>
<NamedLayer>
    <Name>bis_4_other_species</Name>  
    <UserStyle xmlns="http://www.opengis.net/sld">
      <FeatureTypeStyle>
      <Rule>
      <Filter xmlns="http://www.opengis.net/ogc">
        <And>
          <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
          <ogc:PropertyName>SPECIES</ogc:PropertyName>
          <ogc:Literal>Amanita muscaria*</ogc:Literal>
          </ogc:PropertyIsLike>
        </And>
      </Filter>
      <PointSymbolizer>
        <Geometry>
          <PropertyName xmlns="http://www.opengis.net/ogc">the_geom</PropertyName>
        </Geometry>
        <Graphic>
          <Mark>
            <WellKnownName>SQUARE</W...
2013-09-12 17:01:44,045 INFO [org.geoserver.wms] - 
Request: getServiceInfo
2013-09-12 17:01:44,064 DEBUG [org.geoserver.wms] - setting up map
2013-09-12 17:01:44,085 DEBUG [org.geoserver.wms.map] - setting up 500x600 image
2013-09-12 17:01:55,360 INFO [org.geoserver.wms] - 
Request: getMap
    Filters = null
    Tiled = false
    Palette = null
    SRS = EPSG:4326
    FeatureVersion = null
    Styles = [StyleImpl[ name=polygon_empty_red], StyleImpl[ name=Default Styler]]
    Layers = [org.geoserver.wms.MapLayerInfo@2c1e2b26, org.geoserver.wms.MapLayerInfo@c1e22fea]
    MaxFeatures = null
    Bbox = Env[-5.625 : -2.395, 51.255 : 53.572]
    Env = {}
    Angle = 0.0
    CQLFilter = null
    Elevation = []
    FeatureId = null
    RemoteOwsType = null
    RemoteOwsURL = null
    FormatOptions = {}
    StartIndex = null
    ViewParams = null
    Crs = GEOGCS["WGS 84", 
  DATUM["World Geodetic System 1984", 
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
    AUTHORITY["EPSG","6326"]], 
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
  UNIT["degree", 0.017453292519943295], 
  AXIS["Geodetic longitude", EAST], 
  AXIS["Geodetic latitude", NORTH], 
  AUTHORITY["EPSG","4326"]]
    Transparent = false
    ValidateSchema = false
    SldVersion = null
    BgColor = java.awt.Color[r=255,g=255,b=255]
    SldBody = null
    Sld = null
    TilesOrigin = null
    Exceptions = application/vnd.ogc.se+xml
    Height = 600
    Width = 500
    Filter = null
    Time = []
    Format = image/png
    Buffer = 0
    Request = GetMap
    RawKvp = null
    Get = false
    BaseUrl = http://localhost:8080/geoserver/
    RequestCharset = null
    Version = 1.1.1
2013-09-12 17:01:55,361 DEBUG [org.geoserver.wms.map] - Writing png image ...
2013-09-12 17:01:55,475 DEBUG [org.geoserver.wms.map] - Writing png image ... done!
2013-09-12 17:01:55,475 DEBUG [org.geoserver.filters] - Not compressing output for mimetype: image/png
2013-09-12 17:01:55,476 DEBUG [org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed
2013-09-12 17:01:55,483 DEBUG [org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed
  • what does the log say (try with GeoTools Developer debug turned on)? – Ian Turton Sep 9 '13 at 13:06
  • Argh - could you give me a few hints how I can do this? – user8262 Sep 11 '13 at 15:23
  • go to the settings-global (menu on the left) and in logging profile window select GEOTOOLS_DEVELOPER_LOGGING, then hit submit button. run query and then look in $GEOSERVER_DATA_DIR/logs/geoserver.log – Ian Turton Sep 11 '13 at 15:29
  • Thanks! Here is the output from the WMS query - I'm assuming the issue is with the WMS rather than the WFS. Argh... the log test is too long.. added it to the original question. – user8262 Sep 12 '13 at 16:05
  • Still stuck on this. Anyone got any ideas? Is there any form of automatic filtering applied to WMS queries? – user8262 Jul 16 '14 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.