Giter VIP home page Giter VIP logo

srtm2postgis's Introduction

Script that imports the SRTM data in a PostGIS (PostgreSQL) database.  

http://wiki.openstreetmap.org/index.php/Route_altitude_profiles_SRTM#SRTM_import

Usage:
First run the tests that come with this script:

python test/test_download.py

Then download the SRTM source files (635 MB for Australia):

$ python download.py continent

(replace continent by Africa, Australia, Eurasia, Islands, 
North_America or South_America.

Second argument (optional) specifies from which tile to resume. 
Use full file name e.g. 'N36W004.hgt.zip'. Set to 0 start at the first file. 
Argument 3-6 optionally specify a bounding box: north, south, west, east.

Verify that the download went correctly:

python test/verify_download.py continent

Unzip the files (adds 3 GB):
$ for f in `ls *.zip`; do unzip $f; done

Create a PostGIS database (you may need to change some things here depending on 
your system):

$ createdb srtm
$ createlang plpgsql srtm
$ psql -d srtm -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
$ psql -d srtm -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql

Create a test database:

$ createdb srtm_test
$ createlang plpgsql srtm_test
$ psql -d srtm_test -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
$ psql -d srtm_test -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql

Run script that reads files and puts them in the database.
Test it first:

$ python test/test_read_data.py
$ python read_data.py continent

Verify the result

$ python read_data.py continent verify 

All altitude data should now be in the table 'altitude'. Enjoy.

srtm2postgis's People

Contributors

sjors avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.