Coop,
When you load data to the client you run into these problems. I assume you need to load these into the client to give better responsiveness at the client for things like mouseover? Anyway, I know its application dependent but I prefer to leave everything on the server and when you need access to the geometry/attributes in realtime you undertake a WFS GetFeature request. You should also transfer the data in compressed form - eg binary XML - to keep the download time to a minimum. This is a trade off in responsiveness but you retain all the geometry that's in your database all the time and your WFS request can include a different SRS so all transformations are done at the server level for the requested area - Area Of Interest - only. You can also use WMS GetFeatureInfo to get the attributes only for any picked polygon. You can also use SLDs to render thematic maps on the server which takes away a lot of client code if you are doing that as well at the client with these polygons. Maybe not what you wanted to hear but there is no free lunch in this regard. Cheers, Brad Spencer Managing Director, NuMaps http://www.numaps.com.au/ tel: 02 9672 6856 mob: 0404 841 131 From: [email protected] [mailto:[email protected]] On Behalf Of Coup Coup Sent: Tuesday, 26 April 2011 5:22 AM To: [email protected] Subject: [OpenLayers-Users] OpenLayers Optimizing page load time (reducing size of polygons) and preventing IDL polyong splits. Hello, I have built a (using django postgis and openlayers) display about 200 specific polygon shapes consisting of clusters of counties in the US (including Alaska, Puerto Rico and Hawaii). I am displaying using Google as base map and then applying the polygons to features which I attach to one of 10 layers. I am transforming the data to projection 900913 and displaying the features as vectors. I have two issues I am looking for feedback or suggestions on: 1. Map load optimization: The data is almost 1MB. I have applied the simplify utility and whittled down the number of points in each polygon (which was as high as 8,000) down to an average of 150 per shape. (Some polygons cant be simplfied or they will lose their entire shape). I tried to unionagg() the entire list of polygons into 1 but I lose so much definition and will also lose the ability to enhance the map by allowing individual selection and labelling. Is there a way to get the data set even smaller without losing shape quality? 2. One of the polygons is in Alaska, and encompasses the islands in the Aleutians West. Upon completion of the building the map, I'm calling map.zoomToExtent(bounds); (where bounds is the collective bounds of all of the polygons) and because Aleutians West is so close in proximity to the IDL (international date line) it is placing part of the polygon on either side of the map so it is zooming way out (so you can see the whole world map) and splitting repeating the polygon on the respective portion of the map. Is there a way to move the IDL so it wont try to split it in this way? Thanks for any knowledge you can share. Coop
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
