]> granicus.if.org Git - postgis/commitdiff
Fix SRIDs in topology.topology after restore.
authorSandro Santilli <strk@keybit.net>
Mon, 19 Dec 2011 08:18:53 +0000 (08:18 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 19 Dec 2011 08:18:53 +0000 (08:18 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8467 b70326c6-7e19-0410-871a-916f4a2858ee

utils/postgis_restore.pl

index 75421a8b8a4a249e25771bb86c2a131f8ce75f6f..1b484288e61a23303be5504fd86f50e466c3f921 100755 (executable)
@@ -210,11 +210,18 @@ while( my $l = <INPUT> ) {
 
 }
 
-#
-# Re-enable topology metadata tables triggers 
-#
 if ( $hasTopology ) {
+
+  # Re-enable topology.layer table triggers 
   print STDOUT "ALTER TABLE topology.layer ENABLE TRIGGER ALL;";
+
+  # Update topology SRID from geometry_columns view.
+  # This is mainly to fix srids of -1
+  # May be worth providing a "populate_topology_topology"
+  print STDOUT "UPDATE topology.topology t set srid = g.srid "
+             . "FROM geometry_columns g WHERE t.name = g.f_table_schema "
+             . "AND g.f_table_name = 'face' and f_geometry_column = 'mbr';";
+
 }
 
 # Try re-enforcing spatial_ref_sys_srid_check, would fail if impossible