presentation 2016 sql_water-source_sql

7
Find water source from River http://www.ibama.gov.br Luiz Motta February, 2016 Brazilian Institute of Environment and Renewable Natural Resources COTIG – Coordination of Geotechnology SQL for water source(point ) from rivers(line) Data: Rio Doce Watershed from ANA site http://hidroweb.ana.gov.br/HidroWeb.asp?TocItem=4100 Processing with PostgreSQL/PostGIS and GDAL/OGR

Upload: luiz-motta

Post on 20-Feb-2017

314 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Presentation 2016 sql_water-source_sql

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

Page 2: Presentation 2016 sql_water-source_sql

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

Page 3: Presentation 2016 sql_water-source_sql

Find water source from River

Get the nodes of all arcs (Start and End Points)

Page 4: Presentation 2016 sql_water-source_sql

Find water source from River

Nodes connect with ONLY one Arc

Page 5: Presentation 2016 sql_water-source_sql

Find water source from River

Spatialite syntax

Page 6: Presentation 2016 sql_water-source_sql

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

Page 7: Presentation 2016 sql_water-source_sql

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