[GRASS-SVN] r72159 - in grass/trunk: lib/raster raster/r.out.gdal

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 26 03:20:54 PST 2018


Author: mmetz
Date: 2018-01-26 03:20:53 -0800 (Fri, 26 Jan 2018)
New Revision: 72159

Modified:
   grass/trunk/lib/raster/gdal.c
   grass/trunk/raster/r.out.gdal/main.c
Log:
r.external.out/r.out.gdal: add CRS EPSG code if available

Modified: grass/trunk/lib/raster/gdal.c
===================================================================
--- grass/trunk/lib/raster/gdal.c	2018-01-26 10:11:21 UTC (rev 72158)
+++ grass/trunk/lib/raster/gdal.c	2018-01-26 11:20:53 UTC (rev 72159)
@@ -358,7 +358,7 @@
 {
     int initialized;
     struct GDAL_Options opts;
-    struct Key_Value *projinfo, *projunits;
+    struct Key_Value *projinfo, *projunits, *projepsg;
     char *srswkt;
 } state;
 
@@ -432,8 +432,10 @@
 	read_gdal_options();
 	st->projinfo = G_get_projinfo();
 	st->projunits = G_get_projunits();
+	st->projepsg = G_get_projepsg();
 	if (st->projinfo && st->projunits)
-	    st->srswkt = GPJ_grass_to_wkt(st->projinfo, st->projunits, 0, 0);
+	    st->srswkt = GPJ_grass_to_wkt2(st->projinfo, st->projunits,
+	                                   st->projepsg, 0, 0);
 	G_initialize_done(&st->initialized);
     }
 

Modified: grass/trunk/raster/r.out.gdal/main.c
===================================================================
--- grass/trunk/raster/r.out.gdal/main.c	2018-01-26 10:11:21 UTC (rev 72158)
+++ grass/trunk/raster/r.out.gdal/main.c	2018-01-26 11:20:53 UTC (rev 72159)
@@ -284,7 +284,8 @@
     /* Read project and region data */
     struct Key_Value *projinfo = G_get_projinfo();
     struct Key_Value *projunits = G_get_projunits();
-    char *srswkt = GPJ_grass_to_wkt(projinfo, projunits, 0, 0);
+    struct Key_Value *projepsg = G_get_projepsg();
+    char *srswkt = GPJ_grass_to_wkt2(projinfo, projunits, projepsg, 0, 0);
 
     G_get_window(&cellhead);
 



More information about the grass-commit mailing list