Hello,

I want to use DEM data from http://www.viewfinderpanoramas.org for northern 
scandinavia. The conversion from hgt files to tif files with srtmconvert.py 
works fine if I use the following projection settings:
+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs 

The downside is, that adding the resulting srtm.tif as DEM changes the 
appearance of the map in qlandkartegt. The map is compressed in the vertical 
(south-north) direction.
I assume a different projection setting in srtmconvert.py would fix that 
problem. To me geoprojections are a dark art. So could somebody give me a 
hint, what proj.4 settings would be appropriate?

All proj=merc or proj=tmerc settings I tried resulted in geotiff data which 
had no georeference. Only proj=longlat produced a result with geo coordinates.

Thanks for help
Joachim

#! /usr/bin/python

import os
from string import join

geotifs = []

for root, dirs, files in os.walk("./", topdown=False):
    for name in files:

        if os.path.splitext(name)[1] != ".hgt": continue

        filename = os.path.join(root, name)

        proj="+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs"
        cmd = "gdalwarp -t_srs \"" + proj + " \" -r cubic %s %s.tif" % (filename, name[:-4])        
        #print cmd
        os.system(cmd)

        geotifs.append(name[:-4] + ".tif")

cmd = "gdalwarp -r cubic " + join(geotifs) + " tmp.tif"
os.system(cmd)

cmd = "gdal_translate -co tiled=yes -co blockxsize=256 -co blockysize=256 -co compress=deflate -co predictor=1 tmp.tif srtm.tif"
os.system(cmd)
 
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users

Reply via email to