10

I have a shapefile with roughly 6,500 points worldwide in it that I am trying to serve with Geoserver 2.2.1 using WMS. All has been apparently fine with it until I implemented a filtering feature on my client application which uses leaflet. When I append a CQL_FILTER (attribute filter, not spatial) into the WMS query, I noticed missing features when zoomed out. When I zoomed back in, they would sometimes reappear, but not always. See the image below -

Side by side comparison

At the zoom level on the left, Atlanta is not displayed. When I zoom in, it is. However, sometimes not even the point in Tampa is displayed at the zoom level on the left. If I zoom out 3 more levels, no points at all will be displayed. I'm not sure the issue is the CQL_FILTER param, as with 6,500 points it's hard to notice a few missing points at a global scale, but the particular filter I'm showing here as an example filters down to only 3 features, and when 1 to 3 of them are missing depending on the zoom level it's particularly noticeable.

I can recreate this same behavior in geoserver's own layer preview using the CQL Filter in the advanced map options, so I'm fairly certain it is not my client application.

As for my own steps at debugging this issue, I have tried the default Points style/sld file to rule out my own layer styling. I have turned off all the caching that I am aware of. I double checked that my projections are correct - I created the shapefile in ArcGIS 10 using WGS_1984_Web_Mercator_Auxiliary_Sphere as the projection, and the layer is set to EPSG:3857 in geoserver, which I think is equivalent. I also upgraded from geoserver 2.2 to 2.2.1 and have had the same issue in both. I have also deleted geoserver's spatial index file (.qix) and let it get recreated since I've seen similar issues in Arc with corrupt spatial indexes, but obviously that did not work either.

Here's a snapshot from Geoserver's own layer preview with the CQL Filter on and zoomed into the same area as shown above. The red circle is approximately where I should be seeing another point (Atlanta).

Openlayers Example

I've tried tweaking every other setting I can think of, but am having no luck. I've also looked up and down the geoserver logs and enabled verbose logging, and do not see any errors/exceptions. I also do not see any bad requests in chrome's developer tools.

If I'm missing any critical info, I'll provide what I can, but this is an internal/non-public application.

15
  • 1
    Ruling out the obvious: do you, by any chance, have scale-dependent styles? (i.e. a point is displayed only between certain scales)
    – unicoletti
    Nov 26, 2012 at 16:02
  • 1
    Can you verify that the values in VENUE_TYPE are valid / consistent? The inconsistent results you're seeing could be due to features being returned in a different order (due to slight differences in the bbox) and one of them is 'bad' in some way, causing the rendering to stop before it hits Atlanta. It might be wise to test exporting your data to a different format then 1) checking everything moved as expected and then 2) re-testing your filter / render
    – tomfumb
    Nov 26, 2012 at 17:09
  • 1
    @unicoletti On the layer displayed in the screenshot, there are scale dependencies, but I see the same result when I use the default 'point' style provided by Geoserver, which has no scale dependencies I see the exact same points disappearing at the same scales.
    – MWrenn
    Nov 26, 2012 at 17:57
  • 1
    @tomfumb I looked over the values in the VENUE_TYPE column and they are all english alphanumeric except for an occasional forward slash '/' or ampersand '&'. I'll take out the records with the slashes and ampersands and see if that makes a difference. As a side note, this shapefile's DBF is encoded in UTF-8 which I set in geoserver as well. Could that make a difference?
    – MWrenn
    Nov 26, 2012 at 18:05
  • 4
    @MWrenn I'm not sure so won't attempt an answer, but exporting the data to another format should help determine if the current store / format is the problem. Perhaps try opening your Shp in ArcMap or QGIS, restricting the area to your example's bbox, then inspect the attributes of the contained features - do these include any special characters that might be affected by encoding?
    – tomfumb
    Nov 26, 2012 at 18:20

1 Answer 1

1

The "solution" I implemented was to import the shapefiles into a postGIS database using shp2pqsql, which resolved the disappearing point features when using a CQL Filter. I can make the exact same CQL filter request and see all the points at all zoom levels now. I then had to tweak a few automated processes to update the postGIS database instead of shapefiles, but it only took a few hours.

I'm still unsure of the root cause of disappearing point features. I tried different projections and shapefile writers (QGis, ESRI, shapefile.py or pyShape or something) with the same exact result everytime. I'm no expert on geoserver, so I'm hesitant to call it a bug, and it's probably something particular to my setup, but I was able to reproduce on two different instances running on two different computer of geoserver running 2.2 and 2.2.1, both on Windows (One Xp, on Server 2003).

I am not able to post the source shapefiles either, so I guess the root cause will remain a mystery.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.