Draw the map's missing squares as gaps, and its rings in your own units
Two faults reported from in front of the window, both of them the map saying something confidently and wrongly. Tiles that did not arrive. Resizing the window does not refetch the map: the window deliberately fetches more world than it shows, so a resize still fits inside what is in hand and gets stretched to the new size. It refetches when the view leaves that box, which is what a new station does -- and that fetch asks a volunteer-funded server for a hundred tiles that have never been on this disk, all at once, at the sharper zoom the bigger window chose. Some of them are refused. What the window did with a refusal was draw it. A tile that never arrived leaves its square of the canvas black, and black is not a neutral colour here: the brightness is inverted on the way in, because a printed map is ink on paper and this picture is the other way round. So the darkest possible square came out as the brightest thing on the picture, a glowing rectangle where the map should be. Measured on a reproduction, one missing tile in eighteen put thirteen thousand pixels at full brightness -- and dragged the floor of the map's own contrast down to black with it, so thirteen thousand four hundred and ninety pixels changed in all: the whole map was redrawn dimmer to make room for a square that was not there. Then it was kept, cached under the view it was fetched for, until the view moved again. So the missing squares are asked for again at once, and only those, the rest being on the disk by then; what is still missing is drawn as bare ground and left out of the reckoning when the darkest and brightest of the map are worked out, which puts the same reproduction at two pixels changed rather than thirteen thousand four hundred and ninety, a hairline where a cell is averaged over part of a tile and part of nothing; and the map is kept as provisional rather than as the last word, asked for again half a minute later, four attempts in all, each retrying its own misses once. Found while measuring that: the politeness pause between requests was being paid on every tile, including the ones read straight back off the disk. Two hundred and twenty tiles at an eighth of a second is twenty-six seconds of sleeping to redraw a view that was entirely cached, and it would have made asking again for three missing squares cost the wait for the two hundred that were not. The constant's own comment already said it should only be paid on a tile that was not already there. Now it is. The APRS map's units. Setting imperial changed nothing at all about the window: the unit it measures in was hardcoded to kilometres, and that one value drives the ring labels and the scale along the bottom; and --radius was always read as kilometres, so the rings were not merely mislabelled, they were at the wrong distance from the flag. A ring is what a distance gets judged against by eye, and one labelled in a unit it was not drawn in is a wrong answer given confidently. The aircraft side has done this properly all along -- a radius read in whatever unit the speeds are in, and no unit suffix on the setting because the suffix belongs to the other setting -- so this now mirrors it exactly. At --radius 100 in imperial the outermost ring stands seventy- five statute miles from the flag and says so, where it used to stand seventy- five kilometres and say kilometres whatever you had asked for. Twenty-one new tests against sixteen deliberately broken builds. One survived, and removing what it broke was the right answer rather than strengthening a test: a check that the remembered request still matched the map in hand could not be made to fail, a request for a different view being taken up only after the slot it guards is already full. The tests do not trust the drawing to mark its own homework -- the one that matters walks north from the flag by each ring's radius and measures the great-circle distance with a haversine written in the test, then checks that against the printed label. Full suite 2685 passed. Built as 2026-09-21_03. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PsWPTweCT6pwxKngvVxcg
This commit is contained in:
parent
e05b66ec3d
commit
e203b3e581
11 changed files with 780 additions and 73 deletions
|
|
@ -1030,6 +1030,25 @@ the window wants. A drawing is capped at a couple of hundred tiles, which at
|
|||
3840 by 2160 is reached: there the zoom has stopped climbing and the map is
|
||||
enlarged after all, and a smaller radius buys the detail back.
|
||||
.PP
|
||||
Resizing the window is the demanding case: a wider picture picks a sharper
|
||||
zoom and a hundred tiles that have never been on this disk are asked for at
|
||||
once, whereupon a busy server refuses some of them. A tile that does not
|
||||
arrive leaves its square of the canvas black, and black is not neutral here
|
||||
\[em] the brightness is inverted on the way in, so the darkest possible square
|
||||
came out as the brightest thing on the picture, dragged the floor of the map's
|
||||
own contrast down with it, and stayed there for the life of the view. Instead
|
||||
the missing squares are asked for again at once, and only those, the rest
|
||||
being on the disk by then; whatever is still missing is drawn as bare ground
|
||||
and left out of the reckoning when the darkest and brightest of the map are
|
||||
worked out; and the map is kept as provisional rather than as the last word,
|
||||
asked for again half a minute later, four attempts in all, each retrying its
|
||||
own misses once, so a square gets eight chances before one that will not come
|
||||
is accepted as one that is not there.
|
||||
.PP
|
||||
The politeness pause between requests is paid only on a tile that had to be
|
||||
fetched. Paid on every tile, as it had been, it put twenty-six seconds of
|
||||
sleeping into redrawing a view whose tiles were all in hand.
|
||||
.PP
|
||||
.B \-\-no\-basemap
|
||||
draws the tracks on their own,
|
||||
.BI \-\-tiles " URL"
|
||||
|
|
@ -1713,6 +1732,20 @@ the range, and
|
|||
.B q
|
||||
to quit.
|
||||
.PP
|
||||
The window measures in whatever unit is being shown.
|
||||
.B \-\-units " imperial"
|
||||
puts statute miles round the rings, along the scale at the bottom and on
|
||||
.B \-\-radius
|
||||
itself;
|
||||
.B \-\-units " metric"
|
||||
puts kilometres on all three. The rings are drawn at the distance they are
|
||||
labelled \[em] the outermost at
|
||||
.B \-\-radius " 100"
|
||||
in imperial stands seventy-five statute miles from the flag, measured on the
|
||||
ground, rather than seventy-five kilometres with miles written beside it. A
|
||||
ring is what a distance gets judged against by eye, so one labelled in a unit
|
||||
it was not drawn in is a wrong answer given confidently.
|
||||
.PP
|
||||
.BI \-\-at " LAT,LON"
|
||||
puts the red flag on the map, centres the range rings and gives every station a
|
||||
distance and a bearing. Left unset, whatever the aircraft side was told is used
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue