Terrain Viewshed Lab
Use a grid-cell center as an observer on a small, north-up single-band DEM GeoTIFF and test line of sight to every target cell. Intermediate terrain is bilinearly sampled; a sample strictly above the ray blocks it, while unknown intermediate NoData stays unknown. This is a local terrain approximation for learning and exploration, not certified surveying or radio engineering.
Key features
- Read a real single-elevation-band EPSG:4326/3857 GeoTIFF, georeferencing and NoData
- Set observer row/column, eye/target offsets, declared source elevation unit and radius
- Check four intermediate samples per cell-center spacing with bilinear terrain heights
- Show visible, blocked, NoData/unknown and outside-radius classes with distances and sample count
- Export an 8-bit georeferenced GeoTIFF mask, visual PNG and per-cell coordinate/distance CSV
- Explicitly reject rotation, other CRS, multiband DEMs and oversized grids; allow cancellation
How to use
- Choose a single-band DEM GeoTIFF or load the synthetic hill example.
- Set zero-based observer row/column, source elevation unit, eye/target heights and radius in metres.
- Run the calculation and inspect green visible, red blocked, gray unknown and pale blue outside-radius cells.
- Click a map cell to move the observer and rerun, or download GeoTIFF, PNG and CSV.
Use cases
- Explore how a hill hides terrain behind it in a small DEM
- Compare local visibility after changing observer or target height
- Export a georeferenced status grid for inspection in GIS
Frequently asked questions
How does this differ from Screen Info?
Screen Info reads browser display dimensions and pixel ratio. This tool computes terrain line of sight between positions on a real georeferenced elevation grid.
What if terrain just touches the sightline?
Only an intermediate terrain sample strictly above the ray blocks it. Contact or equal height within numerical tolerance remains visible. If intermediate NoData is present and no known blocker is found, visibility is unknown.
How are distance and accuracy modeled?
Radius and along-ray fractions use spherical great-circle distances, while the ray path is straight in the source raster grid. Terrain heights are bilinearly interpolated. Earth curvature, atmospheric refraction, buildings, trees, DEM vertical datum and measurement error are omitted.
Which elevation units and CRS work?
Declare the source elevation numbers as metres or feet; eye and target heights use that same unit. Radius and distance output use metres. Only north-up PixelIsArea GeoTIFF tagged EPSG:4326 or 3857 is accepted; rotation, PixelIsPoint and other CRS are rejected.
How do I interpret downloads?
The 8-bit GeoTIFF preserves source georeferencing: 1=visible, 0=blocked, 2=NoData/unknown, 3=outside radius. Value 2 is the NoData tag. PNG is only a color preview without georeferencing; CSV gives each cell center coordinate, distance and class.
Can this process a large DEM?
Files are capped at 8 MiB, 80 cells per side, 6400 total cells and 1.5 million valid intermediate samples. Use specialist GIS viewshed software for large or engineering-critical work.
Privacy
The DEM remains in this browser tab. File reading, analysis and downloads run locally without uploading the file or coordinates to a server API.
Comments & questions