Lay of the Land
All methods

The USGS elevation service, measured for the quick look

Item 512 of docs/PLAN_V4.md, PR 60. Measured on 2026-11-30, between 00:12 and 01:16 UTC on December 1 (the evening of November 30 in the central US), from one Mac on a home connection served by CloudFront's Chicago region (ORD58). About 400 requests in all, one at a time with 1.5 s pauses except where concurrency was being measured.

scripts/measure-quick-look-service.mjs repeats every measurement here, one phase at a time (node scripts/measure-quick-look-service.mjs <phase> --out DIR). It calls the live services and is never run in CI. Each phase writes the raw answers to a JSON file. The recorded answers that tests may use are in apps/web/src/lib/terrain/fixtures/quick-look/.

Recommendation

The service can carry the quick look as a display, but a place nobody has looked at in the last 12 hours will not draw "at once": a cold tile took a median of 5.2 s, 10.4 s at the 90th percentile and 18 s at worst (59 s once). A tile someone else asked for in the last 12 hours comes from the CDN in about 150 ms. So build it this way. Ask for raw heights as LERC with compressionTolerance=0.01 (1 cm), the smallest raw form at 24 to 96 KB per tile. Decode them with lerc@3.0.0, already in the lockfile, in the terrain worker. Use 512 px tiles with a one-pixel border, because time per request barely depends on size. Draw the quick look from map zoom 13 and fetch nothing finer than the zoom-16 pixel size: below 13 the service sends 30 m and 150 m ground, and above 16 it has nothing finer to give. Keep 6 requests in flight per tab. Show one coarse request first so something appears within about 5 s. Retry a failed tile twice, after about 1 s and 4 s, with no timeout under 30 s. Recognize a failure by the body as well as the status, and step around a cached error with a changed query string. Keep the service's own 12-hour browser cache and don't lengthen it. One finding changes item 516. The USGS index cannot say what the quick look is showing. At two of the three test fields, the service sends older or coarser ground than the 1 m flight the index names: 10 m at Mankato and a 2008 3 m DEM at Fargo. The elevation service's own getSamples names the source, its dates and its cell size at the point or along the line, from the same origin as the tiles. None of PR 60's fallbacks is needed. If "at once" must mean under a second for an unvisited place, the first fallback fits: a cached copy served by this app.

The services and what they say of themselves

Elevation: https://elevation.nationalmap.gov/arcgis/rest/services/3DEPElevation/ImageServer. Index: https://index.nationalmap.gov/arcgis/rest/services/3DEPElevationIndex/MapServer. Both are ArcGIS Server 11.3 behind CloudFront and nginx. Read with ?f=pjson (phase meta).

Elevation service property Value
Description "based on multi-resolution USGS DEM sources", "reflects all 3DEP DEM data published as of November 23, 2026"
Copyright text "USGS National Map 3D Elevation Program (3DEP). November 24, 2026."
Pixel type, native cell F32, 1 m (pixelSizeX 0.99999999)
Largest image maxImageWidth and maxImageHeight 8,000. maxDownloadSizeLimit 2,048 (for downloads of source rasters, not exportImage)
Mosaic ByAttribute on field Best, ascending, operator First, default resampling bilinear. Allowed: ByAttribute, LockRaster, Seamline, None
Capabilities Image,Metadata,Catalog. exportTilesAllowed false, so there is no tile cache: every tile is rendered on request
Catalog fields Name, MinPS, MaxPS, LowPS, HighPS, Category, ProductName, Best, DEM_Type, Source, VerticalDatum, AcquisitionDate, pubdate, title, Resolution_X/Y, StartDate, EndDate, and others
Server-side renderings Hillshade Gray, Hillshade Multidirectional, Hillshade Elevation Tinted, Slope Map, Slope Degrees, Aspect, Contour 25, Contour Smoothed 25, Preset 2, 5 and 10 ft contour intervals

The index service's copyright text is "USGS TNM - 3D Elevation Program (3DEP). Data refreshed weekly." Its largest image is 4,096 px, maxRecordCount is 2,000, its capabilities are Map,Query,Data, and it answers JSON, GeoJSON and PBF. Its layers are a DEM product index (1 to 6), a source data index (7 to 11: lidar point cloud, IfSAR, DEM source), a topobathymetric index (12 to 16), and the same again as query layers 18 to 30. Layer 18 (1 m DEM) has only project, project_id, pub_date, product_link, metadata_link. Layer 24 (lidar point cloud) and layer 27 (DEM source) have the same fields as each other: lpc_update, sourcedem_update, workunit, workunit_id, project, project_id, collect_start, collect_end, ql, spec, p_method, dem_gsd_meters, horiz_crs, vert_crs, geoid, lpc_pub_date, lpc_category, lpc_reason, sourcedem_pub_date, sourcedem_category, sourcedem_reason, onemeter_category, onemeter_reason, seamless_category, seamless_reason, lpc_link, sourcedem_link, metadata_link, plus PubDateSearch on layer 24.

