0

I have downloaded a 30-by-30 tile from

http://srtm.csi.cgiar.org/srtmdata/

Then gdalinfo on the obtained single *.tif-file would yield

Driver: GTiff/GeoTIFF
Files: cut_n30e000.tif
       cut_n30e000.tif.aux.xml
Size is 36024, 36023
Coordinate System is `'
Origin = (-0.010416618510297,60.009584059976817)
Pixel Size = (0.000833333353512,-0.000833333353512)
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  -0.0104166,  60.0095841) 
Lower Left  (  -0.0104166,  29.9904167) 
Upper Right (  30.0095841,  60.0095841) 
Lower Right (  30.0095841,  29.9904167) 
Center      (  14.9995837,  45.0000004) 
Band 1 Block=36024x1 Type=Int16, ColorInterp=Gray
  Min=-444.000 Max=4783.000 
  Minimum=-444.000, Maximum=4783.000, Mean=348.628, StdDev=398.861
  NoData Value=-32768
  Metadata:
    STATISTICS_MAXIMUM=4783
    STATISTICS_MEAN=348.62818252965
    STATISTICS_MINIMUM=-444
    STATISTICS_STDDEV=398.86067773429

So far so good. So I would try to project this onto a 2D plane, as follows: gdalwarp -t_srs '+proj=tmerc +lat_0=44.00 +lon_0=15.00 +units=m +no_defs' cut_n30e000.tif result_europe.tmerc.tif. After this operation, result_europe.tmerc.tif is supposed to be represented with respect to a Cartesian system of coordinates. But I was surprised to find out that the lat/lon system persists:

Driver: GTiff/GeoTIFF
Files: result_europe.tmerc.tif
Size is 36024, 36023
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["WGS 84",
        DATUM["unknown",
            SPHEROID["WGS84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",44],
    PARAMETER["central_meridian",15],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-0.010416618510297,60.009584059976817)
Pixel Size = (0.000833333353512,-0.000833333353512)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  -0.0104166,  60.0095841) ( 15d 0' 0.00"E, 44d 0' 1.94"N)
Lower Left  (  -0.0104166,  29.9904167) ( 15d 0' 0.00"E, 44d 0' 0.97"N)
Upper Right (  30.0095841,  60.0095841) ( 15d 0' 1.35"E, 44d 0' 1.94"N)
Lower Right (  30.0095841,  29.9904167) ( 15d 0' 1.35"E, 44d 0' 0.97"N)
Center      (  14.9995837,  45.0000004) ( 15d 0' 0.67"E, 44d 0' 1.46"N)
Band 1 Block=36024x1 Type=Int16, ColorInterp=Gray
  NoData Value=-32768

Why the original lat/lon bounds are still there? I.e. what was wrong with my gdalwarp command above?

  • 1
    What are you specifying as -s_srs? It's not defined in your from info. – Michael Stimson Apr 4 at 4:47
  • 1
    yes that's cruddy, the files don't have the CRS inside - add -s_srs "+init=epsg:4326" to your gdalwarp call – mdsumner Apr 4 at 5:57
0

Just re-stating the answers provided by @MichaelStimson and @mdsummer: gdalwarp -s_srs '+init=epsg:4326' -t_srs '+proj=tmerc +lat_0=44.00 +lon_0=15.00 +units=m' cut_n30e000.tif result_europe.tmerc.tif will do the job. After this, gdalinfo gives the proper:

Driver: GTiff/GeoTIFF
Files: result_europe.tmerc.tif
Size is 36696, 43220
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["WGS 84",
        DATUM["unknown",
            SPHEROID["WGS84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",44],
    PARAMETER["central_meridian",15],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-1456758.150925980880857,1876581.142161503667012)
Pixel Size = (79.393568841911133,-79.393568841911133)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-1456758.151, 1876581.142) ( 10d15'41.62"W, 58d20'50.81"N)
Lower Left  (-1456758.151,-1554808.903) (  0d 7' 0.41"E, 29d 8'47.69"N)
Upper Right ( 1456668.251, 1876581.142) ( 40d15'36.63"E, 58d20'51.87"N)
Lower Right ( 1456668.251,-1554808.903) ( 29d52'56.37"E, 29d 8'48.06"N)
Center      (     -44.950,  160886.119) ( 14d59'57.93"E, 45d26'51.99"N)
Band 1 Block=36696x1 Type=Int16, ColorInterp=Gray
  NoData Value=-32768

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.