Watershed Delineator

Watershed Delineator

Choose a DEM cell or WGS84 longitude/latitude outlet. Each valid cell flows toward the steepest of its eight lower neighbours, using approximate Earth-surface distances. Optionally fill local depressions from the raster edge with a deterministic priority flood and route equal-height flats toward an earlier flood parent. Trace upstream cells and the longest modelled route without sending the DEM to a server.

1. DEM GeoTIFF

Local file only. Up to 8 MiB, 120,000 cells, one numeric band, north-up EPSG:4326 or 3857.

2. Outlet and sink policy

Fill mode raises internal lows and routes flats to earlier flood parents. NoData remains a barrier; isolated valid components retain one internal sink.

Choose a DEM or open the example.

Spherical area and D8 routing are teaching approximations, not hydrologic or civil-engineering design results. geotiff.js and bundled dependency notices

Comments & questions

Watershed Delineator

Choose a DEM cell or WGS84 longitude/latitude outlet. Each valid cell flows toward the steepest of its eight lower neighbours, using approximate Earth-surface distances. Optionally fill local depressions from the raster edge with a deterministic priority flood and route equal-height flats toward an earlier flood parent. Trace upstream cells and the longest modelled route without sending the DEM to a server.

Key features

  • Read one numeric-band north-up GeoTIFF with explicit EPSG:4326 or EPSG:3857 and NoData
  • Compare original strict-descent sinks with priority-flood filled, deterministic flat routes
  • Trace the outlet's upstream cell mask and longest connected D8 main-stem path
  • Estimate basin surface area by spherical row-cell areas and report filled cells, sinks and NoData
  • Export a re-read GeoTIFF mask (0 outside, 1 basin, 255 source NoData), WGS84 GeoJSON row-run polygons, SVG and cell CSV
  • Reject invalid/multi-band/rotated DEMs, out-of-grid or NoData outlets and over-limit files

How to use

  1. Choose a local one-band DEM GeoTIFF, or load the 5×5 example, and inspect its CRS, bounds and NoData.
  2. Enter a zero-based outlet pixel or WGS84 longitude/latitude; the preview also lets you pick a pixel.
  3. Choose original strict descent or priority-flood depression filling.
  4. Run D8 delineation and inspect the basin mask, main route, area and sink diagnostics.
  5. Download GeoTIFF, GeoJSON, SVG or CSV, and verify assumptions before using another GIS workflow.

Use cases

  • Teach how a chosen outlet changes the upstream catchment on a small DEM
  • Compare raw closed pits with a filled surface and deterministic flat routing
  • Inspect NoData barriers and a raster-edge outlet before further GIS analysis

Frequently asked questions

Is this the same as a terrain viewshed?

No. A viewshed tests straight sight lines from an observer against terrain; this tool links each DEM cell to one downhill D8 neighbour and follows upstream cells to an outlet.

What happens to pits and flat cells?

Original mode only follows strictly lower neighbours, leaving closed pits and equal-height flats as sinks. Fill mode raises depressions to edge spill levels with a priority flood, then points unresolved equal-height cells to an earlier adjacent flood parent. It never treats NoData as a drain.

How is area calculated?

The tool sums spherical surface area of each included raster row cell using Earth mean radius 6,371,008.8 m. It is approximate, even for EPSG:3857, and not the projected square-metre area or a surveyed parcel measurement.

What does the exported mask contain?

A new one-band north-up GeoTIFF keeps the source grid, EPSG code and extent. Code 1 is upstream basin, 0 is valid terrain outside it and 255 is source NoData. Original elevations and non-spatial TIFF metadata are not copied.

Can I use this for drainage engineering decisions?

No. D8 single-flow routing, coarse input cells, edge/NoData assumptions, filled pits and spherical area omit rainfall, infiltration, culverts and surveyed terrain. Validate with qualified hydrology and GIS methods before design.

How large a DEM is supported?

The browser accepts up to 8 MiB, 120,000 cells and 1,024 cells on either side in a single north-up one-band GeoTIFF. Only explicit EPSG:4326/3857 are supported; rotated, arbitrary CRS and multi-image files are rejected.

Privacy

The selected DEM is decoded, modelled and exported in this browser tab. This tool does not upload DEM bytes or coordinates to its server API.

References

Related Tools