Terms and limits. Neither service states a rate limit, terms of use or uptime, and no answer carried a rate-limit or Retry-After header. The USGS's FAQ says map services and data from The National Map "are free and in the public domain" and that "there are no restrictions", and asks for the credit line "Map services and data available from U.S. Geological Survey, National Geospatial Program." Source: What are the terms of use/licensing for map services and data from The National Map?, read 2026-11-30. Other USGS services (water data, earthquakes) do block or throttle excessive use, so the app should stay polite.

Caching. Every exportImage answer carries Cache-Control: max-age=43200 (12 hours) and is cached by CloudFront under its full URL. That includes the error bodies described below. The service JSON, getSamples, identify, the catalog query and every index answer carry max-age=0,must-revalidate, so a browser keeps none of them.

Tiles: time, size and form

A tile here is 256 px a side plus a one-pixel border all round: 258 by 258 px over the Web Mercator tile grown by one pixel, as tiled-relief.ts reads its windows. Every request has this shape (phase tiles builds it with exportUrl):

https://elevation.nationalmap.gov/arcgis/rest/services/3DEPElevation/ImageServer/exportImage
  ?bbox=<xmin>,<ymin>,<xmax>,<ymax>   (EPSG:3857, the tile plus one pixel, 3 decimals)
  &bboxSR=3857&imageSR=3857&size=258,258&format=lerc&pixelType=F32
  &noDataInterpretation=esriNoDataMatchAny&interpolation=RSP_BilinearInterpolation
  &compressionTolerance=0.01&f=image

Places: the three test fields' centers, from the DEM extents in packages/layout/fixtures/real-test-fields/*.json: Fargo, ND (46.786014, -96.876768), Mankato, MN (44.126974, -93.984081) and Brookings, SD (44.337095, -96.823556). The fourth place, Chatham County, NC (35.8, -79.3), is a place without 1 m in the service: its catalog's finest item there is the 1/9 arc-second (3 m) North Carolina DEM from 2003. The index's 1 m layer has gaps elsewhere too, but at every other candidate tried the elevation service already held a 1 m item.

Forms (phase formats)

Fargo, at z12, z15 and z17, three different tiles per form and zoom, so each try was a fresh CDN miss. 63 requests.

Form (format= and extras) Raw heights? Bytes per tile Median, worst (ms) Failures
lerc, compressionTolerance=0.01 Yes, F32, error at most 0.01 m 23,448 to 67,193 10,157, 21,148 0 of 9
lerc, compressionTolerance=0.001 Yes, error at most 0.001 m 49,059 to 112,107 9,307, 15,723 1 of 9 (502)
lerc, default Yes, error at most 0.000075 m 79,385 to 115,913 10,086, 12,270 0 of 9
tiff with compression=LZ77 Yes, 32-bit float (SampleFormat 3) 163,383 to 252,269 9,638, 13,773 0 of 9
tiff Yes, 32-bit float, uncompressed 591,042 5,752, 8,087 0 of 9
bsq (also bip) Yes, bare F32 with no header 274,577 5,405, 13,959 0 of 9
png and the other picture forms No: an 8-bit stretch, not heights 12,463 to 22,127 6,612, 10,205 2 of 9 (502)

The form list is from the exportImage form: jpgpng, png, png8, png24, png32, jpg, bmp, gif, tiff, bip, bsq, lerc. Every raw form arrived as asked: 258 by 258 F32 cells, every cell valid. The service writes LERC version 1 (CntZImage, file version 11), not LERC 2. The header's maxZError is the tolerance asked for, and 0.000075 m when none is given. Time is set by the server, not by size: the forms are within noise of each other. So the smallest raw form wins. LERC at 0.01 m is a third the size of the default and far below the error a display or a reading to 0.1 ft (3 cm) can show.

Every zoom at every place (phase tiles)

LERC at 0.01 m. Three different tiles per place and zoom, each a CDN miss ("cold"), then the first again (a CDN hit, "warm"). 128 requests.

