[GIS] How to split a feature and save back to database

openlayers-2postgis-1.5

How to split/cut a polygon through OpenLayers split method and same editing save to the PostGIS?

Best Answer

OpenLayer's Split control is straight forward. You pass it a layer in the contructor and the control will split it.

If your layer has ONE feature and you split it using the control you will end up with TWO features in the layer.

Once youre ready to save to PostGIS, you can write those features to a number of different formats WKT, KML, GML, etc. And pass that to your backend webservice wether it be a GeoServer WFS-T or a PHP, C# or other back-end handler/service that will save the features to your postGIS database.

Click here for an OpenLayers 2 Split Feature Example