Browse Source

r.external.out/r.out.gdal: add CRS EPSG code if available

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72159 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 năm trước cách đây
mục cha
commit
b18aae7d98
2 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 4 2
      lib/raster/gdal.c
  2. 2 1
      raster/r.out.gdal/main.c

+ 4 - 2
lib/raster/gdal.c

@@ -358,7 +358,7 @@ static struct state
 {
     int initialized;
     struct GDAL_Options opts;
-    struct Key_Value *projinfo, *projunits;
+    struct Key_Value *projinfo, *projunits, *projepsg;
     char *srswkt;
 } state;
 
@@ -432,8 +432,10 @@ struct GDAL_link *Rast_create_gdal_link(const char *name,
 	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);
     }
 

+ 2 - 1
raster/r.out.gdal/main.c

@@ -284,7 +284,8 @@ int main(int argc, char *argv[])
     /* 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);