Splitting features

There are two ways to split a polygon - with SQL/MM standard function and a non-standard, PostGIS specific function.

Using the standard way, we'll have to add two nodes to existing edges and split them.

This is done with the topology.ST_ModEdgeSplit function. It accepts three arguments: the topology name, the edge ID, and the point geometry, and returns the integer ID of the newly created node. A new node is added to the topology, and the edge with a given ID is split into two parts. One retains the original ID, and the second is given a new ID.

There is also a ST_NewEdgeSplit function, which deletes the original edge and creates two brand new edges instead. Use it if you are into immutable data structures.

We'll split  ...

Get Mastering PostGIS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.