292 | | }}} |
293 | | |
294 | | If using SRTM3: |
295 | | {{{ |
296 | | mkdir ~/mapnik/srtm |
297 | | wget http://mapnik-utils.googlecode.com/svn@170/sandbox/testing/hillshading/srtm_generate_hdr.sh |
298 | | chmod +x srtm_generate_hdr.sh |
299 | | cp srtm_generate_hdr.sh /usr/local/bin |
300 | | |
301 | | vim process_srtm3.sh |
302 | | #!/bin/bash |
303 | | PREP_TABLE="1" |
304 | | for X in *.hgt.zip; do |
305 | | yes | srtm_generate_hdr.sh $X |
306 | | rm -f "${X%%.zip}" |
307 | | |
308 | | # Import 10m contours |
309 | | rm -f "${X%%.hgt.zip}.shp" "${X%%.hgt.zip}.shx" "${X%%.hgt.zip}.dbf" |
310 | | gdal_contour -i 10 -snodata 32767 -a height "${X%%.hgt.zip}.tif" "${X%%.hgt.zip}.shp" |
311 | | [ "$PREP_TABLE" ] && shp2pgsql -p -I -g way "${X%%.hgt.zip}" contours | psql -q gis |
312 | | shp2pgsql -a -g way "${X%%.hgt.zip}" contours | psql -q gis |
313 | | |
314 | | rm -f "${X%%.hgt.zip}.shp" "${X%%.hgt.zip}.shx" "${X%%.hgt.zip}.dbf" |
315 | | rm -f "${X%%.hgt.zip}.bil" |
316 | | rm -f "${X%%.hgt.zip}.hdr" |
317 | | rm -f "${X%%.hgt.zip}.prj" |
318 | | rm -f "${X%%.hgt.zip}.tif" |
319 | | unset PREP_TABLE |
320 | | done |