* New Features *
+ - topology.clearTopoGeom (Sandro Santilli / Vizzuality)
- ST_Segmentize(geography) (Paul Ramsey / OpenGeo)
- ST_DelaunayTriangles (Sandro Santilli / Vizzuality)
- ST_NearestValue, ST_Neighborhood (Bborie Park / UC Davis)
topology_upgrade_$(PGIS_MAJ_MIN)_minor.sql: topology_drop_before.sql topology_upgrade.sql topology_drop_after.sql
cat $^ > $@
-topology.sql.in: sql/sqlmm.sql.in.c sql/populate.sql.in.c sql/polygonize.sql.in.c sql/gml.sql.in.c sql/query/getnodebypoint.sql.in.c sql/query/getedgebypoint.sql.in.c sql/query/getfacebypoint.sql.in.c sql/query/GetRingEdges.sql.in.c sql/query/GetNodeEdges.sql.in.c sql/manage/TopologySummary.sql.in.c sql/manage/CopyTopology.sql.in.c sql/manage/ManageHelper.sql.in.c sql/topoelement/topoelement_agg.sql.in.c sql/topogeometry/type.sql.in.c sql/topogeometry/totopogeom.sql.in.c sql/predicates.sql.in.c ../postgis/sqldefines.h ../postgis_svn_revision.h
+topology.sql.in: sql/sqlmm.sql.in.c sql/populate.sql.in.c sql/polygonize.sql.in.c sql/gml.sql.in.c sql/query/getnodebypoint.sql.in.c sql/query/getedgebypoint.sql.in.c sql/query/getfacebypoint.sql.in.c sql/query/GetRingEdges.sql.in.c sql/query/GetNodeEdges.sql.in.c sql/manage/TopologySummary.sql.in.c sql/manage/CopyTopology.sql.in.c sql/manage/ManageHelper.sql.in.c sql/topoelement/topoelement_agg.sql.in.c sql/topogeometry/type.sql.in.c sql/topogeometry/totopogeom.sql.in.c sql/topogeometry/cleartopogeom.sql.in.c sql/predicates.sql.in.c ../postgis/sqldefines.h ../postgis_svn_revision.h
uninstall_topology.sql: topology.sql ../utils/create_undef.pl
$(PERL) ../utils/create_undef.pl $< $(POSTGIS_PGSQL_VERSION) > $@
--- /dev/null
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+--
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.refractions.net
+--
+-- Copyright (C) 2012 Sandro Santilli <strk@keybit.net>
+--
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+-- {
+-- Clear the contents of a TopoGeometry
+--
+-- }{
+CREATE OR REPLACE FUNCTION topology.clearTopoGeom(tg topology.TopoGeometry)
+ RETURNS topology.TopoGeometry
+AS
+$$
+DECLARE
+ topology_info RECORD;
+ sql TEXT;
+BEGIN
+
+ -- Get topology information
+ SELECT id, name FROM topology.topology
+ INTO topology_info
+ WHERE id = topology_id(tg);
+ IF NOT FOUND THEN
+ RAISE EXCEPTION 'No topology with id "%" in topology.topology', topology_id(tg);
+ END IF;
+
+ -- Clear the TopoGeometry contents
+ sql := 'DELETE FROM ' || quote_ident(topology_info.name)
+ || '.relation WHERE layer_id = '
+ || layer_id(tg)
+ || ' AND topogeo_id = '
+ || id(tg);
+#ifdef POSTGIS_TOPOLOGY_DEBUG
+ RAISE DEBUG '%', sql;
+#endif
+ EXECUTE sql;
+
+
+ RETURN tg;
+
+END
+$$
+LANGUAGE 'plpgsql' VOLATILE STRICT;
+-- }
+
--- /dev/null
+\set VERBOSITY terse
+set client_min_messages to ERROR;
+
+\i load_topology.sql
+\i load_features.sql
+
+SELECT 'relation before', count(distinct topogeo_id)
+ FROM city_data.relation
+ WHERE layer_id = 1;
+
+SELECT 'feature before',
+ feature_name,
+ ST_IsEmpty(feature)
+ FROM features.land_parcels
+ WHERE feature_name = 'P1'
+ ORDER BY feature_name;
+
+SELECT 'feature during',
+ feature_name,
+ ST_IsEmpty(clearTopoGeom(feature))
+ FROM features.land_parcels
+ WHERE feature_name = 'P1'
+ ORDER BY feature_name;
+
+SELECT 'feature after',
+ feature_name,
+ ST_IsEmpty(feature)
+ FROM features.land_parcels
+ WHERE feature_name = 'P1'
+ ORDER BY feature_name;
+
+SELECT 'relation after', count(distinct topogeo_id)
+ FROM city_data.relation
+ WHERE layer_id = 1;
+
+select droptopology('city_data');
--- /dev/null
+BEGIN
+t
+9
+22
+26
+COMMIT
+BEGIN
+1
+2
+3
+COMMIT
+relation before|5
+feature before|P1|f
+feature during|P1|t
+feature after|P1|t
+relation after|4
+Topology 'city_data' dropped
-- TopoGeometry
#include "sql/topogeometry/type.sql.in.c"
+#include "sql/topogeometry/cleartopogeom.sql.in.c"
#include "sql/topogeometry/totopogeom.sql.in.c"
-- GML