| 299 | | Since we are non-commercial, we can use the SRTM4.1 data from [http://srtm.csi.cgiar.org CGIAR] |
| 300 | | |
| | 299 | SRTM3 data: |
| | 300 | {{{ |
| | 301 | mkdir ~/mapnik/srtm |
| | 302 | wget http://mapnik-utils.googlecode.com/svn@170/sandbox/testing/hillshading/srtm_generate_hdr.sh |
| | 303 | chmod +x srtm_generate_hdr.sh |
| | 304 | cp srtm_generate_hdr.sh /usr/local/bin |
| | 305 | vim process_srtm3.sh |
| | 306 | #!/bin/bash |
| | 307 | PREP_TABLE="1" |
| | 308 | for X in *.hgt.zip; do |
| | 309 | yes | srtm_generate_hdr.sh $X |
| | 310 | rm -f "${X%%.zip}" |
| | 311 | |
| | 312 | # Import 10m contours |
| | 313 | rm -f "${X%%.hgt.zip}.shp" "${X%%.hgt.zip}.shx" "${X%%.hgt.zip}.dbf" |
| | 314 | gdal_contour -i 10 -snodata 32767 -a height "${X%%.hgt.zip}.tif" "${X%%.hgt.zip}.shp" |
| | 315 | [ "$PREP_TABLE" ] && shp2pgsql -p -I -g way "${X%%.hgt.zip}" contours | psql -q gis |
| | 316 | shp2pgsql -a -g way "${X%%.hgt.zip}" contours | psql -q gis |
| | 317 | |
| | 318 | rm -f "${X%%.hgt.zip}.shp" "${X%%.hgt.zip}.shx" "${X%%.hgt.zip}.dbf" |
| | 319 | rm -f "${X%%.hgt.zip}.bil" |
| | 320 | rm -f "${X%%.hgt.zip}.hdr" |
| | 321 | rm -f "${X%%.hgt.zip}.prj" |
| | 322 | rm -f "${X%%.hgt.zip}.tif" |
| | 323 | unset PREP_TABLE |
| | 324 | done |
| | 325 | }}} |
| | 326 | |
| | 327 | Since we are non-commercial, we should be able to use the SRTM4.1 data from [http://srtm.csi.cgiar.org CGIAR], however the Shapefile production crashed when it reached 2Gb.[[BR]] |