presentation 2016 sql_water-source_sql
TRANSCRIPT
Find water source from River
http://www.ibama.gov.br
Luiz MottaFebruary, 2016
Brazilian Institute of Environment and Renewable Natural ResourcesCOTIG – Coordination of Geotechnology
● SQL for water source(point ) from rivers(line)
● Data: Rio Doce Watershed from ANA sitehttp://hidroweb.ana.gov.br/HidroWeb.asp?TocItem=4100
● Processing with PostgreSQL/PostGIS and GDAL/OGR
Find water source from River
Methodology for find the Water source point:
● Get the nodes of all arcs (Start and End Points)* The orientation of arc not have water direction, need get both nodes of Arcs
● Nodes connect with ONLY one Arc* Applied a little buffer for points, can be a missed connection between lines
Find water source from River
Get the nodes of all arcs (Start and End Points)
Find water source from River
Nodes connect with ONLY one Arc
Find water source from River
Spatialite syntax
Find water source from River
GDAL/OGR
1)Shapefile of example:http://hidroweb.ana.gov.br/baixar/mapa/Bacia8.zip
2)Create file without space and only field COTRECHO:ogr2ogr -overwrite -select COTRECHO hidrocotrecho.shp "Hidrografia 1000000.shp"
3)Creating water source:ogr2ogr -overwrite -dialect SQLITE -sql "SELECT ..." water_src.shp hidrocotrecho.shp
Find water source from River
Sources codes● water_src_postgis.sql:
https://www.dropbox.com/s/j8wxqpjr5nt45mv/water_src_postgis.sql
● water_src_sqlite.sqlhttps://www.dropbox.com/s/s3you7i18257lii/water_src_sqlite.sql
● water_src_from_river.sh (Shell/Linux for ogr2ogr):https://www.dropbox.com/s/w2hc0xbkc29apy4/water_src_from_river.sh