Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

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

share|improve this question
are you going through geoserver or directly to postgis? – CaptDragon Mar 13 '12 at 16:07

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.


share|improve this answer

you can split or cut your polygon at server side by means of postgis function. in postgis ST_Split function makes what you want. this function is opposite of ST_Union...

following example has taken from postgis api doc. :

SELECT ST_Split(circle, line)
    ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)) As line,
    ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;

and another solution for this is that you can check JTS Topology Suite. it has lots of feature with Geometry Operations.

some example of operation:

contains, within
covers, coveredBy
intersects, disjoint
share|improve this answer

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.