[Qgis-user] Calculate upslope catchment areas for multiple points?

Alister Hood alister.hood at gmail.com
Mon Jan 15 00:52:50 PST 2024


If the outlet points are correctly positioned on the stream network (i.e.
you don't need to "snap" them to the streams) and you're able to install
and run GRASS addons, you should be able to just use r.accumulate with the
outlet= option to specify the layer of outlet points, and the subwatershed=
option to tell it to calculate watersheds.
If you want to run it as a QGIS processing algorithm, you'll need to create
a description file.  This is mine, but you don't need most of it if you're
not wanting to use other features of r.accumulate.:

r.accumulate
Calculates weighted flow accumulation, subwatersheds, stream networks, and
longest flow paths using a flow direction map.
Raster (r.*)
QgsProcessingParameterRasterLayer|direction|Drainage direction input
raster|None|False
*QgsProcessingParameterEnum|format|Format of drainage direction input
raster|auto;degree;45degree|False|0|False
*QgsProcessingParameterNumber|threshold|Minimum flow accumulation for
streams|QgsProcessingParameterNumber.Integer|4000|True|4000|None
*QgsProcessingParameterRasterLayer|input_accumulation|Flow Accumulation
input raster|None|True
*QgsProcessingParameterRasterLayer|input_subaccumulation|Flow
subaccumulation input raster|None|True
*QgsProcessingParameterBoolean|-n|Use negative flow accumulation for likely
underestimates|False
*QgsProcessingParameterBoolean|-0|Use 0s instead of nulls for no flow
accumulation (faster)|False
*QgsProcessingParameterBoolean|-a|Calculate accumulated longest flow
paths|True
*QgsProcessingParameterBoolean|-c|Delineate streams across confluences|False
*QgsProcessingParameterBoolean|-r|Use recursive algorithms|False
QgsProcessingParameterPoint|coordinates|Coordinates of outlet
point|None|True
QgsProcessingParameterFeatureSource|outlet|Outlet points input vector
layer|0|None|True
QgsProcessingParameterRasterDestination|accumulation|Flow accumulation
output raster|None|True
QgsProcessingParameterRasterDestination|subaccumulation|Flow
subaccumulation output raster|None|True
QgsProcessingParameterRasterDestination|subwatershed|Watersheds output
raster|None|True
QgsProcessingParameterVectorDestination|stream|Streams output vector
layer|QgsProcessing.TypeVectorLine|None|True
QgsProcessingParameterVectorDestination|longest_flow_path|Longest flow path
output vector layer|QgsProcessing.TypeVectorLine|None|True

On Mon, 15 Jan 2024 at 09:01, <qgis-user-request at lists.osgeo.org> wrote:

> Send QGIS-User mailing list submissions to
>         qgis-user at lists.osgeo.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.osgeo.org/mailman/listinfo/qgis-user
> or, via email, send a message with subject or body 'help' to
>         qgis-user-request at lists.osgeo.org
>
> You can reach the person managing the list at
>         qgis-user-owner at lists.osgeo.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of QGIS-User digest..."
>
>
> Today's Topics:
>
>    1. Calculate upslope catchment areas for multiple points? (Ben Jones)
>    2. Re: Calculate upslope catchment areas for multiple points? (kirk)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 14 Jan 2024 17:15:58 +1100
> From: Ben Jones <bmjones at iprimus.com.au>
> To: Qgis <qgis-user at lists.osgeo.org>
> Subject: [Qgis-user] Calculate upslope catchment areas for multiple
>         points?
> Message-ID: <0734D400-0095-4DAB-8C53-853157B5552F at iprimus.com.au>
> Content-Type: text/plain;       charset=utf-8
>
> Hello All,
>
> I have used SAGA to generate channel networks and r.watershed to generate
> catchment sub-basins from Copernicus 30 m DEM data to assist with planning
> a stream sediment sampling program. Once samples are collected I would like
> to generate polygons that define the upslope area for each sample point.
>
> I understand that this can be done using SAGA Terrain Analysis ?Upslope
> area? tool that requires manually copying and pasting the X and Y
> coordinates for each sample point (one point at a time which works but is
> not practical for 100?s of samples, or in batches which is still not ideal
> and doesn?t appear to work?).
>
> Is there an easy way to import a point file with multiple points (100?s of
> points) to SAGA or another tool to automatically calculate upslope
> catchment areas for each of the points?
>
> I have come across two potential solutions:
>
> 1) ?Qgis SAGA Upslope Area for several points automation?:
>
> https://gis.stackexchange.com/questions/342333/qgis-saga-upslope-area-for-several-points-automation
> 2) ?Snap pour points and delineate multiple catchments in QGIS?:
> https://www.youtube.com/watch?v=Hqc_1CMadhA
>
> However, both are three years old and it appears there are complications
> using both these methods in newer versions of QGIS3. Are there alternative
> methods?
>
> I am using QGIS 3.28.11a on macOS Monterey.
>
> Thanks,
>
> Ben
>
> ------------------------------
>
> Message: 2
> Date: Sun, 14 Jan 2024 09:48:54 -0400
> From: kirk <kirk at nortekresources.com>
> To: Ben Jones <bmjones at iprimus.com.au>, Qgis
>         <qgis-user at lists.osgeo.org>
> Subject: Re: [Qgis-user] Calculate upslope catchment areas for
>         multiple points?
> Message-ID: <1705240136977.2864c2306c2b3915 at nortekresources.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Ben.The python script should work in your version since it is written
> in python 3.? It us,a relatively simple routine which iterates over each
> sample point and rund the saga tool.? It nay take a while to run 100s of
> points but it should finish.Saga is a third party, open source software
> suite that is developed independantly of QGIS.? It is very powerful and
> fast for most raster processing.? Saga also has native batch or scripting
> capability which may be an option for you.? Just a note that the module
> syntax can change? with versions. So and older script may not complete on a
> new release.Kirk SchmidtSent from my Galaxy
> -------- Original message --------From: Ben Jones via QGIS-User <
> qgis-user at lists.osgeo.org> Date: 2024-01-14  2:23?a.m.  (GMT-04:00) To:
> Qgis <qgis-user at lists.osgeo.org> Subject: [Qgis-user] Calculate upslope
> catchment areas for multiple points? Hello All,I have used SAGA to generate
> channel networks and r.watershed to generate catchment sub-basins from
> Copernicus 30 m DEM data to assist with planning a stream sediment sampling
> program. Once samples are collected I would like to generate polygons that
> define the upslope area for each sample point.I understand that this can be
> done using SAGA Terrain Analysis ?Upslope area? tool that requires manually
> copying and pasting the X and Y coordinates for each sample point (one
> point at a time which works but is not practical for 100?s of samples, or
> in batches which is still not ideal and doesn?t appear to work?).Is there
> an easy way to import a point file with multiple points (100?s of points)
> to SAGA or another tool to automatically calcu
>  late upslope catchment areas for each of the points?I have come across
> two potential solutions:1) ?Qgis SAGA Upslope Area for several points
> automation?:
> https://gis.stackexchange.com/questions/342333/qgis-saga-upslope-area-for-several-points-automation2)
> ?Snap pour points and delineate multiple catchments in QGIS?:
> https://www.youtube.com/watch?v=Hqc_1CMadhAHowever, both are three years
> old and it appears there are complications using both these methods in
> newer versions of QGIS3. Are there alternative methods?I am using QGIS
> 3.28.11a on macOS
> Monterey.Thanks,Ben_______________________________________________QGIS-User
> mailing listQGIS-User at lists.osgeo.orgList info:
> https://lists.osgeo.org/mailman/listinfo/qgis-userUnsubscribe:
> https://lists.osgeo.org/mailman/listinfo/qgis-user
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/qgis-user/attachments/20240114/7b593769/attachment-0001.htm
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
> ------------------------------
>
> End of QGIS-User Digest, Vol 215, Issue 20
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240115/67b2aa32/attachment.htm>


More information about the QGIS-User mailing list