[GRASS-SVN] r70244 - grass/trunk/vector/v.external

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 4 06:18:12 PST 2017


Author: martinl
Date: 2017-01-04 06:18:12 -0800 (Wed, 04 Jan 2017)
New Revision: 70244

Modified:
   grass/trunk/vector/v.external/main.c
Log:
v.external: fix check_projection() when input is PG datasource (and native GRASS PostGIS reader is used)

Modified: grass/trunk/vector/v.external/main.c
===================================================================
--- grass/trunk/vector/v.external/main.c	2017-01-04 13:10:23 UTC (rev 70243)
+++ grass/trunk/vector/v.external/main.c	2017-01-04 14:18:12 UTC (rev 70244)
@@ -85,8 +85,9 @@
     }
     
 #ifdef HAVE_OGR
-    if (use_ogr)
-        OGRRegisterAll();
+    /* GDAL drivers must be registered since check_projection()
+     * depends on it (even use_ogr is false)*/
+    OGRRegisterAll();
 #endif
 
     if (flags.format->answer) {
@@ -135,7 +136,9 @@
 
     /* check projection match */
     if (!flags.override->answer) {
-        check_projection(dsn, ilayer);
+        /* here must be used original dsn since check_projection() is
+         * using GDAL library */
+        check_projection(options.dsn->answer, ilayer);
     }
     
     /* create new vector map */



More information about the grass-commit mailing list