Code Monkey home page Code Monkey logo

geofabric_tools's Introduction

Geofabric Tools

Tools for working with the Australian Hydrological Geospatial Fabric (geofabric). Data from the Bureau of Meterology: http://www.bom.gov.au/water/geofabric/index.shtml

Download and unzip: ftp://ftp.bom.gov.au/anon/home/geofabric/SH_Network_GDB_V3_2.zip or the previous release: ftp://ftp.bom.gov.au/anon/home/geofabric/version2/SH_Network_GDB_V2_1_1.zip

Convert SH_Catchments.gdb into a spatialite database:

$ time ogr2ogr -f SQLite -dsco SPATIALITE=YES geofabric.sqlite SH_Network_GDB/SH_Network.gdb

real    9m51.489s
user    7m38.091s
sys     0m7.016s

Add some indexes to the spatialite database:

$ sqlite3 geofabric.sqlite "CREATE INDEX idx_ahgfnetworkconnectivitydown_to_id ON ahgfnetworkconnectivitydown (to_id);"
$ sqlite3 geofabric.sqlite "CREATE INDEX idx_ahgfcatchment_hydroid ON ahgfcatchment (hydroid);"
$ sqlite3 geofabric.sqlite "CREATE INDEX idx_ahgfcatchment_netnodeid ON ahgfcatchment (netnodeid);"

Extract catchment boundary upstream from sub-catchment containing a latitude and longitude:

$ time python geofabric_tools/catchment_tools.py 148.821,-35.592
INFO:__main__:Extracting: 148.821,-35.592
INFO:__main__:Saving as: 1170184.json

real    0m4.067s
user    0m2.904s
sys     0m1.126s

Optionally include an ID to use when saving the output file:

$ time python geofabric_tools/catchment_tools.py 148.821,-35.592:410730
INFO:__main__:Extracting: 148.821,-35.592
INFO:__main__:Saving as: 410730.json

real    0m5.810s
user    0m4.645s
sys     0m0.885s

By defaults all sinks inside the extracted boundary are assumed to be part of the catchment. A catchment boundary can be extracted with the sinks excluded from the resulting polygon by passing the --exclude-sinks option. For example:

$ time python geofabric_tools/catchment_tools.py --exclude-sinks 148.821,-35.592:excluded_sinks
INFO:__main__:Extracting: 148.821,-35.592:excluded_sinks
INFO:__main__:Saving as: excluded_sinks.json

real    0m6.915s
user    0m5.936s
sys     0m0.963s

geofabric_tools's People

Contributors

amacd31 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.