Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a project where we have a large number of very detailed polygons being displayed on a image using Openlayers. The polygons are added to the map through a GML feed.

We are having end user performance issues on some of our more complicated polygon feeds. The issues are two fold:

1) The browser will freeze up when loading the polygons from GML initially. After the loading it seems to perform pretty well is there some way to stream the data in slower as to not freeze the browser when the polygons are initially being added to the map?

2) The data payload to the user is too large. We would like to simplify the actual amount of polygon data that is sent to the user. We have our source polygon data in a mysql database, is there an algorithm we could use that would simplify our source polygon data to reduce the number of vertexes?

Some of this may be very basic, sorry I'm pretty new to this stuff.

share|improve this question

Vector data has very high bandwidth requirements. You should adapt the complexity of the polygons to show only actually visible features, and maybe use a protocol with a smaller footprint (GeoJSON/gzipped?).

The simplification algorithm is called Ramer-Douglas-Peucker, and implemented in many databases and libraries. In PostGIS it would be the ST_Simplify method, but there are mapserver scripts as well.

If you are not bound to OpenLayers, I would recommend you to look into TileStache for server and Polymaps for a client. They allow you to pre-render GeoJSON tiles according to the location/zoom level you are currently looking at.

share|improve this answer
The actual data payload is like 2-3 MB which is very similar to what our competitors pages are so I'm not super concerned with actually delivering the payload. Polymaps looks really cool, but i think lacks some features we need as the the maps are pre-rendered (we need hover effects on the polygons) This is an excellent answer and I thank you for it very much but I guess I was looking for info on how to optimize openlayers . I know that you can override openlayers functionality and I was hoping that I might be able to override a specific function to prevent the browser from locking up. – openist Mar 26 '12 at 16:53
Thanks for the names of those algorithms too, we're going to look into simplifying our data! – openist Mar 26 '12 at 16:59
I'm not too certain about openlayers, but in polymaps you can obtain hover effects with css styling. If your polygons have any kind of unique ID, you can achieve hover effects across tile borders with a few lines of javascript. – relet Mar 28 '12 at 10:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.