[OpenLayers-Users] vector layers optimization?

Gilles Bassière gilles.bassiere at makina-corpus.com
Mon Oct 6 05:39:47 EDT 2008


Hi list,

In a recent post about hiking trails, I can read: "Be aware though that 
using vector data in a browser can lead to serious performance problems 
when the data becomes large."

Well, I ran into this same problem a few days ago and eventually choose 
a WMS-based solution. Anyway, I remain very interested in client-side 
vector rendering. Before exploring further, I wonder if anyone has 
experience to share regarding large vector dataset.

In my case, my vector layer featured up to several hundreds geometries 
(and the user may overlay more vector layers!). Such data volume seems 
definitely too high for vector rendering but still, I guess it's 
possible to enhance performance with a clever configuration.

I can see 3 ways to reduce the load on browser (please feel free to 
correct if I'm wrong):
1) reduce the file size
2) use a format that is efficiently parsed
3) reduce the data extent

I attempted to switch my layers format to GeoJSON instead of GML. I 
expected smaller file size and faster interpretation (given that JSON is 
native Javascript). Unfortunately, I can't see any real performance 
improvement. The file size is half as much but my browser still hang for 
a while (transfer time not taken into account). I confess I haven't been 
into rigourous tests or preformance benchmark.

I haven't investigate much about reducing data extent. In both case the 
whole dataset (full layer extent) is fetched and parsed. Anyway, loading 
only the visible extent is not useful at small scale and I wonder if 
it's a good idea at large scale: file size would be dramatically reduced 
but merging existing data with new data might be too complex, moreover 
downloading and parsing data on each pan or zoom might break smooth 
navigation.

Regarding strict impact of vector data volume on browser capacities, is 
there a "best configuration"? Any difference between WFS and GeoRSS OL 
layers? Is there a recommanded way to use GeoJSON (other than 
Layers.Vector+Format.GeoJSON)?

Also, I know that MapBuilder used the Sarissa library to deleguate GML 
parsing to the browser XML engine. As far as I remember, the performance 
were not too bad. How could this be possible in OL, should I try to wrap 
the library in an alternate Format.XML?

Regards,
Gilles

-- 
Gilles Bassiere
MAKINA CORPUS
30 rue des Jeuneurs
FR-75002 PARIS
+33 (0) 1 44 82 00 80
http://www.makina-corpus.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gilles_bassiere.vcf
Type: text/x-vcard
Size: 368 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081006/c6a9d504/gilles_bassiere.vcf


More information about the Users mailing list