CreateTopology — Creates a new topology schema and registers this new schema in the topology.topology table.

`integer `

varchar **CreateTopology**(`topology_schema_name``)`

;

`integer `

varchar **CreateTopology**(`topology_schema_name`, integer `srid``)`

;

`integer `

varchar **CreateTopology**(`topology_schema_name`, integer `srid`, double precision `tolerance``)`

;

`integer `

varchar **CreateTopology**(`topology_schema_name`, integer `srid`, double precision `tolerance`, boolean `hasz``)`

;

Creates a new schema with name `topology_name`

consisting of tables (`edge_data`

,`face`

,`node`

, `relation`

and registers this new topology in the topology.topology table. It returns the id of the topology in the topology table. The srid is the spatial reference identified as
defined in spatial_ref_sys table for that topology. Topologies must be uniquely named. The tolerance is measured in the units of the spatial reference system. If the tolerance is not specified defaults to 0.

This is similar to the SQL/MM ST_InitTopoGeo but a bit more functional. `hasz`

defaults to false if not specified.

Availability: 1.?

This example creates a new schema called ma_topo that will store edges, faces, and relations in Massachusetts State Plane meters. The tolerance represents 1/2 meter since the spatial reference system is a meter based spatial reference system

SELECT topology.CreateTopology('ma_topo',26986, 0.5);

Create Rhode Island topology in State Plane ft

SELECT topology.CreateTopology('ri_topo',3438) As topoid; topoid ------ 2