Jetson John
Jetson John

Reputation: 3829

Openlayer is very slow when using WKT Multipolygon with a large number of Points

I'm showing the boundaries of cyprus regions using openlayers with vector layer, I get the coords from a shapefile which has a lot of points, for instance some regions can have a multipolygon with in total :30000 Points.

This is really slow on firefox / IE and in firefox it shows unresponsive script error. Only chrome works well. What's the best way to get it working faster and smoothly ?

I read one answer is to create a WMS server with MapServer to generate the images tiles instead to use the OpenLayers directly but I can't implement that solution because I want to change layer style dynamically to the different features in the vector layer i.e to show different colors to the region based on the dynamic value.

How can I overcome this issue. Any Insights would be much appreciated.

Upvotes: 2

Views: 674

Answers (3)

kjelderg
kjelderg

Reputation: 392

Just to present a contrarian view, sending this as a vector layer but thinning the data points at distant zoom levels would provide the performance benefits you need with the interactivity you want.

Upvotes: 1

JSC
JSC

Reputation: 146

I think WMS + TileCache will helps to improve the speed. You mentioned you want to change layer style dynamically, I think there are also some solution to do that with WMS, please check:

https://gis.stackexchange.com/questions/64113/how-to-dynamically-change-sld-style-of-wms-layer-being-served-by-geoserver-from

and http://openlayers.org/dev/examples/sld.html

Upvotes: 2

Gery
Gery

Reputation: 9036

I'd say that GeoJSON may increase your performance in Firefox. WMS is the best in my opinion, and if you work with mapserver you wouldn't have problems to do what you want, geoserver may help you also, but for dynamic changes I'd say you'd need GeoExt.

Hope this helps,

Upvotes: 1

Related Questions