[GIS] GML, KML, GeoJSON – Speed rendering 3109 polygons

geojsongeoservergmlkmlwfs

I am working with Geoserver, serving U.S. Lower 48 counties to openlayers (3109 polygons – lots more vertices). The counties are loaded into a postgis database. I am curious about developer experience when trying to push that quantity of vertices to the client.

What WFS format have you attained the best results with? Has additional tuning to Geoserver been used?

I realize that tiled WMS would be faster, but I want to allow for dynamic changes in a choropleth map using openLayers, ie. the user submits a form, a Python script is called, and new data bins are returned for openlayers to reload the map div. I also want to try this in full resolution form before reducing polygon complexity in openlayers.

Best Answer

Maybe this triggers some new ideas: I've got an application running where users can edit a map with many elements.

Instead of sending all data as WFS, I use WMS maps, and when the user clicks, or draws a selection, I fetch the selected items as WFS.

After sending an update back to the server, I refresh the WMS layer.

There are some OpenLayers examples that demonstrate how you can do that. You'll probably have to tweak it a bit, but OpenLayers+GeoServer will work out the difficult part for you. The data is sent gzipped, so the original format is not even that important; it's not the bottleneck. Let OpenLayers and GeoServer figure out what format they use to exchange information.

This approach scales pretty well. Even people with slow connections and slow computers can use it to edit the map. Fetching hundreds of elements is very quick, and you probably won't need more than that at the same time to edit.

Finally.. off-topic, but as you intend to do client-side stuff with map data: Keep in mind that IE7 and lower are going to be problematic if you want to draw polygons with OpenLayers. OpenLayers uses SVG for client-side drawing, and IE7 and lower don't have support built in. Those users will be required to download a crappy old plugin. All other browsers are fine.