Raster Reprojection LabCoordinate Reference LabGeoJSON Map EditorWasm Module InspectorHreflang Matrix CheckerAST Query PlaygroundContainer Build GraphDependency Graph ExplorerSemver Range LabCron Schedule AuditorPatch Review WorkbenchSource Map ExplorerLocalization Catalog AuditorStructured Data ReviewerHTTP Archive AnalyzerWebhook Signature LabProtobuf Schema WorkbenchGraphQL Schema LabAvro Schema EvolutionLocal SQL WorkbenchSchema Form BuilderMesh Repair WorkbenchPipe Network LabRobot Arm Kinematics LabThermal Network LabBeam Response LabGear Train DesignerTolerance Stackup LabSensor Calibration FitPCB Stackup PlannerDigital Filter DesignerNetwork Reachability MapSun Shadow MapGPS Error SimulatorDigital Logic SimulatorAnalog Circuit LabMechanism Linkage LabAnalysis Mesh GeneratorOpenAPI Contract InspectorDatabase Migration PlannerDimensional Equation CheckerTruss Force LabBoolean Minimization LabControl Response LabQueueing Simulation LabGeofence Event SimulatorSurvey Traverse LabRaster Classification LabChoropleth Design LabMap Print ComposerElevation Contour MakerTerrain Viewshed LabMap Tile PackagerText File Encoding WorkbenchFilesystem Portability AuditorSBOM License ExplorerFile Signature Auditornpm Lockfile Conflict ResolverSource Secret AuditorOffline Web Package BuilderCertificate Chain InspectorTorrent Metainfo InspectorChunked File PackagerEncrypted File VaultDuplicate File FinderArchive WorkbenchDesign Token ManagerSpacing Token DesignerResponsive Type SystemPackaging Dieline DesignerSVG Icon Sprite PackerFlex Layout PlaygroundCSS Grid PlaygroundRegex Equivalence LabMarkdown Repository AuditorLog Template MinerResponsive Layout AuditorEmail Template PreviewInternal Link GraphState Machine TesterPetri Net SimulatorGit History VisualizerCurl Request WorkbenchBinary Protocol DesignerHex File EditorBinary Patch WorkbenchFile Signature WorkbenchAPI Mock SandboxSchema Column MapperEvent Log SessionizerER Diagram DesignerTime Series Gap AuditorStratified Data SplitterData Lineage DesignerDecision Tree LabData Anonymization WorkbenchData Expectation RunnerJSON Schema ValidatorBasket Pattern AnalyzerRobots Policy TesterSEO HTML AuditorAccessibility Structure AuditorSyndication Feed WorkbenchIndexNow Payload BuilderCrawl Log AnalyzerCSP Policy WorkbenchSearch Performance AnalyzerCSV Formula Risk AuditorCORS Response SimulatorCache Header LabCookie Policy InspectorWeb Vitals Trace LabSitemap Health AuditorBatch File RenamerFile Manifest VerifierFolder Space MapFolder Difference ReviewerRoute Order OptimizerPolygon Overlay LabCartographic Label PlacerSpatial Table JoinGeoJSON Topology AuditorGPX Track AnalyzerTrack Privacy RedactorCSV Table JoinCSV Pivot WorkbenchScientific Data ProfilerTabular Cleaning WorkbenchRecord ReconciliationData Dictionary BuilderCanonical Graph AuditorRedirect Plan TesterHTTP response and ping reference testBrowser and System InformationJSON ↔ YAML ConverterXML ↔ JSON ConverterHTML FormatterJavaScript MinifierMock Data Generator.gitignore GeneratorLicense GeneratorUser-Agent ParserPassword Strength CheckerCode to ImageXML FormatterHTTP Status Code LookupMIME Type LookupJS & SQL String EscapeCSS Box Shadow GeneratorCSS Gradient GeneratorIndent ConverterNumber Base ConverterUnicode Escape ConverterUnicode InspectorJSON Structure DiffMarkdown Table GeneratorBase64 EncoderJSON FormatterURL EncoderSQL FormatterCron Expression GeneratorRegex TesterUUID GeneratorHash GeneratorTimestamp ConverterJWT DecoderHTML Entity ConverterMarkdown PreviewCSS MinifierMeta Tag GeneratorJSON ↔ CSVCase ConverterImage to Base64
Explore all Dev Tools tools →Image/Media →Text/Convert →Life/Fun →