Place z10 z11 z12 z13 z14 z15 z16 z17
Fargo 6.0 / 7.2 4.3 / 4.9 4.7 / 13.4 2.7 / 13.3 3.8 / 4.9 4.2 / 4.9 4.8 / 6.7 5.7 / 8.2
Mankato 5.7 / 11.1 6.3 / 10.3 7.0 / 18.0 7.6 / 10.4 7.1 / 10.1 3.2 / 10.4 7.1 / 8.0 1.0 / 9.9
Brookings 7.8 / 10.1 7.1 / 8.6 5.2 / 10.5 5.1 / 7.9 5.8 / 10.9 4.2 / 4.8 3.9 / 5.8 9.4 / 11.3
Chatham 0.6 / 9.1 8.2 / 9.1 6.7 / 10.9 6.3 / 10.6 7.0 / 7.2 6.4 / 8.0 3.2 / 5.2 2.7 / 4.0

Cold median / worst, in seconds, from three tries each. Over all 94 good cold requests: median 5.2 s, 90th percentile 10.4 s, worst 18.0 s. Over all 32 warm requests: median 152 ms, 90th percentile 794 ms, worst 1.7 s. The very first request of the session, a cold LERC tile at Fargo z15, took 59 s and an LZ77 TIFF took 57 s, so the tail is long. Zoom doesn't matter.

Size per tile, cold (bytes): Fargo 23,906 (z17) to 69,282 (z10); Mankato 37,695 to 87,616; Brookings 28,226 to 86,741; Chatham 56,888 to 96,712. Rougher and coarser ground compresses less.

Failures: 2 of 128 here, one 504 after 10.3 s and one 502 after 0.35 s. Across every cold exportImage of the session, 9 of about 200 failed (4.5%): seven 502s, all within 3 s, and two 504s, each at 10.26 s. Requests that succeeded took up to 22 s, so the 504 at 10.26 s is a gateway giving up on some requests, not a limit on all of them.

Concurrency and size (phases burst and sizes)

Brookings z16, tiles not asked for before:

Asked for Wall time Per tile, median / worst Failures
6, one at a time 61.5 s 5.9 s / 22.1 s 0
6 at once 10.3 s 5.8 s / 10.3 s 1 (504)
12 at once 16.1 s 5.1 s / 16.1 s 1 (502)

Asking together did not slow each request. One test can't show where the service starts to queue, but at 12 it had not.

