Adding new elements

First, we will add new features to the topology using two different methods. One approach is to use the standard ST_ functions. We will start with two isolated nodes. This is done with the topology.ST_AddIsoNode function. It takes three arguments: the topology name, the containing face ID (in our case, we will create nodes in empty space, so it will be NULL), and the point geometry:

SELECT topology.ST_AddIsoNode('my_topology',NULL,'SRID=4326;POINT(-1 1)');  st_addisonode ---------------           4568 SELECT topology.ST_AddIsoNode('my_topology',NULL,'SRID=4326;POINT(1 1)');  st_addisonode ---------------           4569 

Note the returned nodes' IDs, as they will be necessary later when adding edges:

Two isolated nodes added to a topology ...

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.