[OpenLayers-Users] vector layers optimization?

Eric Lemoine eric.c2c at gmail.com
Wed Oct 8 16:55:49 EDT 2008

Hi Gilles.

If i'm not mistaken XML parsing in OL also relies on the browser XML engine.

With 2.7 we have Strategy.BBOX that allows reading only features
within the current extent, but as you said that doesn't help for small

What did you want to render your features as vectors in the first
place? I found out that rendering them in raster and highlighting them
in vector often makes sense.

If you really need vectors at all scales, server-based paging might
also be something to consider. We're currently looking at it in



2008/10/6, Gilles Bassière <gilles.bassiere at makina-corpus.com>:
> 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
> 30 rue des Jeuneurs
> FR-75002 PARIS
> +33 (0) 1 44 82 00 80
> http://www.makina-corpus.com

More information about the Users mailing list