[GRASS-SVN] r70422 - grass/branches/releasebranch_7_2/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 24 06:49:52 PST 2017


Author: martinl
Date: 2017-01-24 06:49:52 -0800 (Tue, 24 Jan 2017)
New Revision: 70422

Modified:
   grass/branches/releasebranch_7_2/lib/vector/Vlib/open.c
Log:
 v.external.out: SRID lost when not exactly defined (see #3262)

Modified: grass/branches/releasebranch_7_2/lib/vector/Vlib/open.c
===================================================================
--- grass/branches/releasebranch_7_2/lib/vector/Vlib/open.c	2017-01-24 11:15:32 UTC (rev 70421)
+++ grass/branches/releasebranch_7_2/lib/vector/Vlib/open.c	2017-01-24 14:49:52 UTC (rev 70422)
@@ -1395,8 +1395,16 @@
             
             /* srid (default: 0) */
             p = G_find_key_value("srid", key_val);
-            if (p)
+            if (p) {
                 pg_info->srid = atoi(p);
+            }
+            else {
+                /* not defined by v.external.out, so try if EPSG code
+                 * is defined */
+                p = G_database_epsg_code();
+                if (p)
+                    pg_info->srid = atoi(p);
+            }
             G_debug(1, "PG: srid = %d", pg_info->srid);
             
             /* table name */



More information about the grass-commit mailing list