Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huidaecho/grass-lfp-deprecated
GRASS GIS Shell Script for Creating the Longest Flow Path
https://github.com/huidaecho/grass-lfp-deprecated
gis grass-gis hydrology longest-flow-path
Last synced: 3 days ago
JSON representation
GRASS GIS Shell Script for Creating the Longest Flow Path
- Host: GitHub
- URL: https://github.com/huidaecho/grass-lfp-deprecated
- Owner: HuidaeCho
- License: gpl-2.0
- Created: 2017-08-20T09:23:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-27T03:54:27.000Z (over 4 years ago)
- Last Synced: 2024-01-28T19:42:06.849Z (10 months ago)
- Topics: gis, grass-gis, hydrology, longest-flow-path
- Language: Shell
- Size: 16.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# grass-lfp
GRASS GIS Shell Script for Creating the Longest Flow PathThis shell script is a GRASS GIS module that creates longest flow paths at multiple outlet points. The longest flow path modules in GRASS GIS ([r.lfp](https://grass.osgeo.org/grass72/manuals/addons/r.lfp.html) and [v.lfp](https://grass.osgeo.org/grass72/manuals/addons/v.lfp.html)) can handle only one longest flow path at a time.
I developed this module because the longest flow path tool in the ArcGIS ArcHydro toolbox was not able to process one of my study areas. It took forever to generate outputs in ArcGIS, so I needed a way to generate longest flow paths at multiple monitoring points (name for outlet points in ArcHydro) in GRASS GIS.
## WARNING
This shell script is deprecated by the new [r.lfp](https://grass.osgeo.org/grass74/manuals/addons/r.lfp.html) addon, which supports multiple outlets. Converting the longest flow path raster map to vector using r.to.vect, which this script does, can result in hydrologically invalid outputs. Please see [this article](https://idea.isnew.info/how-to-delineate-stream-networks-in-grass-gis.html).
## How to import the flow direction raster from ArcGIS
In ArcGIS, export the flow direction raster to fdr.tif.
```
# import fdr.tif into a new raster map
r.in.gdal input=fdr.tif output=fdr# convert ArcGIS flow directions to GRASS GIS flow directions
r.mapcalc expression="drain=int(8-log(fdr,2))"
```For more information about flow direction conversion, see [this article](https://idea.isnew.info/how-to-import-arcgis-flow-direction-into-grass-gis.html).
## How to import monitoring points from ArcGIS
In ArcGIS, export monitoroing points to mp.shp.
```
# import the monitoring points shapefile into a new vector map
v.in.ogr input=mp.shp output=mp# drop unnecessary columns
v.db.dropcolumn map=mp columns=OBJECTID_1,OBJECTID_2,AREA,PERIMETER,AL_SITES_G,AL_SITES_1,OBJECTID,STATION_NO,SNAME,DA_MI2,SGRF1_ID,REALTIME,NONET_REAL,FIRSTYEAR,YEARSREC,HCDN,HBM,DISTRICT,STATE,AGENCY,NASQAN2,BENCHMRK,NAWQALIP,ONREACH,MATCHID,COMPACT,BORDER,NWS_SITE,NRCS_SITE,HUC6_MVPSI,SENTINEL_S,FURNISHED,HUC6,USGS_SITE,WHO,PROPOSED,SITE_TYPE,QW_SITE,ACTIVE_K,SITE_STATU,SCORE,ID,POLYGONID,SCALE,ANGLE,HydroID,GageID,HydroCode,FType,Name,RiverID# rename the JunctionID column to id
v.db.renamecolumn map=mp column=JunctionID,id
```## How to create longest flow paths
```
# create a new vector map with longest flow paths for all outlet points
lfp.sh outlets=mp idattr=id drainage=drain output=lfp
```