[GRASS-SVN] r58307 - grass/trunk/vector/v.info

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 25 11:54:18 PST 2013


Author: martinl
Date: 2013-11-25 11:54:18 -0800 (Mon, 25 Nov 2013)
New Revision: 58307

Modified:
   grass/trunk/vector/v.info/print.c
Log:
v.info: use Vect_get_finfo_topology_info()


Modified: grass/trunk/vector/v.info/print.c
===================================================================
--- grass/trunk/vector/v.info/print.c	2013-11-25 19:53:58 UTC (rev 58306)
+++ grass/trunk/vector/v.info/print.c	2013-11-25 19:54:18 UTC (rev 58307)
@@ -228,8 +228,10 @@
 
     }
     else if (map_type == GV_FORMAT_POSTGIS) {
+        int topo_format;
+        char *toposchema_name, *topogeom_column;
         const struct Format_info *finfo;
-        
+
         finfo = Vect_get_finfo(Map);
         
         fprintf(stdout, "format=%s,%s\n",
@@ -242,11 +244,12 @@
                 finfo->pg.geom_column);
         fprintf(stdout, "feature_type=%s\n",
                 Vect_get_finfo_geometry_type(Map));
-        if (finfo->pg.toposchema_name) {
+        topo_format = Vect_get_finfo_topology_info(Map, &toposchema_name, &topogeom_column, NULL);
+        if (topo_format == GV_TOPO_POSTGIS) {
             fprintf(stdout, "pg_topo_schema=%s\n",
-                    finfo->pg.toposchema_name);
+                    toposchema_name);
             fprintf(stdout, "pg_topo_column=%s\n",
-                    finfo->pg.topogeom_column);
+                    topogeom_column);
         }
     }
     else {
@@ -278,15 +281,13 @@
 {
     int i, map_type;
     char line[1024];
-    char tmp1[1024], tmp2[1024];
     char timebuff[256];
     struct TimeStamp ts;
     int time_ok, first_time_ok, second_time_ok;
     struct bound_box box;
-    int utm_zone;
-   
+    char tmp1[1024], tmp2[1024];
+    
     time_ok = first_time_ok = second_time_ok = FALSE;
-    utm_zone = -1;
     map_type = Vect_maptype(Map);
     
     /* Check the Timestamp */
@@ -363,6 +364,10 @@
         printline(line);
     }
     else if (map_type == GV_FORMAT_POSTGIS) {
+        int topo_format;
+        char *toposchema_name, *topogeom_column;
+        int topo_geo_only;
+
         const struct Format_info *finfo;
 
         finfo = Vect_get_finfo(Map);
@@ -378,6 +383,7 @@
         sprintf(line, "%-17s%s", _("DB name:"),
                 Vect_get_finfo_dsn_name(Map));
         printline(line);
+
         sprintf(line, "%-17s%s", _("Geometry column:"),
                 finfo->pg.geom_column);
         printline(line);
@@ -385,14 +391,20 @@
         sprintf(line, "%-17s%s", _("Feature type:"),
                 Vect_get_finfo_geometry_type(Map));
         printline(line);
-        if (finfo->pg.toposchema_name) {
+
+
+        
+        topo_format = Vect_get_finfo_topology_info(Map,
+                                                   &toposchema_name, &topogeom_column,
+                                                   &topo_geo_only);
+        if (topo_format == GV_TOPO_POSTGIS) {
             sprintf(line, "%-17s%s (%s %s%s)", _("Topology:"), "PostGIS",
-                    _("schema:"), finfo->pg.toposchema_name,
-                    finfo->pg.topo_geo_only ? ", topo-geo-only: yes" : "");
+                    _("schema:"), toposchema_name,
+                    topo_geo_only ? ", topo-geo-only: yes" : "");
             printline(line);
 
             sprintf(line, "%-17s%s", _("Topology column:"),
-                    finfo->pg.topogeom_column);
+                    topogeom_column);
         }
         else
             sprintf(line, "%-17s%s", _("Topology:"), "pseudo (simple features)");
@@ -467,6 +479,8 @@
     /* this differs from r.info in that proj info IS taken from the map here, not the location settings */
     /* Vect_get_proj_name() and _zone() are typically unset?! */
     if (G_projection() == PROJECTION_UTM) {
+        int utm_zone;
+
         utm_zone = Vect_get_zone(Map);
         if (utm_zone < 0 || utm_zone > 60)
             strcpy(tmp1, _("invalid"));



More information about the grass-commit mailing list