[GRASS-SVN] r70385 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 17 08:16:52 PST 2017


Author: martinl
Date: 2017-01-17 08:16:52 -0800 (Tue, 17 Jan 2017)
New Revision: 70385

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


Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2017-01-17 15:05:44 UTC (rev 70384)
+++ grass/trunk/lib/vector/Vlib/open.c	2017-01-17 16:16:52 UTC (rev 70385)
@@ -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