[GRASS-dev] [GRASS GIS] #3193: r.out.gdal: add AUTHORITY node to the srs info of the exported raster

GRASS GIS trac at osgeo.org
Mon Oct 24 10:55:19 PDT 2016


#3193: r.out.gdal: add AUTHORITY node to the srs info of the exported raster
-------------------------+-------------------------
 Reporter:  hellik       |      Owner:  grass-dev@…
     Type:  enhancement  |     Status:  new
 Priority:  major        |  Milestone:  7.2.0
Component:  Raster       |    Version:  svn-trunk
 Keywords:               |        CPU:  All
 Platform:  All          |
-------------------------+-------------------------
 test case in a location created by an EPSG code

 {{{
 g.proj -p
 -PROJ_INFO-------------------------------------------------
 name       : MGI / Austria GK Central
 datum      : hermannskogel
 ellps      : bessel
 proj       : tmerc
 lat_0      : 0
 lon_0      : 13.33333333333333
 k          : 1
 x_0        : 0
 y_0        : -5000000
 no_defs    : defined
 towgs84    : 577.326,90.129,463.919,5.1366,1.4742,5.2970,2.4232
 -PROJ_EPSG-------------------------------------------------
 epsg       : 31255
 -PROJ_UNITS------------------------------------------------
 unit       : meter
 units      : meters
 meters     : 1
 }}}

 export a raster by r.out.gdal and do gdalinfo

 {{{
 gdalinfo raster_export_by_grass.tif
 Driver: GTiff/GeoTIFF
 Files: raster_export_by_grass.tif
 Size is 7201, 7001
 Coordinate System is:
 PROJCS["MGI / Austria GK Central",
     GEOGCS["bessel",
         DATUM["Militar_Geographische_Institute",
             SPHEROID["Bessel_1841",6377397.155,299.1528128],
             TOWGS84[577.326,90.129,463.919,5.1366,1.4742,5.297,2.4232]],
         PRIMEM["Greenwich",0],
         UNIT["degree",0.0174532925199433]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",0],
     PARAMETER["central_meridian",13.33333333333333],
     PARAMETER["scale_factor",1],
     PARAMETER["false_easting",0],
     PARAMETER["false_northing",-5000000],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]]]
 Origin = (-96005.000000000000000,230005.000000000000000)
 Pixel Size = (10.000000000000000,-10.000000000000000)
 Metadata:
   AREA_OR_POINT=Area
   TIFFTAG_SOFTWARE=GRASS GIS 7.3.svn with GDAL 2.1.1
 Image Structure Metadata:
   INTERLEAVE=BAND
 Corner Coordinates:
 Upper Left  (  -96005.000,  230005.000) ( 12d 3'57.90"E, 47d12' 8.96"N)
 Lower Left  (  -96005.000,  159995.000) ( 12d 4'50.98"E, 46d34'22.11"N)
 Upper Right (  -23995.000,  230005.000) ( 13d 0'59.64"E, 47d12'32.62"N)
 Lower Right (  -23995.000,  159995.000) ( 13d 1'12.91"E, 46d34'45.25"N)
 Center      (  -60000.000,  195000.000) ( 12d32'45.35"E, 46d53'30.77"N)

 }}}

 do gdal_translate and assign the srs

 {{{
 gdal_translate -a_srs EPSG:31255 raster_export_by_grass.tif
 geotif_by_gdaltranslate.tif
 }}}

 check by gdalinfo

 {{{
 gdalinfo geotif_by_gdaltranslate.tif
 Driver: GTiff/GeoTIFF
 Files: geotif_by_gdaltranslate.tif
        geotif_by_gdaltranslate.tif.aux.xml
 Size is 7201, 7001
 Coordinate System is:
 PROJCS["MGI / Austria GK Central",
     GEOGCS["MGI",
         DATUM["Militar_Geographische_Institute",
             SPHEROID["Bessel 1841",6377397.155,299.1528128,
                 AUTHORITY["EPSG","7004"]],
             TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],
             AUTHORITY["EPSG","6312"]],
         PRIMEM["Greenwich",0,
             AUTHORITY["EPSG","8901"]],
         UNIT["degree",0.0174532925199433,
             AUTHORITY["EPSG","9122"]],
         AUTHORITY["EPSG","4312"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",0],
     PARAMETER["central_meridian",13.33333333333333],
     PARAMETER["scale_factor",1],
     PARAMETER["false_easting",0],
     PARAMETER["false_northing",-5000000],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]],
     AUTHORITY["EPSG","31255"]] <<==
 Origin = (-96005.000000000000000,230005.000000000000000)
 Pixel Size = (10.000000000000000,-10.000000000000000)
 Metadata:
   AREA_OR_POINT=Area
   TIFFTAG_SOFTWARE=GRASS GIS 7.3.svn with GDAL 2.1.1
 Image Structure Metadata:
   INTERLEAVE=BAND
 Corner Coordinates:
 Upper Left  (  -96005.000,  230005.000) ( 12d 3'57.90"E, 47d12' 8.96"N)
 Lower Left  (  -96005.000,  159995.000) ( 12d 4'50.98"E, 46d34'22.11"N)
 Upper Right (  -23995.000,  230005.000) ( 13d 0'59.64"E, 47d12'32.62"N)
 Lower Right (  -23995.000,  159995.000) ( 13d 1'12.91"E, 46d34'45.25"N)
 Center      (  -60000.000,  195000.000) ( 12d32'45.35"E, 46d53'30.77"N)
 }}}

 GDAL adds the ''AUTHORITY node'' of the corresponding EPSG code.

 this may be help #3191 (and maybe also other GIS software reading GRASS
 exported data).

 also mentioned in a [https://lists.osgeo.org/pipermail/gdal-
 dev/2016-October/045359.html GDAL ML thread]:

 {{{
 From what I can see the driver doesn't handle adding a new entry in the
 spatial_ref_sys table if there's no AUTHORITY node, such as in your use
 case.
 [...]
 Make sure a EPSG code is attached to
 the input dataset, or assign it explictly
 }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3193>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list