12

I am dealing with some large datasets and would like to minimise the amount of data sent over the network. I am using OpenLayers' BBox strategy to only transfer the data that is needed but I am wondering whether I can simplify the output so that I can show lower zoom levels without having to transfer data with unnecessary accuracy/detail.

I am using GeoServer as a WFS server as part of the OpenGeo bundle.

0

4 Answers 4

8

WFS/GeoServer does not really provide any way to do generalization on the fly based on scale, but there is a special extension that does what you are looking for by doing some pregeneralization.

http://docs.geoserver.org/stable/en/user/data/featurepregen.html

2
3

Some possible solutions:

  • Do you really need the data in a vector format? If the large complex polygons are just for reference then they'll be fine as WMS / images. If you can simplify them then you probably don't need the geometry anyway.
  • You can pass in a generalisation parameter to a map layer through a custom paramter, and use this to simplify geometry. This thread is about MapServer, but I assume something similar can be done with GeoServer - http://osgeo-org.1803224.n2.nabble.com/WFS-Server-Control-output-by-scale-td2279383.html
  • Also referenced in the above thread, you can store the datasets presimplified for different scales and hide/show them in your map as needed
  • Make sure you have gZip compression turned on at your webserver as this will shrink GML/XML files to at least half the size
2
  • I definitely need them in vector format as I want to be able to click on them to get further information as well as edit the polygons (though obviously I only want to be able to edit the true shapes, not the simplified versions, which might be a little tricky).
    – Mr_Chimp
    Commented May 3, 2011 at 16:27
  • 1
    @mr_chimp - you can use the WMS GetFeatureInfo request to return just the geometry and attributes for the feature under a mouse click. Commented May 3, 2011 at 17:26
3

Using the OL cluster strategy, you can simplify the representation (for users) but the amount of data transfered will not be lower, because the clusterization is done on the client side.

See also, the documentation page.

(I don't know about available options on the server side)

4
  • Maybe I'm mistaken but the cluster strategy appears to be for point data. I have complex polygon data which I would like simplify.
    – Mr_Chimp
    Commented May 3, 2011 at 11:53
  • This wouldn't reduce network traffic as all the points would be needed to cluster client side. Commented May 3, 2011 at 16:08
  • @geographika > that's what I wanted to say, but as you can guess I forgot the negation in my sentence (repared now)! It is still a good way to enhanced readability for final users
    – simo
    Commented May 3, 2011 at 21:19
  • @Mr_Chimp > no equivalent for polygons, indeed
    – simo
    Commented May 3, 2011 at 21:22
0

If your concern is that the WFS is 'heavy' (its GML output is verbose by nature), my advice is that instead you use Well-Known Text (WKT), if possible. I guess that OpenLayers' BBox strategy is "compatible" with WKT.

Your Answer

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

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