I’m facing this issue: I have a chloropleth map based on a set of polygons with some data. Using WFS-T (postgis, geoserver, openlayers) I am able to edit the geometry of the polygons. This works fine.

My polygons look like state borders. They have shared border vertices. When I edit the geometry of some polygon (e.g., move vertices using modifyFeature), I need to affect the geometry of any neighboring polygon. There shouldn’t be holes or overlaps.

Is it possible to do it?


  • Probably ;) I don't believe OpenLayers supports anything like this out of the box, but it would be implementable. You could represent each border with a linestring, and modify the linestrings. Then, when the linestring gets updated, you update the two (or more) polygons which touch at the border, removing the old border and inserting the new one. – canisrufus Aug 5 '11 at 13:27

I know that this question is 3 years old, but I think it will help future people reading this subject.

You can find an OpenLayers implementation of topology here: http://dev.openlayers.org/sandbox/bjornharrtell/eventbasedtopology2/examples/topology.html


Only clues, don't think OpenLayers is able to do it. Most open source Desktop GIS are not able to do snapping on a line of differents vertex so doing this online seems for me a dream.

For simple geometry, the snapping can be enough http://openlayers.org/dev/examples/snapping.html Not enough mature, I hope https://github.com/bjornharrtell/jsts will be a way to do intersection (and indirecly solve your problem) on client side before sending back content. For the moment, I will think more about processing after drawing using PostGIS triggers for this and send back corrected draws. Topology implementation in PostGIS may help http://www.postgresql-sessions.org/2/sandro_santilli_-_topology_with_postgis_2.0 Always on server side, see possibilities of WPS maybe http://community.esdi-humboldt.eu/documents/show/4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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