Bigger images at z16's pixel size, Mankato, cold, three each: a 514 px image (four tiles' worth) took 7.2, 12.5 and 16.2 s for 230 to 238 KB. A 1,026 px image (sixteen tiles' worth) took 5.6, 7.7 and 11.7 s for 648 to 849 KB. So a request costs about the same time whatever its size, and fewer, larger tiles fill a screen sooner.

Decoding with the decoder the app would ship (phases decode, browser)

pnpm-lock.yaml has lerc@3.0.0, brought in by geotiff@3.0.5 (a direct dependency of apps/web), which loads it only when it meets a LERC-compressed TIFF (geotiff/dist-module/compression/lerc.js). It is Esri's LERC JavaScript decoder. Its package.json says "license": "Apache-2.0", and both files carry the header "Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0". It is plain JavaScript with no dependencies, exporting one function, decode, as a UMD module. LercDecode.min.js is 43,001 bytes: 8,922 gzipped (gzip -9) and 8,078 with brotli. It reads LERC 1, the form the service sends, and LERC 2. Adding it to apps/web/package.json adds no package to the lockfile. The cost is about 9 KB compressed in whichever chunk imports it, which should be the terrain worker's.

It decodes the service's tiles in Node and in a browser's Web Worker. In Node, every LERC answer of the session decoded to 258 by 258 F32 cells with no mask holes: 0 decode errors in about 180 tiles. In headless Chromium (phase browser), a blank page on https://quick-look.invalid/ fetched a Mankato z15 tile, and a Web Worker built from LercDecode.min.js decoded it in 6 ms: 258 by 258, 292.43 to 304.62 m.

Decoded heights against the service's own answers. For five cells of a tile, the decoded value against getSamples at the tile's pixel size (the same sampling) and against identify at full resolution:

Tile Tile minus getSamples at tile pixel Tile minus identify (finest)
Fargo z17 -0.011 to +0.006 m -0.011 to +0.019 m
Fargo z14 -0.047 to +0.018 m -0.014 to +0.002 m (one identify failed)
Mankato z16 -0.069 to +0.040 m -0.020 to +0.055 m
Chatham z15 -0.100 to +0.091 m -0.220 to +0.061 m

Requests: getSamples with a multipoint geometry, pixelSize the tile's cell, interpolation=RSP_BilinearInterpolation, returnFirstValueOnly=true; identify with a point and returnCatalogItems=true. Heights agree to a centimeter where the ground is flat and the sampling is the same. The larger differences are on rough ground (Chatham's corner cell, Mankato's slopes), where two bilinear samplings of the same coarse source land differently. They are not decoding errors: the decoder reproduces the values the service computed.

Seams. In the recorded fixtures, a tile's border column or row and its neighbor's first interior column or row are the same ground. They agree to a mean of 1.7 to 6.5 mm and at most 19 mm, which is two LERC tolerances. That holds for the z14, z15 and z16 pairs and for both an east and a south neighbor.

What resolution the heights really have (phases resolution, versusBuilt)

The service is a mosaic of 1 m project DEMs, 1/9, 1/3 and 1 arc-second DEMs, and its own overviews from 150 m upward. A tile names none of them. Two lookups do. The catalog query at a point lists every item under it, with MinPS, MaxPS (the pixel sizes, in map meters, over which an item is used), LowPS (its cell) and Best. getSamples with pixelSize set to a tile's cell says which item the service actually sampled, in resolution (degrees or meters) and in the item's attributes (title, StartDate, EndDate, LowPS, AcquisitionDate).

getSamples at each zoom's cell, at each place's center:

Zoom Cell, map m Cell, ground m at 44° / 47° Fargo Mankato Brookings Chatham
10 152.9 110 / 105 150 m overview 150 m overview 150 m overview 150 m overview
11 76.4 55 / 52 1 arc-sec (30 m) 1 arc-sec 1 arc-sec 1 arc-sec
12 38.2 27 / 26 1 arc-sec 1 arc-sec 1 arc-sec 1 arc-sec
13 19.1 14 / 13 1/3 arc-sec (10 m) 1/3 arc-sec 1/3 arc-sec 1/3 arc-sec
14 9.55 6.9 / 6.5 1/3 arc-sec 1/3 arc-sec 1/3 arc-sec 1/3 arc-sec
15 4.78 3.4 / 3.3 1/9 arc-sec (3 m), 2008 Red River 1/3 arc-sec 1/9 arc-sec, 2012 Brookings Co. 1/9 arc-sec, 2003 NC
16 2.39 1.7 / 1.6 1/9 arc-sec, 2008 1/3 arc-sec 1 m, SD_EasternSD_2020_B20 1/9 arc-sec, 2003
17 1.19 0.86 / 0.82 1/9 arc-sec, 2008 1/3 arc-sec 1 m, SD_EasternSD_2020_B20 1/9 arc-sec, 2003

What the catalog holds at each center (where=Category=1, ordered by Best): Fargo has the 1 m MN_RedRiver_D23 (Best 9,948, used up to 10 map-m pixels), 1/3 and 1 arc-second, and the 2008 1/9 arc-second. Mankato has no 1 m item at all: only 1/3 and 1 arc-second and a 2010 1/9 arc-second. That holds although the index lists MN_RiverEast_B23 (QL 1, 0.5 m DEM) there and the app builds from its 1 m DEM. Brookings has 1/3 and 1 arc-second, the 1 m SD_EasternSD_2020_B20 (Best 49,245) and two 1/9 arc-second DEMs. Chatham has 1/3 and 1 arc-second and the 2003 1/9 arc-second. The flight the app builds Fargo from, ND_3DEPProcessing_D22, isn't in the service's catalog at that point.

Two things follow:

  • The service doesn't take the first item by Best. At Brookings, the 1/3 arc-second has a lower Best than the 1 m, yet z16 samples the 1 m and z15 samples a 1/9 arc-second. What it was seen to do is take the item whose cell is nearest the cell asked for, among those whose MinPS–MaxPS range allows it. At Fargo z16 the 1 m item is present, yet the field center samples the 2008 DEM. Along a line east from the field (below), the same 1 m item appears 3 km away. So the 1 m tile there has no data under the field, and the next source fills in. Rather than predict the mosaic, ask getSamples.
  • A 1 m source first reaches a tile at z16, where the tile's 1.7 m ground cell is coarser than the 1 m source. At z17 the 0.85 m cell is a little finer than the source, so z17 adds no ground detail. At z13 and z14 every place gets 10 m ground, and at z15 3 m where a 1/9 arc-second exists. Where there is no 1 m, the ground is 3 m at best: Chatham is 1/9 arc-second (3.4 m cells, a 2003 flight) from z15. Mankato is 10 m at every zoom, which is effectively a place without 1 m today, though the lidar exists.

Against built ground (phase versusBuilt). The tile at each test field's center at z14 to z17, against the field's own built ground: the 3 m average of the USGS 1 m DEM in the fixtures, read bilinearly at each tile cell. The table gives tile minus built, in meters, over every cell inside the built extent:

Field Zoom Cells Built relief Mean RMSE 95% abs Largest
Fargo 14 6,202 1.33 -0.029 0.065 0.080 0.569
Fargo 15 24,794 1.36 -0.028 0.057 0.082 0.451
Fargo 16 65,536 0.66 -0.026 0.037 0.067 0.207
Fargo 17 65,536 0.63 -0.020 0.034 0.066 0.153
Mankato 14 15,981 11.13 -0.004 0.157 0.317 1.351
Mankato 15 28,142 10.39 +0.029 0.145 0.287 1.663
Mankato 16 65,536 7.00 -0.004 0.139 0.298 0.702
Mankato 17 65,536 6.86 +0.082 0.135 0.296 0.391
Brookings 14 13,454 5.75 -0.038 0.059 0.101 0.418
Brookings 15 31,960 4.08 -0.043 0.068 0.122 0.558
Brookings 16 65,536 3.58 +0.004 0.015 0.029 0.087
Brookings 17 65,536 1.39 -0.003 0.013 0.026 0.074

This agrees with getSamples. Brookings at z16 and z17 is the built flight to 1.5 cm. Fargo is another source: a steady 2 to 3 cm low and never better than 3.4 cm, on very flat ground. Mankato is 10 m ground: 14 cm RMSE and up to 1.7 m off on its slopes. This is one tile per field and zoom, so it is a first look at the comparison PR 60's "Done when" asks for, not that comparison.

The index (phase index)

At a point, layer 24 (/MapServer/24/query, geometryType=esriGeometryPoint, inSR=4326, spatialRel=esriSpatialRelIntersects, returnGeometry=false, f=json) lists every lidar project whose outline covers the point, old ones included. Read at 00:20 UTC with outFields=project,workunit,ql,dem_gsd_meters,collect_start,collect_end,onemeter_category,seamless_category:

Place Projects (QL, DEM cell, 1 m category)
Fargo ND_FARGO_2005_Legacy_Data (Other, 3 m, does not meet); IWI_REDRIVER_C_2008_Legacy_Data (Other, 3 m, does not meet); ND_3DEPProcessing_D22 (QL 2, 1 m, meets; collected 2019-05-26 to 2021-04-01)
Mankato MN_BlueEarth_2011_Legacy_Data (QL 3, 3 m, does not meet); MN_RiverEast_B23 (QL 1, 0.5 m, meets; 2023-04-13 to 2024-04-14)
Brookings SD_BROOKINGS_2012_Legacy_Data (Other, 3 m, does not meet); SD_EasternSD_2020_B20 (QL 2, 1 m, meets; 2020-04-18 to 2020-05-14)
Nebraska, 40.3, -100.3 NE_RAINWATER_2_2009_Legacy_Data (Other, 3 m); NE_NRCS_OrthoLidar_2017_D18 (QL 2, 1 m, meets), though layer 18 had no 1 m DEM there yet

Dates come as epoch milliseconds. A point usually has two or three projects. The answer has no order that says which is in use, and it does not say what the elevation service is sending: at Fargo and Mankato it names a 1 m flight the service doesn't use. One point query took 0.3 to 0.7 s, against 2.5 s median for getSamples at a point and 3.1 s median for identify (19 s at worst).

The index stopped answering queries. From no later than 01:02 UTC to at least 01:22 UTC (it had answered at about 00:30), every spatial or attribute query on layers 8, 18 and 24 answered HTTP 200 with {"error":{"code":400,"message":"Failed to execute query.","details":[]}}. That included the exact query that had worked at 00:20. A count with where=1=1 still worked. During the same window, MapServer/identify at Brookings answered {"results":[]}, which says "nothing here" where there is a project. So the quick look must treat both an error object and an empty identify as "Flight date unavailable", never as "no lidar". The planned index answers along a line and at a place with nothing were not recorded for this reason. node scripts/measure-quick-look-service.mjs fixtures --skip-tiles records them once the index answers again.

Along a line crossing two flights, the elevation service answered when the index couldn't. getSamples with a polyline from the Fargo field east to -96.70 (about 13 km, crossing the Red River), sampleCount=40 and z16's cell, returned 39 samples in 7.8 s, with gaps at samples 11 and 24. Samples 0 to 10, over the field, came from ned19_n47x00_w097x00_mn_nd_redriver_abc_2008 (1/9 arc-second, flown 2008-04-18 to 2008-05-20). Samples 12 to 23 came from USGS 1 Meter 14 x66y519 MN_RedRiver_D23, and 25 to 40 from the neighboring 1 m tile x67y519 (flown 2024-03-18 to 2024-05-19). That names both sources, their dates and their cells, which is what item 516's line needs, from the same origin as the tiles. It is recorded as samples-line-fargo-16.json.

Where there is no project, the planned point is open water in the Gulf of Maine (43.0, -68.5); its answer is to be recorded as above. The lower 48 have almost no land without a lidar project now. At every inland gap in the index's 1 m layer that was tried, layer 24 still had a project.

What a browser sees (phases errors, browser)

Both services send Access-Control-Allow-Origin: * on every answer that comes from ArcGIS. That includes its errors, which arrive as HTTP 200 with a JSON body:

Request Status Body Cache
exportImage?bbox=not,a,box&...&f=image 200 {"error":{"code":400,...,"message":"Invalid or missing input parameters.",...}}, Content-Type: application/octet-stream max-age=43200, CDN hit on repeat (Age: 145)
exportImage at size=9000,9000 200 the same, "The requested image exceeds the size limit." (12.2 s to say so) max-age=43200
NoSuchService/ImageServer?f=json 200 {"error":{"code":404,"message":"Service NoSuchService/ImageServer not found "}} none
exportTile?f=json (no such operation) 200 the service description, as if no operation were named max-age=0
index 24/query?geometry=nonsense 200 {"error":{"code":400,"message":"Failed to execute query."}} max-age=0
index 99/query (no such layer) 200 {"error":{"code":400,"message":"Invalid or missing input parameters."}} max-age=0
a good tile when the origin fails 502 or 504 nginx's HTML error page, X-Cache: Error from cloudfront, no Access-Control-Allow-Origin none

In headless Chromium, from a blank page on an https origin, plain fetch (no credentials, no extra headers, so no preflight) got: the tile as type: "cors", status 200, 55,868 bytes in 339 ms (a CDN hit, from an earlier phase), and 75 ms again from the browser's cache. The index answer came back ok: true with the 72-byte error object, because the outage was on. The malformed and oversized exports came back ok: true, status 200, with the JSON error as the body. A 502 or 504 wasn't caught in the browser in the few requests allowed, but the headers above settle it. With no Access-Control-Allow-Origin, fetch rejects with a TypeError and the page can't read the status. So the quick look sees three kinds of failure: a rejected fetch (a 502 or 504, retry it), a 200 whose body starts with { rather than CntZImage (an error, which the CDN may hold for 12 hours, so retry once with a changed query string such as &retry=1), and a 200 index answer with error or an empty results (flight unknown).

How many requests a session makes

The default window of 1,280 by 800 leaves a map of roughly 900 by 750 CSS px beside the panel. A phone leaves roughly 390 by 600.

View 256 px tiles in view 512 px tiles in view
Laptop 16 to 25, about 20 4 to 9, about 6
Phone 6 to 12, about 9 2 to 6, about 4

Fetching at device pixels (a 2x screen) would make that four times as many, for no more ground detail past z16. Fetch at CSS pixels. A visit to one place usually means arriving, zooming from about 13 to 16 and panning a few times. On a laptop that is about 100 tiles of 256 px or about 35 of 512 px. A session with two or three places is 200 to 300 of 256 px, or 70 to 100 of 512 px. With 6 in flight and 5 to 10 s each, a first laptop view of 6 to 9 tiles of 512 px fills in 10 to 20 s, and in about 5 s on revisits within 12 hours. "A few at a time" should be 6. Measured concurrency of 12 did no harm, but this is a free public service, and 6 already makes most views take one or two rounds.

Counted from the app's scheduler (item 522)

Once the quick look was built, its tile scheduler (apps/web/src/lib/terrain/quick-look-scheduler.ts) was driven through an ordinary visit by quick-look-scheduler.test.ts, "counts the requests an ordinary session makes": open the Mankato field at map zoom 14, pan east twice by half the map's width, then zoom in once to 15. Every tile answered at once, so this counts requests, not time. The map sizes are the ones above: 900 by 750 CSS px for a laptop, 390 by 600 for a phone.

Step Laptop, new requests Phone, new requests
Open the place 10 7
Pan half a width 3 0
Pan half a width 3 0
Zoom in to 15 6 4
Whole visit 22 11

Opening a place asks for one coarse tile first (level 12 here, two levels coarser than the view's own) and then the view's tiles from the middle out: 9 on a laptop and 6 on a phone. The coarse tile is dropped once a finer tile covers the middle. A tile already loaded is never asked for again in the session (32 are kept), and the browser keeps every answer for the service's own 12 hours. That is fewer than the estimate above of about 35 for a visit, because the estimate allowed more panning. It is the shape the record asked for: what is on screen, six at a time, at CSS pixels, nothing finer than level 15, dropped when the view moves on.

What the app does when a request fails, as built (item 521): a rejected fetch (a 502 or 504 with no cross-origin header) or an HTTP error status is tried again after 1 s and then 4 s at the same address; an HTTP 200 whose body is the service's JSON error is tried again at an address with &retry=1, then &retry=2, so the CDN's cached error is stepped around; a request unanswered after 60 s is given up and tried again the same way; a tile whose every cell has no height is "nothing here" and isn't asked for again. After three tries the map key says "The terrain preview isn't available here. You can still outline the area." Offline, nothing is asked for, the key says the connection is lost, and requests in flight go back in the queue without counting a try. quick-look-scheduler.test.ts forces each case.

How close a preview height is to built ground (item 519, PR 60's "Done when")

PR 60 asks that a height read from the quick look and one read from built ground at the same points differ by no more than a stated tolerance, at the zoom and in the form the quick look really uses. The tolerance is a function of the cell of the source the service sampled there, which getSamples names (previewTolerance in apps/web/src/lib/terrain/quick-look-swap.ts):

  • RMSE at most 2.5 cm for each meter of source cell, and
  • 95th percentile of the absolute difference at most 5 cm for each meter of source cell.

So 2.5 cm and 5 cm where the service sends a 1 m flight, 7.5 cm and 15 cm on 3 m ground, and 25 cm and 50 cm on 10 m ground. Why that shape. A height resampled from a coarser source is off by about the ground's slope times half a source cell, since the source holds one height across its cell and the bilinear step between cells cuts across any bend. A 5% slope over half a meter is 2.5 cm, so the RMSE allowed is what a 5% slope gives, and the 95th percentile twice that, for the steeper stretches. Single points are not bounded: on Mankato's slopes one cell was 1.8 m off, which is what 10 m ground does to a bank, and a bound that held it would hold nothing on flat ground. A reading says the cell size of its ground for this reason.

The evidence. Every figure under "Against built ground" above is inside it, with the source getSamples named at each zoom (Fargo 10 m at z14 and 3 m from z15; Brookings 10 m, 3 m, then 1 m from z16; Mankato 10 m throughout). quick-look-swap.test.ts holds those twelve rows against the tolerance. And quick-look-versus-built.test.ts repeats the comparison in the form the app really uses, on the recorded Mankato tiles: each tile decoded by decodeQuickLookTile into the tile store and read with heightAt at the tile level the view asks for, as the status line reads it, against the field's own DEM in packages/layout/fixtures/real-test-fields/mankato-mn.dem.bin (the USGS 1 m DEM averaged to 3 m) read bilinearly at the same points through proj4 into its UTM grid. Tile minus built, in meters, over every cell inside the field:

Level Tiles Cells Mean RMSE 95% abs Largest Allowed RMSE / 95%
14 2 15,981 -0.004 0.157 0.317 1.351 0.25 / 0.50
15 4 28,142 +0.029 0.145 0.287 1.663 0.25 / 0.50
16 2 111,930 +0.029 0.145 0.291 1.801 0.25 / 0.50

These agree with the measurement's own figures at z14 and z15 to the millimeter; at z16 the test reads both recorded tiles, the measurement one. The test also shows the tolerance has teeth: Mankato's 10 m ground judged as if it were 1 m fails it. What the repo can't test. Only Mankato's tiles are recorded, so Fargo and Brookings rest on the one measurement above, made against the live service on 2026-11-30. Recording a tile at each would let the test cover all three; node scripts/measure-quick-look-service.mjs fixtures records tiles, and the file list in its fixtures phase would need those two added.

When a profile shows both falls (item 519)

When built ground lands under a quick profile on screen, the profile is read again from the original DEM (it becomes a built profile, read by sampleProfile from the built terrain's reader) and says "Updated from detailed terrain." once. It gives both falls, the preview's and built ground's, only where the fall moved by more than the built terrain's stated accuracy (profileUpdate in apps/web/src/lib/terrain/profile-update.ts).

A fall is a difference of two heights, the start's less the end's. The terrain's stated accuracy is a vertical RMSE for one height, σ (verticalRmseFromProvenance, from the USGS Lidar Base Specification's table for the flight's quality level: 10 cm for QL1 and QL2). Two heights each carrying an independent error of σ give their difference an error of σ√2, since the variances of independent errors add (the ordinary propagation of independent errors to a difference). The stated σ is a per-point figure: the USGS specification and the ASPRS Positional Accuracy Standards for Digital Geospatial Data (2014), which it follows, both state vertical accuracy as an RMSE of single heights against checkpoints. So a fall can't be told apart from another closer than about σ√2 on that terrain: 14 cm, 0.46 ft, on QL2 ground. A change in the fall smaller than that is within what built ground can itself resolve, and the new figure alone is shown; a larger change shows both. Treating the two ends as independent is the cautious side: nearby lidar heights share some error, which makes a fall's error smaller than σ√2, and the tolerance larger than the true one, so it can only hide a change that is real by less than the terrain's own stated accuracy. quick-look-swap.test.ts tests a change of 0.4 ft (inside, new figure alone) and of 0.5 ft (outside, both) on QL2 ground.

A terrain that states no accuracy (no quality level recorded, or recorded as below the USGS specification) gives both falls wherever they differ at the tenth of a foot a profile shows. With no stated accuracy the app can't call any change small, and showing the new figure alone would claim an accuracy nobody stated. A change below a tenth of a foot shows as the same figure, so the note says only that it was updated.

The nightly check (item 523)

scripts/check-quick-look-live.mjs asks the live service for one tile and one getSamples answer at the Brookings field center, at level 16, in exactly the app's form (the tile's address comes from quickLookTileUrl itself, and a unit test holds the getSamples address equal to the app's samplesUrl). It fails if the tile isn't HTTP 200 with Access-Control-Allow-Origin: *, the LERC 1 header CntZImage and 514 by 514 heights that decode, or if getSamples isn't HTTP 200 with a samples list whose first entry has a numeric locationId, a value that is a number in a string, a numeric resolution and an attributes.title. .github/workflows/live-sources.yml runs it each morning as its quick-look job, beside the worker's live checks, and never on a pull request. The plan's line asked for "one index answer": the app no longer asks the index (PR 60's Comments), so the check asks getSamples, the answer the app reads. quick-look-live-check.test.ts tries the checks on the recorded answers. Its first run, by hand on 2026-11-30 at about 22:15 central time:

Tile 16/15141/23744 at Brookings: HTTP 200, 119,417 bytes, 17343 ms, header "CntZImage "
  decoded 514 by 514 cells, 495.50 to 499.11 m: form as expected
getSamples at Brookings, level 16's cell: HTTP 200, 15772 ms
  498.401458740 m from "USGS 1 Meter 14 x67y492 SD_EasternSD_2020_B20", LowPS 1, flown 20200410 to 20201222: form as expected

Both were cold: 17 s for the tile and 16 s for getSamples, inside the measurement's tail above.

Recorded answers

apps/web/src/lib/terrain/fixtures/quick-look/README.md lists each file, the request that made it and the date. In short: eight LERC tiles at Mankato (a 2 by 2 block at z15, and a pair at z14 and at z16), about 418 KB, with getSamples answers for three cells of a z15 tile and for the Fargo line, and the index's error answer. The index answers at a point, along a line and at a place with nothing are still to be recorded, after the index outage above.

What this doesn't settle

  • One evening, one connection, one CDN region. Daytime load, other regions and the long tail need more than the nightly check of item 523, which checks the answers' form, not their speed.
  • The 4.5% failure rate comes from about 200 cold requests.
  • Where the service starts to queue under concurrency was not found. It hadn't at 12.
  • The mosaic rule is what was seen at four places, not the USGS's statement of it. Ask getSamples, and don't predict the mosaic.
  • Why the service lacks MN_RiverEast_B23 and ND_3DEPProcessing_D22, though both are published, is a question for the USGS (tnm_help@usgs.gov). Because of it, the quick look and built ground will differ visibly at Mankato.