Sight and sun
How the app works out where the sun is, which ground it reaches at a time, and how many hours of direct sun a piece of ground gets in a day (plan v4 items 497 to 499), and whether one point can see another and what can be seen from a point (items 492 to 494). Line of sight is under Line of sight.
The sun layer gives hours of direct sun under a clear sky, by geometry, and no energy figure (plan v4, Decisions, "What the sun layer may claim"). The map key reads "Clear-sky sunlight", with the date and the time zone.
What it leaves out
- Cloud and haze. Every hour is a clear-sky hour. Esri's solar tools add how clear the sky is, with figures a user would have to supply, and this doesn't.
- Anything built, grown or cut since the flight. The ground and what stands on it are as the lidar saw them. A barn put up since, or a shelterbelt grown taller, isn't there.
- Leaves on or off, crops standing or cut. A first-return surface is the trees as flown. Lidar flown in April has bare branches; the same trees cast more shade in August.
- Light through gaps. A tree is a solid block as tall as its highest return in each cell. Dappled shade under a crown counts as shade.
- Ground past the edge of the area, beyond 3 km, and what stands on it. A hill just outside the drawn area can shade it at low sun. The terrain that was built reaches 100 m past the area, and past that the line to the sun goes on over 10 m terrain from the USGS for 3 km (Ground past the edge). Past 3 km, the answer gives no sun for a cell whose line it couldn't follow far enough, and trees and buildings past the edge aren't there: the coarser ground is bare ground.
- Real refraction. Refraction near the horizon changes with the air's temperature and pressure. NOAA's model assumes a standard atmosphere.
Where the sun is
packages/surface/src/sun/position.ts, solarPosition.
Method. The equations of NOAA's Solar Calculator, as written in NOAA's own spreadsheet (NOAA_Solar_Calculations_day.ods, linked from the calculation details page), which follow Jean Meeus, Astronomical Algorithms. The code names the spreadsheet column each step reproduces (Julian Day in F, Julian century G, mean longitude I, mean anomaly J, eccentricity K, equation of centre L, apparent longitude P, obliquity Q and R, declination T, equation of time V, true solar time AB, hour angle AC, zenith AD, elevation AE, refraction AF, corrected elevation AG, azimuth AH). The time zone is set to zero throughout, so the instant is UTC.
- Input: a latitude, a longitude and an instant as UTC milliseconds. Nothing in
packages/surface/src/sun/reads a clock, a time zone or a locale.apps/web/src/lib/terrain/sun-engine-purity.test.tsreads the engine's source and fails on anyDate,performance.now,process,Intl,getTimezoneOffset,toLocale…, local-time getter orMath.random, and checks that it catches each. - Output: the sun's height above the horizon with and without refraction, its direction clockwise from true north, the declination, the equation of time, the hour angle and the apparent longitude.
- Julian Day is worked out exactly from the UTC instant (
ms / 86 400 000 + 2 440 587.5). The spreadsheet's own date arithmetic is valid only from 1901 to 2099; the web calculator's isn't limited, and neither is this. - Dynamical time: like NOAA's, the equations take UTC as dynamical time, leaving out Delta T (69 seconds in 2025). That moves the sun by under 0.001 degrees.
- Refraction: NOAA's approximation, exactly as the spreadsheet's column AF has it, in the four ranges the calculation details page tabulates: none above 85 degrees;
58.1/tan e − 0.07/tan³ e + 0.000086/tan⁵ earc seconds from 5 to 85 degrees;1735 − 518.2 e + 103.4 e² − 12.79 e³ + 0.711 e⁴arc seconds from −0.575 to 5 degrees; and−20.772 / tan earc seconds below. It is about 0.48 degrees at the horizon. - Sunrise and sunset (
times.ts,sunWindow) follow NOAA's convention: the sun's centre 0.833 degrees below a level horizon (spreadsheet column W). They are found fromsolarPositionby sampling every 5 minutes and halving to half a second. Direct sun is counted while the sun's centre, with refraction, is above a level horizon (centreUpUtcMstocentreDownUtcMs), which starts about 1.5 to 2 minutes after sunrise at these latitudes and ends as long before sunset. - Solstices and equinoxes (
seasonInstants) are the instants the sun's apparent longitude is 0, 90, 180 and 270 degrees, the definition in Meeus, chapter 27, found by halving to a second.
Reference cases, worked outside the engine
NOAA's own spreadsheet. NOAA_Solar_Calculations_day.ods was downloaded from NOAA on 2026-11-30. A script changed only the four input cells (latitude B3, longitude B4, time zone B5 set to 0, date B7) in a copy, and LibreOffice 26.8 recalculated it on load and exported every row at full precision to CSV. The values below are copied from the 6-minute row for each time. The engine runs the same equations, so they agree to rounding (under 10⁻¹¹ degrees); the test's tolerance is 0.0005 degrees.
NREL's Solar Position Algorithm, a different and stricter method (Reda and Andreas, NREL/TP-560-34302, with nutation from 63 terms and a topocentric correction): pvlib 0.16.1's spa_python, run in a throwaway virtual environment outside the repo, at sea level, 1013.25 hPa and 10 °C, with pvlib's default Delta T. NREL's site still couldn't be reached on 2026-11-30 (every request to nrel.gov timed out, and OSTI's copy of the report had no file), so the report's own worked example was read from pvlib's test file, tests/test_spa.py at v0.16.1, which transcribes it. pvlib reproduced that example exactly before it was used for these cases.
| Place, date, time (UTC) | Latitude, longitude | NOAA spreadsheet: height, refraction, direction (degrees) | NREL SPA by pvlib: height before refraction, after, direction | Engine minus NREL: height, direction |
|---|---|---|---|---|
| Fargo, 21 June 2026, 18:00 (solstice) | 46.8772, −96.7898 | 65.853727, 0.007236, 163.540476 | 65.845673, 65.853269, 163.544277 | +0.0005, −0.0038 |
| Fargo, 21 June 2026, 15:00 | 46.8772, −96.7898 | 42.413980, 0.017651, 100.775241 | 42.395595, 42.414133, 100.776860 | −0.0002, −0.0016 |
| Mankato, 20 March 2026, 18:30 (equinox) | 44.1636, −93.9994 | 45.890931, 0.015635, 182.388119 | 45.871530, 45.887958, 182.386651 | +0.0030, +0.0015 |
| Mankato, 20 March 2026, 12:30, just after sunrise | 44.1636, −93.9994 | 1.503646, 0.348906, 91.170631 | 1.150192, 1.499462, 91.171556 | +0.0042, −0.0009 |
| Brookings, 15 October 2026, 12:42, before sunrise | 44.3114, −96.7984 | −0.510410, 0.373842, 101.232836 | −0.892508, (none), 101.228681 | (not compared), +0.0042 |
| Brookings, 15 October 2026, 12:48, at sunrise | 44.3114, −96.7984 | 0.624502, 0.458875, 102.280585 | 0.157383, 0.619667, 102.276405 | +0.0048, +0.0042 |
| Brookings, 15 October 2026, 18:12 (ordinary day) | 44.3114, −96.7984 | 36.989359, 0.021396, 179.724550 | 36.964828, 36.987289, 179.715494 | +0.0021, +0.0091 |
NREL's own example (Golden, Colorado, 17 October 2003, 12:30:30 at UTC−7, 39.742476 N, 105.1786 W): the report gives 39.872046 degrees before refraction and an azimuth of 194.340241. The engine gives 39.872074 and 194.342583, 0.00003 and 0.0023 degrees apart.
Near sunrise the comparison is made only above half a degree: below the horizon pvlib adds no refraction and NOAA adds some, so the two say different things on purpose there.
Tolerance against NREL: 0.02 degrees for height and direction (position.test.ts). It is defended three ways. The sun moves through 0.25 degrees of hour angle a minute, so 0.02 degrees is under 5 seconds of time, well inside NOAA's statement that its sunrise and sunset are right "to within a minute" between 72 degrees north and south. A 10 m pole's shadow with the sun 5 degrees up is 114 m long, and 0.02 degrees moves its tip by 10 / sin²(5°) × 0.02 × π/180 = 0.46 m, under one 1 m cell. And the largest difference found, 0.0091 degrees, is under half of it.
Sunrise and sunset were checked against the U.S. Naval Observatory's Astronomical Applications API for the three places and dates, read on 2026-11-30 with tz=0. USNO lists the events of one UTC date, so a sunset after midnight UTC comes from the next date's query. USNO rounds to the minute. The engine's times are within 40 seconds of every one; the test allows NOAA's minute plus USNO's half minute.
| Place and date | USNO rise, set (UTC) | Engine rise, set (UTC) |
|---|---|---|
| Fargo, 21 June 2026 | 10:33, 02:25 on the 22nd | 10:32:38, 02:25:26 |
| Mankato, 20 March 2026 | 12:19, 00:29 on the 21st | 12:18:56, 00:28:33 |
| Brookings, 15 Oct 2026 | 12:42, 23:43 | 12:42:18, 23:42:49 |
Solstices and equinoxes were checked against USNO's seasons table for 2025, 2026, 2027 and 2030 (times.test.ts). The engine's instants are 3 to 10 minutes from USNO's: NOAA's apparent longitude is good to about 0.01 degrees, which the sun crosses in about 15 minutes. The test allows half an hour. A named date can only be wrong when the instant falls within that much of a midnight in the zone it is read in; for the dates a pad's card names, a day either side changes the hours of sun by seconds.
Grid north and true north
The sun's direction is from true north. A project's grid is NAD83(2011) / UTM, whose north is parallel to the zone's central meridian. The angle between them, the meridian convergence, is worked out at the grid's centre as γ = atan(tan(λ − λ₀) · sin φ), the spherical form (Snyder, Map Projections: A Working Manual, USGS Professional Paper 1395, 1987), and the sun's direction is turned by it before shading (trueToGridAzimuthDeg). Grid north lies clockwise of true north east of the central meridian in the northern hemisphere.
It is 1.61 degrees at Fargo (2.21 degrees west of zone 14's central meridian, 99 W) and about 2.2 degrees at a zone's edge at 47 N. apps/web/src/lib/terrain/sun.test.ts checks the value at Fargo against proj4's own projection of the project's system, to 0.01 degrees. Left uncorrected, 2.2 degrees would swing the tip of a 90 m shadow sideways by 3.5 m.
One convergence serves the whole grid. Across a 160-acre field it changes by under 0.01 degrees.
Shade at a time
packages/surface/src/sun/shade.ts, shadeFromSun and sweepShade.
Heights. The ground is the project's original DEM. Where a first-return surface exists on the same grid (plan v3 items 383 and 384), the higher of it and the ground stands in each cell, and that surface both casts shade and receives light: the top of a tree crown is lit, the ground beside it shaded. A cell with no ground height is left out, whatever the first-return surface says there: it casts no shade and gets none, and the count of such cells comes back with the answer.
Method. Each cell is a flat-topped block. From a cell's centre, the line toward the sun is followed through the grid cell by cell (the traversal of Amanatides and Woo, "A Fast Voxel Traversal Algorithm for Ray Tracing", Eurographics 1987). The line rises by cell size × tan(sun's height) per cell of distance. Where it enters a cell whose height stands above the line at that point, the cell it started from is in shade. Once it has risen above the highest ground known, nothing further can shade it, and the cell is in sun. A pyramid of block maxima (blocks of 2, 4, 8 … cells) lets the line pass over a whole block at once where it is already above everything in it; a block at the grid's edge is cut to the grid, so the line can't skip past it.
A first version swept the grid once per sun position, carrying a shadow height from cell to cell and interpolating between neighbors. It was replaced: the interpolation smeared narrow shadows, and a 20 m pole's 90 m shadow came out 21 m long.
What it says per cell: sun, shade, no ground, undecided because the line crossed missing ground, undecided because the line left the grid, or sun down (the sun's centre at or below the horizon).
A quick pass first. The quick pass runs the same method on cells 4 times wider, each the mean of its block's heights, or no height where fewer than half the block has one (coarsenHeightGrid). It only shows the shape sooner; the full pass on the project's own cells is the answer.
Hours of direct sun in a day
packages/surface/src/sun/day.ts, sunHoursOverDay.
The time the sun's centre is above a level horizon, on the local day asked for, is cut into equal intervals no longer than the step (10 minutes by default). That time is every stretch of the day with the sun up (centreSpans in sunWindow): usually one, from rising to setting, but two on a day whose light runs over one of its midnights, and each stretch is cut into intervals of its own. See A day read in a zone far from the place. At the middle of each interval the sun's position is worked out, the grid is shaded, and each cell in sun gets that interval's minutes. Cells that couldn't be decided get the minutes in a separate count, never as sun.
The step's effect. Each change between sun and shade is placed to within half an interval, so each change can move a cell's total by up to half a step either way. A cell shaded in the morning and again in the evening, by a 10 minute step, is right to within 10 minutes. Open ground gets the whole of the time the sun's centre is up, exactly, since nothing changes.
Sun on a pad on four days
sunHoursOverDay with onlyCells, through sunFootprintTask in apps/web/src/lib/terrain/sun.ts. The cells of a pad are those whose centres lie inside it, or, for a pad narrower than a cell or a single point, the cell under its middle. Only those cells are traced, but their lines to the sun cross the whole grid. The answer for each day is the least, mean and most minutes over the pad's cells with ground, the count of cells with none, and the most minutes any cell couldn't decide.
The four days are the June and December solstices and the two equinoxes of a stated year, from seasonInstants. Each is named as the date its instant falls on in the project's time zone (fourSunDays): the September equinox of 2026, at 00:05 UTC on the 23rd, is 22 September in Chicago.
One ground for the card and the page (review round 7, NH2 and NH3). The pad's card and Check a building site's map page work the four days over the same ground: the first-return surface when the project has one for this terrain, and the ground past the edge (item 529, below) once it has been read, passed to padSunRequest as the Sun and shade layer passes it to its own tasks. Each says beside the hours which it used ("Bare ground only…" or "Trees and buildings cast shade as the lidar saw them."). The card works the hours at once and again when the ground past the edge comes; the page waits for both before it is made (padSunForPage in apps/web/src/lib/terrain/site-page-parts.ts).
A wall of known height
The proof that a shadow, not only the sun, is right (plan v4, PR 58, Risks). Fargo (46.8772 N, 96.7898 W), flat ground, an east-west wall 3 m high, 1 m cells, the grid aligned with true north.
Its shadow at one time. NOAA's spreadsheet for Fargo on 21 December 2026 at 16:00 UTC (10:00 CST) gives the sun 12.4837 degrees up, toward 146.1818 degrees.
- The shadow runs away from the sun, toward 146.1818 + 180 = 326.18 degrees.
- Its length along that line is
h / tan e = 3 / tan 12.4837° = 3 / 0.22137 = 13.55 m. - Measured straight north of the wall, that is
13.55 × −cos 146.1818° = 13.55 × 0.8307 = 11.26 m.
The grid shades 11 cells north of the wall (shade.test.ts, and again through the worker in sun.test.ts): a cell is shaded when its centre lies closer than 11.26 m. The test allows a cell. For direction, a single cell 20 m high casts a shadow 20 / 0.22137 = 90.35 m long; the grid's farthest shaded cell lies within 1.5 m of that length and within the angle one cell subtends at the tip of 326.18 degrees.
Hours a point behind it is shaded. A point 10 m north of the wall is shaded when the sun is south of the east-west line (cos A < 0) and the sun's height, seen across the wall, is under the wall's: tan e < (h / d) × (−cos A), with h = 3 and d = 10.
This was applied to every 6-minute row of NOAA's spreadsheet for Fargo on 21 December 2026 with the time zone at 0. 85 rows have the sun's centre, with refraction, above the horizon (14:12 to 22:36 UTC). In 39 of them the point is in sun: 234 minutes, from about 16:30 to 20:24 UTC, in shade before and after. At 18:30 UTC (solar noon) the sun is 19.72 degrees up, above the wall's 16.70 degrees (atan 0.3), so the point is lit. Measured to the wall's near face, d = 9.5 m, it is in sun for 204 minutes (16:48 to 20:12); to its far face, d = 10.5 m, 264 minutes.
On the grid the wall is a block 1 m thick, and the line from the point is cut by the top edge nearest it, 9.5 m away. The engine gives 209 minutes at a 6-minute step: within one step of the near-face case, and inside the 204 to 264 minutes the cell's width allows (day.test.ts). Through the worker at the default 10-minute step it is within 10 minutes of 204 (sun.test.ts). So the tolerance follows from the cell size: a wall one cell thick is measured from its near face, and a point's hours lie between the wall's near-face and far-face cases, widened by the step.
Where the data runs out
- No ground at a cell: left out, counted (
noGround,noGroundCells), and given no number. A pad all on missing ground gets no hours, and the count says why. - Missing ground between the sun and a cell: the cell is undecided unless ground nearer to it, on the same line, already shades it. A shadow is never cast from missing ground. Once the line has risen above the highest ground known before it reaches the gap, the gap can't matter and the cell is in sun.
- The grid's edge: a cell whose line to the sun leaves the grid while still under the highest ground known is undecided, never sun. Each answer gives the extent its ground was read over (
groundStops, in the project's metric coordinates) and the height a line had to clear (ceilingM), so ground past the edge can be read (item 529, Ground past the edge). Given only the height of the highest ground past the edge (outsideCeilingM), ground known to stand higher widens the band that can't be decided and never turns undecided cells into sun; given the ground itself (outside), the line goes on over it to an answer. A screen gives "at least" the decided hours where some couldn't be decided, and says the ground stopped at the edge. - The sun never rising or never setting (above the polar circles): the day is all night or all day, and the window says which. A day on which it rises without setting, or sets without rising, counts from the rising to the day's end, or from the day's start to the setting.
Line of sight
A sight line between two points (item 492), what can be seen from a point (item 494), and the correction both take for the earth's curve and the bending of light (item 493). packages/surface/src/sight/, called through the terrain worker by apps/web/src/lib/terrain/sight.ts. The clearance a radio link needs is not worked out: the bending of light used here is not the bending of a radio signal (plan v4, Decisions, "Before PR 58").
What it leaves out
- Trees and buildings as flown. Over what stands on the ground, the heights are the first-return surface of the lidar flight (plan v3 items 383 and 384): the trees with their leaves on or off as they were that day, crops standing or cut, and no building put up since. A line clear in April lidar can be blocked in August.
- Anything thinner or more open than a cell. Each cell is a solid block as tall as its highest return. A wire fence, a gap between two trunks or the view through bare branches is a solid wall or nothing, by the cell.
- Which cells have no height. A cell is missing where it holds NaN or the grid's missing-value tag, in either of the tag's forms: as written, and as a 32-bit grid stores it (
-9999.1is held as-9999.099609375). Matching only the written form would read every missing cell of such a grid as ground about 10 km down, a pit a sight line looks clear across and a shadow falls into. The sight line, the view, the ground past the edge and the shade all use the one test,isValidHeight(review finding NF11, 2026-12-02); a grid whose tag is stored exactly reads as before. - Where there are no heights. A cell with no ground height gives no answer, and a line that crosses one is undecided unless something known blocks it. Where the first-return surface has no height for a cell, that cell is read as bare ground and the answer says which part that was: "Bare ground only. Trees and buildings aren't mapped here."
- Ground past the edge of the area. A line or a view stands on the ground that was built. Where its line crosses a gap in it, it reads 10 m terrain from the USGS there, as bare ground, and says so (Ground past the edge).
- Haze, light and eyesight. It is geometry: whether a straight line, bent as light bends on average, passes over the ground. Whether something that far away could be made out isn't part of it.
- Real refraction on the day. The coefficient of 0.13 is an average. Over cold water or hot ground on a still day light bends more or less, and Esri's page says other values can be used for other conditions; the engine takes another coefficient, and the screens use 0.13.
The earth's curve and the bending of light
curve.ts. From Esri's page "Using Viewshed and Observer Points for visibility analysis" (ArcGIS Pro documentation, section "Curvature and refraction corrections", read 2026-11-30), each height seen at a planimetric distance Dist from the observer is corrected as
Z_actual = Z_surface − Dist² / Diam_Earth + R_refr × Dist² / Diam_Earth
where Esri gives the diameter of the earth as 12,740,000 m and the refractivity coefficient of light as 0.13 by default, "based on the Gaussian refraction coefficient", citing F. K. Brunner, 1984, Geodetic Refraction: Effects of Electromagnetic Wave Propagation Through the Atmosphere, Springer, Berlin. So a height at distance d is lowered by c × d², with c = (1 − 0.13) / 12,740,000 = 6.828885 × 10⁻⁸ per meter. It is on by default for both a sight line and a view.
A sight line is corrected from its first end. Lowering every height by c × d² from one end or from the other differs only by a straight tilt along the line, which moves the line of sight and the ground alike, so which end is first doesn't change the answer. The profile a card draws keeps the ground level and draws the line of sight where it stands over that level ground: between two eyes it sags toward the ground by c × d × (L − d), 2.46 m at the middle of a 12 km line.
A sight line
line.ts, sightLine.
- Ends. Each end is a point in the project's metric coordinates and a viewing height above the bare ground in the cell under it. Over what stands on the ground, the ends still stand on bare ground: a person under a tree is under it, not on top of it.
- Heights that block. Over bare ground, the project's original DEM. Over what stands on it, the higher of the DEM and the first-return surface in each cell. Each cell is a flat-topped block. The two end cells are left out, so the tree an end stands under doesn't block it.
- Sampling. Every cell the straight line crosses is visited, in order, with the distances at which the line enters and leaves it (the traversal of Amanatides and Woo, "A Fast Voxel Traversal Algorithm for Ray Tracing", Eurographics 1987). No cell whose inside the line passes through is skipped; where the line passes exactly through a corner, the two cells that touch it only at that point aren't counted. A test checks the walk against 100,000 points along a line.
- The test in each cell. Over the stretch of the line inside a cell, the block is compared with the line at its lowest. With the correction, the block's height above the line is
top − c(tL)² − (z_from + (z_to′ − z_from)t)for t along the line, which is largest at an end of the stretch or where its slope is zero; all three are checked. The line is blocked where a block stands more than 10⁻⁹ m above it. - What comes back. Clear, blocked, undecided (no block on ground that has heights, but part of the line has none) or no answer (an end with no ground under it). The first block from the first end, with its place along the line where it stands highest above it, its position, how far above the line it stands, its height, and whether the ground alone would block (ground) or only what stands on it does (surface). A profile of every cell crossed: where the line enters and leaves it, the ground, the first-return height, the height that blocks, the line of sight at the middle of the stretch and its least clearance over the cell. The parts with no ground and the parts that read bare ground only, as distances along the line. The extent the ground was read over (
groundStops) and where the line leaves it.
What can be seen from a point
view.ts, viewFrom.
- Which cells. Every cell whose centre lies within the chosen distance of the observer, measured flat, and always the observer's own cell, which is seen. A cell's centre can lie up to √2 / 2 of a cell from a point inside it, so a distance shorter than that, from near a corner, takes in no centre at all; until review NH4 (2026-12-02) such a view failed with an error, as did the quick pass, on its cells 4 times wider, for distances up to 2.8 of the project's cells (2.8 m on a 1 m grid, 14 m on a 5 m one). It now sees its own cell and nothing more (
view.test.ts). Each is tested on its own with the full line from the observer's eye to a target at its centre, walked and tested exactly as a sight line is: Franklin and Ray's "R3" test, one line per cell, not the quicker forms that share lines between cells, their R2 and XDraw (W. R. Franklin and C. Ray, 1994, "Higher isn't necessarily better: visibility algorithms and experiments", Sixth International Symposium on Spatial Data Handling; see the sources below for what of this was checked). A test checks the view againstsightLineto sample cells. - The target. A height above each cell's top that has to be seen. The default is 0 m, the ground itself, as Esri's OFFSETB defaults to 0. Seeing a person standing there is a target height the user types; it sees more of the ground behind a wall. Over what stands on the ground, a cell's top is the higher of the ground and the first-return surface, so the view says whether the top of what stands there, a roof or a crown, can be seen.
- Passing over open ground. A pyramid of block maxima (blocks of 2, 4, 8 … cells, as in the shade sweep) lets a line pass over a whole block where it is already above everything in it, the block has no cell with missing ground and no cell that read bare ground only, and the line leaves it before its end. The uncorrected block top is never below the corrected one, so a block is never skipped that could block. A test on rough ground with gaps and trees, from three points, over both surfaces, with and without a target height, checks the answer is the same cell for cell as reading every cell on every line.
- What comes back. A state per cell over the box around the distance, cut to the grid: seen, hidden, no ground, undecided (its line crosses ground with no height and nothing known hides it), or outside. The counts, the seen area in square meters (
viewAcresturns it into acres), the cells within the distance past the grid's edge (beyondEdge, given nothing), and, over what stands on the ground, which cells read bare ground only. - A quick pass first. The same test on cells 4 times wider, each the mean of its block (
coarsenHeightGrid, as the sun layer does). The full pass on the project's own cells is the answer. - A limit. A distance that takes in more than 2,000,000 cells on the grid, at the project's own cell size, isn't worked: both passes come back
too-farwith a distance that fits wherever the observer stands (797 m at 1 m cells, 1,595 m at 2 m), for "Choose a shorter distance." The limit counts cells on the grid, not the whole circle, because those are the work, so 160 acres at 1 m (648,025 cells) can be viewed whole from anywhere on it. See Speed of line of sight for why.
Reference cases, worked outside the engine
A sight line over a wall. Flat ground at 0 m, 1 m cells. A stands at the centre of a cell and B at the centre of the cell 100 m east, B's eye 1.5 m up. A wall 3 m high fills the cell from 19.5 to 20.5 m east of A. The line falls from A's eye toward B's, so it is lowest over the wall at the wall's far face, 20.5 m from A. By similar triangles, the line clears the wall there when
h_A + (1.5 − h_A) × 20.5 / 100 ≥ 3, that is h_A ≥ (3 × 100 − 1.5 × 20.5) / (100 − 20.5) = 269.25 / 79.5 = 3.386792 m.
With A's eye at 3 m, the line is at 3 − 1.5 × 20.5 / 100 = 2.6925 m at the far face, so the wall stands 0.3075 m above it there, 20.5 m from A. The engine finds the height by halving to 3.386792 m with the correction off, and to within 1 mm of it with the correction on (the curve lowers the far eye by 0.0007 m). It is blocked at 3.38 m and clear at 3.39 m, and at 3 m it names the wall's cell, 20.5 m along the line, 0.3075 m above it, on the ground (line.test.ts, and through the worker in sight.test.ts). Tolerance: 10⁻⁶ m with the correction off, 1 mm with it on.
A line long enough for the curve to block it. Level ground or water at 0 m, an eye 2 m up, a target 12 km away. Lowering heights by c × d², the ground is a parabola under a straight line of sight, and the lowest line from the eye just grazes it at the horizon, where c × d_h² = 2:
| With refraction, k = 0.13 | Without, k = 0 | |
|---|---|---|
| c = (1 − k) / 12,740,000 | 6.828885 × 10⁻⁸ /m | 7.849294 × 10⁻⁸ /m |
| Horizon, d_h = √(2 / c) | 5,411.78 m | 5,047.77 m |
| Drop at 12 km, c × 12,000² | 9.8336 m | 11.3030 m |
| Height hidden at 12 km, c × (12,000 − d_h)² | 6.828885 × 10⁻⁸ × 6,588.22² = 2.9641 m | 7.849294 × 10⁻⁸ × 6,952.23² = 3.7938 m |
The last row follows from the tangent: the line through the eye that touches the parabola −c d² at d_h is c d_h² − 2 c d_h d, which at L is c d_h² − 2 c d_h L, and a target at L, itself lowered by c L², clears it when its height is at least c (L − d_h)². With the correction off, nothing on level ground blocks the line.
On a grid of 5 m cells, the engine's lowest target height that clears is 2.964054 m with refraction and 3.793837 m without (line.test.ts, by halving). Tolerance: 2 cm. The block model lowers a whole cell by the drop at its nearer edge; at the horizon that overstates the ground by at most 2 c d Δ = 2 × 6.83 × 10⁻⁸ × 5,412 × 5 = 0.0037 m, about 1 cm at the target after the lever of L / d_h. The engine came within 10⁻⁸ m. For the view, the same ground at 50 m cells looking 12 km: the farthest cell seen is 5,423 m away and the nearest hidden 5,425 m, against 5,412 m by hand (view.test.ts, tolerance one cell, 50 m).
A view from beside a wall. Flat ground, 1 m cells, the eye 5 m up at a cell's centre, a wall 2 m high filling the cells from 19.5 to 20.5 m east of it, running past the distance both ways, and a distance of 50 m. The wall is lower than the eye, so the line to ground east of the wall is lowest over it at its far face, 20.5 m east, whatever the line's direction: ground at x m east is hidden when 5 − 5 × 20.5 / x < 2, that is for 20.5 < x < 20.5 × 5 / 3 = 34.17 m. So the hidden ground is the band of the circle of 50 m between two lines 20.5 and 34.17 m east, the difference of two circular segments, each R² acos(x / R) − x √(R² − x²):
2,500 × acos(0.41) − 20.5 × √(2,500 − 420.25) = 2,870.86 − 934.89 = 1,935.97 m²
2,500 × acos(0.6833) − 34.17 × √(2,500 − 1,167.36) = 2,046.20 − 1,247.27 = 798.93 m²
hidden = 1,137.04 m²
On the grid, the cells whose centres are in that band are those 21 to 34 m east within 50 m, which counted by hand (every integer x from 21 to 34 and y with x² + y² ≤ 2,500) is 1,162. The engine hides exactly 1,162 cells, with and without the correction, and every cell from 21 to 34 m east on the eye's row (view.test.ts, and through the worker in sight.test.ts). Tolerance: the cell count exactly; against the true area, one square meter per meter of the band's two curved edges, 33 m² (the engine is 25 m² over, from the cells cut by the circle).
Where the data runs out
Each has a test in line.test.ts or view.test.ts.
- Part of a line with no ground at all: that part comes back in
noGround, as distances along the line, its cells in the profile with no heights, and the line is undecided, never clear: "Part of the line has no height data." A block on ground that does have heights still blocks it. - A first-return surface that covers only part of a line or a view: the parts that read bare ground only come back (
bareGroundOnlyalong a line, a flag per cell and a count for a view), andsurfacesayspart. - No first-return surface at all:
surfacesaysnoneand the whole line, or every cell of the view, read bare ground only: "Bare ground only. Trees and buildings aren't mapped here." - The edge of the built ground: an end past the edge, or on a cell with no ground, has no eye to place, so the line gives no answer (
no-end) and says which end, where the line leaves the ground (leavesGroundAtM) and the extent read (groundStops). A line between two ends on the ground stays on it. A view's cells within the distance past the edge are counted (beyondEdge) and given nothing, and a cell whose line crosses ground with no height is undecided, never seen or hidden. A view from a point with no ground gives no answer (no-observer).
The ground a sight line is fetched with
Check a line of sight (plan v4 item 496) asks for two points and nothing else. The area the build reads is made from them (apps/web/src/lib/terrain/sight-corridor.ts) and saved as the project's area, so the search and the build start by themselves, as for any saved area.
- Shape. A rectangle along the line: 50 m (164 ft) each side of it and 50 m past each end, in the project's own meters (NAD83(2011) / UTM, the zone of the line's middle, as a saved area's is chosen). A line of 100 m makes an area 200 m by 100 m, 4.94 acres.
- Why 50 m, a labeled choice and not a measurement. The answer reads only the cells the line crosses, so any width would answer the line as drawn. The width is for what happens next. The worker adds 100 m round every area (
DEFAULT_BUFFER_Minservices/gis-worker/gis_worker/terrain/aoi.py), so built ground reaches 150 m from the line on every side: an end can be dragged 150 m in any direction, and a tree or a building a person wonders about beside the line can be checked with a new line, without a new build. Wider costs build time for ground nobody asked about; a line of a quarter mile is 12 acres at 50 m. The two ends stay on built ground, since the area is the line's own rectangle. - The limit. The build makes ground over the whole box round its area, buffer included, so a line running corner to corner costs far more cells than its acres say. A corridor is held to the box of the largest square the build makes at 1 m (1,000 acres, the top of its 1 m band,
ONE_METER_MAX_ACRES), with its 100 m buffer: 2,211.68 m a side, 4,891,528 cells. The acre bands were picked to keep a square project near that many cells (lidar-analysis.md, section 1), so a corridor is held to the same, and it is a starting point as they are. Counted at 1 m, the box allows a line of up to 16,005 m (52,510 ft) east to west or north to south, and 2,645 m (8,677 ft) corner to corner:(L + 300) × 300cells along a grid line, and(0.7071 L + 341.42)²at 45 degrees, from the corridor's turned corners (50 √2 m each side) and the buffer. Past it the Points step says how far apart the points are, how far fits in that direction, and to move the second point closer (corridorTooLong); nothing is saved.sight-corridor.test.tschecks each figure. - An end moved past it. An end dragged off the built ground gives no answer, as any sight line's does (below, "Where the data runs out"), and the step offers to fetch the ground for the line as it is now: a new corridor, saved over the first, and a new build, said plainly to take a moment. Until it lands the step gives no answer for that line.
- What answers. Built terrain only. The quick look from the USGS's elevation service is never read to say whether the line is clear or blocked.
Speed of line of sight
Timed in Node 26.5 on an Apple M5 laptop with 16 GB, in vitest, on 2026-11-30, through executeSightTask (the worker's own code, coarsening included), with the correction on. The field is the synthetic 160 acres at 1 m (scripts/synthetic-160ac-cog.ts: 805 × 805 = 648,025 cells, 4.4 m of relief), with an eye 2 m up. Over what stands on the ground, a copy of the field with every 53rd cell 8 m taller stands in for trees. Other lanes were running: the load average was 14 to 16 during the run below, and an earlier run at a load of 3 gave about half these figures for the full pass (0.32 s at 400 m from the middle, 0.66 s at 805 m from the corner), so an idle laptop would be quicker still.
| A view of | Cells within the distance | Quick pass (4 m cells) | Full pass (1 m) |
|---|---|---|---|
| 100 m from the middle | 31,417 | 3 ms | 13 ms |
| 100 m, over what stands on it | 31,417 | 4 ms | 19 ms |
| 200 m from the middle | 125,629 | 5 ms | 66 ms |
| 200 m, over what stands on it | 125,629 | 5 ms | 102 ms |
| 402 m from the middle | 507,665 | 52 ms | 0.45 s |
| 402 m, over what stands on it | 507,665 | 29 ms | 0.48 s |
| 805 m from a corner | 2,035,785 (648,025 on the field) | 47 ms | 1.24 s |
| 805 m, over what stands on it | 2,035,785 (648,025) | 44 ms | 0.52 s |
| 1,128 m from a corner | 3,997,261 (648,025) | 60 ms | 1.86 s |
| 1,128 m, over what stands on it | 3,997,261 (648,025) | 53 ms | 0.51 s |
Over what stands on the ground is often quicker: a line that meets a tree stops there.
To set the limit, the field was mirrored into a grid of 2,415 × 2,415 cells, so that the whole circle lies on ground, and viewed from its middle at a load of 12: 805 m (2.0 million cells) took 134 ms quick and 2.9 s full, and 1,128 m (4.0 million cells) took 211 ms quick and 6.2 s full. The work grows with the cells on the grid times the length of the lines, so the limit is 2 million cells on the grid: a full pass of about 3 s on a loaded laptop at worst, with the quick pass in a fifth of a second. A phone will be slower; item 507 times one.
A sight line of a quarter mile (401.6 m, 285 cells, on the field's diagonal, over what stands on it) takes 0.03 ms, run 300 times. A drag can rerun it on every move: the worker's round trip, not the line, sets the pace. sight.test.ts keeps it under 16 ms and the quarter-mile view's quick pass under a quarter of a second, to catch a slowdown of several times.
Ground past the edge
Plan v4 item 529: a view, a sight line and a day of sun read ground beyond the drawn area, out to a stated distance, from the project's terrain where it reaches and from a named coarser source beyond it.
The project's terrain reaches 100 m past the drawn area. The worker builds over the area grown by DEFAULT_BUFFER_M = 100 (services/gis-worker/gis_worker/terrain/aoi.py), over the box round that, with no height outside the grown area. So a hill within 100 m of the drawn area is built ground and every engine reads it as such.
Past that, out to 3 km, 10 m terrain from the USGS. The same service the quick look reads (quick-look-service.md), asked once per terrain for the whole box round the built ground grown by 3,000 m (HORIZON_DISTANCE_M in apps/web/src/lib/terrain/horizon.ts), at a Web Mercator cell of 9.55 map meters, a 512 px tile's cell at zoom 13, where the record found the service sends its 10 m ground (coarser, it sends 30 m). The answer is laid onto the project's own grid at 10 m cells, each taking the map cell under its middle. It is named on every card where an answer leaned on it: "10 m terrain from the USGS".
- Why 3 km. A ridge 50 m above a cell stops shading it once the sun is a degree up at
50 / tan 1° = 2,865 m; prairie relief past a field is seldom more. Past 3 km a sweep that hasn't cleared everything says it couldn't decide, never sun. Asked at 9.55 map meters, the box round a 160-acre field is about 1,000 cells a side, one request of a few hundred kilobytes, inside the service's largest image of 8,000; a township's is about 2,500. - Why a request in Web Mercator. Asked in the project's own system (
bboxSRandimageSR6344), the service gave a gateway timeout twice running on 2026-12-01, at 10.4 s each, where the same box in Web Mercator answered in 14.7 s with LERC 1, the form the quick look reads. So it asks as the quick look does and reprojects in the browser. - Politely. One request at a time from the page, three tries in all after 1 s and 4 s, nothing given up under 60 s, a failure known by its body as well as its status, and a try after a refused answer asked at a changed address (
horizon-fetch.ts, with the quick look's own constants). Each terrain asks once and keeps the answer while the page is open; the browser keeps the service's 12 hours. Browser tests never call the USGS: their stand-in,e2e/quick-look-tiles.mjs, answers a request larger than a quick-look tile only where a recorded tile covers, and with no height elsewhere, so the other fixtures read their own terrain alone, as before.
A kind of surface of its own, "horizon". Plan v4 decides that nothing kept, printed, measured over an area or checked against a limit reads the preview, and the code holds that by type (quick-look-surface.test.ts). Ground past the edge comes from the same service, so it is kept apart the same way: a HorizonGround has surface: "horizon", which nothing that takes built ground accepts, and only the engines' inputs for ground past the edge take it (outside in packages/surface/src/outside.ts, passed by the sight and sun tasks). requireBuiltGround refuses it wherever a value arrives untyped, the terrain worker takes no grid of that kind, and only the sight and sun modules import it. horizon-surface.test.ts tries each. It is never drawn as terrain, and no height a person reads as a figure comes from it: it only decides whether a line passes.
How each engine reads it. Only where the built ground has no height.
- Shade and a day of sun (
sweepShade): where the line toward the sun crosses a cell of the grid with no height, the block under that point; once it leaves the grid, the line goes on over the coarser ground, sampled every half of its cell (5 m), until it rises above the highest ground known (the grid's and the coarser ground's), meets a block above it (shade), or runs out of ground (undecided). Each result counts the cells whose sun or shade read it (outsideCells), and the key says "Detailed ground stops at the edge of the terrain that was built. Past it, out to 9,840 ft, 10 m terrain from the USGS." Sampling every 5 m can place the start of a shadow a sample late, never early: a shadow's edge from a block past the edge is right to within one cell beyond it. - A sight line (
sightLine): a cell the line crosses with no height reads the block under the cell's middle, as bare ground. The ends still stand on built ground, so an end past it still gives no answer. The parts read there come back (outsideParts), the first thing in the way says whether it stood there, and the card says "Detailed ground stops 420 ft along. Past it, 10 m terrain from the USGS." - A view (
viewFrom): a line crossing a cell with no height reads the block under its middle; a cell with no height is still given no answer of its own. The card says how many acres' lines read it.
A straight line between two points on a rectangle stays on it, so for a sight line or a view the coarser ground matters only across gaps inside the built box: the corners of the box outside the grown area, a notch in an area that isn't convex, or a gap in the lidar. The sun's lines leave the grid, and there it matters most.
A hill past the edge, worked by similar triangles
packages/surface/src/outside.test.ts, on built ground of 20 m by 20 m, flat at 0 m, from (0, 0) to (20, −20). Past its south edge a ridge 30 m high runs east and west, from 50 m to 60 m south of the edge, on 10 m cells. The point is the middle of the south row's middle cell, (10.5, −19.5): the ridge's near face is 50.5 m south of it.
- Shade at one time. The line toward a sun due south rises
tan eper meter and is lowest over the ridge at its near face, so the point is in shade while50.5 tan e < 30: underatan(30 / 50.5) = 30.71°. At 25° it is in shade, at 35° in sun. A point 69.5 m back stands in shade only underatan(30 / 69.5) = 23.35°, so at 25° it is in sun. At 27° the shadow reaches30 / tan 27° = 58.88 mnorth of the near face, to cell centres fromy = −11.12: rows 11 to 19. The engine shades rows 11 or 12 to 19 (a sample late at most). - A day. Fargo, 21 December 2026, the day in Central time, the grid on true north. The sun stays south of east and west all day (126° to 234°) and is 19.72° up at most (A wall of known height). Seen along the sun's direction A, the ridge's near face is
50.5 / −cos Aaway and standsatan(30 × −cos A / 50.5)high: 19.6° toward sunrise's direction and 30.7° at noon's, above the sun at every time. So the point gets no direct sun, and the engine gives 0 minutes, none undecided. - Without the ground past the edge. The same sweep sees only flat ground and says sun at 25°, and every minute of the December day's daylight: the wrong answer the ridge corrects. Told only that something 30 m high stands past the edge (
outsideCeilingM), it says it can't decide. - A view and a line across a gap. Ground 60 m by 20 m with no height from 25 to 35 m east, and past the edge a block 20 m high under the gap. From an eye 1.5 m up at x = 5.5, the line to the ground at x = 50.5 is
1.5 × (1 − 19.5 / 45) = 0.85 mup where it meets the block, under its 20 m: hidden, and a sight line along it is blocked 19.5 m along, 18.5 m above it, on ground past the edge. Without the ground past the edge both are undecided; over low ground past the edge, both see past the gap.
Tolerance. The shade cases exactly where the sun is well clear of a threshold (25° and 35° against 30.71°); a shadow's reach to within one 1 m cell late; the day exactly; the line's obstruction to 10⁻⁹ m.
Time zones
The engine works only in UTC. apps/web/src/lib/terrain/sun-time.ts turns a local date and time in a named IANA zone into the UTC instant and back, using the zone database the platform ships through Intl.DateTimeFormat with an explicit timeZone, never the machine's own zone (its test changes the machine's zone and gets the same answers). A time the clocks skip in spring is read as the same minutes after the jump and marked "skipped"; a time they pass twice in autumn gives the first and is marked "repeated". A local day is midnight to midnight, 23 or 25 hours long on the days the clocks change. The zone's short name comes back with each answer ("CDT", "CST") for the key.
Which zone a place lies in isn't worked out yet. It needs boundary data. The smallest citable source is @photostructure/tz-lookup (CC0-1.0, 88 KB unpacked, version 11.8.0 on npm on 2026-11-30), but it trades accuracy for size near zone boundaries, and the Mountain–Central line runs through western North Dakota and South Dakota, where a wrong guess shows times an hour off. geo-tz (MIT) is accurate but 74 MB unpacked. So the zone is an input the screens lane supplies: the browser's own zone as a starting point the user can change, or tz-lookup with the zone shown and changeable. The hours of sun depend on the zone only as far as the day itself does: a local day in another zone is a different 24 hours, so its hours differ by the minutes the length of daylight changes in a few hours, under 2 minutes in June at 47 N. The times and dates shown beside them follow the zone.
On the screen (item 498). The sun layer in the Layers panel starts from the browser's own zone, read once on the screen side with Intl.DateTimeFormat().resolvedOptions().timeZone (never inside the engine), where that is one of the United States' zones; otherwise it starts in the zone of the place's longitude by its 15 degree band, so that the dates and times beside the hours are the place's own. A pad's hours of sun start by the same rule (startingZone in apps/web/src/lib/terrain/sun-views.ts). It shows the zone by name beside the answer and in the key with its short name for that date ("Central time (CDT)"), and lets it be changed from the United States' zones in plain words. The date starts at today in that zone, read on the screen side and passed in. A time the clocks skip or pass twice is said under the slider. The zone is kept with the layer's settings (SunLayerSettings in apps/web/src/lib/terrain/sun-views.ts).
A day read in a zone far from the place
A local day in a zone east of the place's own begins before the place's evening has ended. Read in Eastern time, 21 June 2026 is 04:00 UTC on the 21st to 04:00 UTC on the 22nd. In Seattle (47.6062 N, 122.3321 W) the sun is still up when that day begins, sets, rises again, and is up when it ends: the day's light comes in two stretches. Until review H1 (2026-12-02) the engine took one stretch, from the day's rising to its setting; here the setting came first, and the day got no hours of sun at all, on the sun layer and on a pad's longest day alike. Each stretch is now counted.
The cases, worked from the U.S. Naval Observatory's one-day table, read on 2026-12-02 with tz=0 (times in UTC, to the minute, for the sun's upper edge with refraction):
| Place, Eastern day of 21 June 2026 | USNO events inside the day | Daylight, upper edge | Engine, sun's centre |
|---|---|---|---|
| Seattle, 47.6062 N, 122.3321 W | sets 04:11 on the 21st; rises 12:12; the next setting, 04:11 on the 22nd, falls after the day | 11 + 948 = 959 min | 955 min |
| Anchorage, 61.218 N, 149.9 W | sets 07:42; rises 12:20; up again at the day's end | 222 + 940 = 1,162 min | 1,154 min |
The engine counts the time the sun's centre, with refraction, is up, which is shorter than USNO's upper-edge day by the time the sun takes to sink a further 0.267 degrees at each of the two crossings inside the day: about 2 minutes each at Seattle, and 4 at Anchorage, where the sun crosses the horizon at a shallower angle. A count of the sun's centre minute by minute over the same 24 hours, with the same position function and no sunrise or sunset search, gives the engine's figure to the minute. In Pacific time the same Seattle day gives 955 minutes as well, and in Alaska time the Anchorage day 1,154: each pair of days is a few hours apart and the length of daylight barely changes at the solstice. day.test.ts holds all of these, a pad's cells against the whole grid, and the day worked one position at a time against one go, bit for bit.
Where the sun doesn't set at all (Utqiaġvik in June), the day is all day in any zone; where it doesn't rise, all night.
Speed
Timed in Node 26.5 on an Apple M5 laptop with 16 GB, in vitest, on the synthetic 160-acre field at 1 m (scripts/synthetic-160ac-cog.ts: 805 × 805 = 648,025 cells, 4.4 m of relief), on 2026-11-30. The machine was running several other lanes at the same time, with a load average of 31 to 46, so these are slower than an idle laptop would give.
| What | Quick pass (4 m cells) | Full pass (1 m) |
|---|---|---|
| Shade, sun 45 degrees up | 8 ms | 54 ms |
| Shade, sun 10 degrees up | 3 ms | 63 ms |
| Shade, sun 2 degrees up | 4 ms | 85 ms |
| Shade, sun 0.5 degrees up | 5 ms | 125 ms |
| A day, 21 June, 10-minute step | 239 ms | 5.8 s |
| A day, 21 June, 15-minute step | 190 ms | 3.2 s |
| A day, 21 June, 30-minute step | 84 ms | 1.9 s |
| A day, 21 December, 10-minute step | 173 ms | 4.0 s |
| A day, 21 December, 30-minute step | 63 ms | 1.1 s |
So shade at a time keeps up with a slider at 1 m, and the defaults (SUN_DEFAULTS in sun.ts) are: the quick pass at 4 m cells and, for a day, a 20-minute step (well under a quarter of a second); the full pass at the project's own cells and a 10-minute step. A day's full pass works on at most 700,000 cells, so a grid larger than 160 acres at 1 m is coarsened by a whole factor until it fits (fullDayFactor). A pad's four days trace only the pad's cells and take milliseconds. A phone will be slower; item 507 times one.
A day's pass in slices (2026-12-02). The terrain worker works a day of sun one sun position at a time (startSunHoursOverDay in packages/surface/src/sun/day.ts, through startTerrainTask and isSlicedTask), and reads its messages between positions. So when the date changes, the pass under way is dropped at the next position and the warm worker takes the new quick pass straight after. Each position is swept in the same order with the same arithmetic as in one go, so the hours are the same to the last digit: day.test.ts checks every cell bit for bit on the wall, a June day with a surface and grid north turned, a gap with no height, a pad's cells with ground past the edge, and a polar night. A sun at a time is one sweep and is worked in one go, as before. performance.md, "A day of sun's first picture", has why.
Sources
- NOAA Global Monitoring Laboratory, Solar Calculation Details and
NOAA_Solar_Calculations_day.ods, read 2026-11-30. The page says the calculator is no longer maintained and certifies nothing. - Jean Meeus, Astronomical Algorithms, 2nd ed., Willmann-Bell, 1998; chapter 27 for the equinoxes and solstices.
- I. Reda and A. Andreas, Solar Position Algorithm for Solar Radiation Applications, NREL/TP-560-34302, revised 2008, through pvlib-python 0.16.1 (
pvlib.solarposition.spa_pythonandtests/test_spa.py). The report itself couldn't be reached. - U.S. Naval Observatory, Astronomical Applications API: rise and set and seasons, read 2026-11-30.
- J. P. Snyder, Map Projections: A Working Manual, USGS Professional Paper 1395, 1987, for the meridian convergence.
- J. Amanatides and A. Woo, "A Fast Voxel Traversal Algorithm for Ray Tracing", Eurographics 1987.
- Esri, Using Viewshed and Observer Points for visibility analysis, ArcGIS Pro documentation, read 2026-11-30, for the correction for the earth's curve and the bending of light, its diameter of the earth and its coefficient of 0.13, and the observer's and target's default offsets.
- F. K. Brunner, 1984, Geodetic Refraction: Effects of Electromagnetic Wave Propagation Through the Atmosphere, Springer, Berlin: the source Esri names for the coefficient of 0.13.
- W. R. Franklin and C. Ray, 1994, "Higher isn't necessarily better: visibility algorithms and experiments", in Advances in GIS Research: Proceedings of the Sixth International Symposium on Spatial Data Handling, Edinburgh, starting on page 751, for the exact per-cell view test, R3. The paper itself wasn't read. Its authors, title, year, symposium and first page, and that R3 tests one line of sight to each cell against the grid lines it crosses while R2 and XDraw approximate it, were checked 2026-11-30 in H. Haverkort and L. Toma, "A Comparison of I/O-Efficient Algorithms for Visibility Computation on Massive Grid Terrains", arXiv:1810.01946, section 2 and its references. That entry gives the pages as 751 to 763; another citing paper gives 751 to 770 and the volume's title above, so the last page is unconfirmed.
- 15 U.S.C. 260a, for when daylight saving begins and ends in the tests.