Generalizations should not destroy coastline #26

Closed
opened 2026-08-01 20:52:53 +00:00 by map-issues-bot · 2 comments
Collaborator

Something that seems to only happen in Poland, going from z7 to z6 eats parts of the coastline. I would expect the coastline to get straighter when generalizing, but instead we get the sea flowing inland.


Location: z6 / 53.61912 / 16.64561
Area: circle r=17464 m @ 54.37540, 16.28263

{
 "features": [
  {
   "geometry": {
    "type": "Polygon",
    "coordinates": [
     [
      [
       16.55197194116784,
       54.375396932396484
      ],
      [
       16.550674978475982,
       54.39077435923579
      ],
      [
       16.54679658086012,
       54.406003693048476
      ],
      [
       16.54037409940945,
       54.420938267024724
      ],
      [
       16.53146938613122,
       54.43543425305308
      ],
      [
       16.520168198282118,
       54.44935204686377
      ],
      [
       16.506579372478978,
       54.462557612494166
      ],
      [
       16.4908337765427,
       54.474923773128346
      ],
      [
       16.473083049169567,
       54.48633143587937
      ],
      [
       16.453498139567717,
       54.49667073871889
      ],
      [
       16.43226766112282,
       54.50584210850852
      ],
      [
       16.40959607494805,
       54.5137572199436
      ],
      [
       16.385701720811827,
       54.520339846174174
      ],
      [
       16.360814714406466,
       54.52552659291122
      ],
      [
       16.335174731208273,
       54.52926750894828
      ],
      [
       16.309028698271682,
       54.53152656721893
      ],
      [
       16.282628416186753,
       54.53228201175711
      ],
      [
       16.256228134101825,
       54.53152656721893
      ],
      [
       16.230082101165234,
       54.52926750894828
      ],
      [
       16.20444211796704,
       54.52552659291122
      ],
      [
       16.17955511156168,
       54.520339846174174
      ],
      [
       16.15566075742546,
       54.5137572199436
      ],
      [
       16.13298917125069,
       54.50584210850852
      ],
      [
       16.11175869280579,
       54.49667073871889
      ],
      [
       16.09217378320394,
       54.48633143587937
      ],
      [
       16.074423055830806,
       54.474923773128346
      ],
      [
       16.05867745989453,
       54.462557612494166
      ],
      [
       16.04508863409139,
       54.44935204686377
      ],
      [
       16.033787446242286,
       54.43543425305308
      ],
      [
       16.024882732964056,
       54.420938267024724
      ],
      [
       16.018460251513385,
       54.406003693048476
      ],
      [
       16.014581853897525,
       54.39077435923579
      ],
      [
       16.013284891205668,
       54.375396932396484
      ],
      [
       16.014581853897525,
       54.360019505557176
      ],
      [
       16.018460251513385,
       54.34479017174449
      ],
      [
       16.024882732964056,
       54.329855597768244
      ],
      [
       16.033787446242286,
       54.315359611739886
      ],
      [
       16.04508863409139,
       54.301441817929195
      ],
      [
       16.05867745989453,
       54.2882362522988
      ],
      [
       16.074423055830806,
       54.27587009166462
      ],
      [
       16.09217378320394,
       54.264462428913596
      ],
      [
       16.11175869280579,
       54.25412312607408
      ],
      [
       16.13298917125069,
       54.24495175628445
      ],
      [
       16.15566075742546,
       54.23703664484937
      ],
      [
       16.17955511156168,
       54.230454018618794
      ],
      [
       16.20444211796704,
       54.22526727188175
      ],
      [
       16.230082101165234,
       54.22152635584469
      ],
      [
       16.256228134101825,
       54.219267297574035
      ],
      [
       16.282628416186753,
       54.21851185303586
      ],
      [
       16.309028698271682,
       54.219267297574035
      ],
      [
       16.335174731208273,
       54.22152635584469
      ],
      [
       16.360814714406466,
       54.22526727188175
      ],
      [
       16.385701720811827,
       54.230454018618794
      ],
      [
       16.40959607494805,
       54.23703664484937
      ],
      [
       16.43226766112282,
       54.24495175628445
      ],
      [
       16.453498139567717,
       54.25412312607408
      ],
      [
       16.473083049169567,
       54.264462428913596
      ],
      [
       16.4908337765427,
       54.27587009166462
      ],
      [
       16.506579372478978,
       54.2882362522988
      ],
      [
       16.520168198282118,
       54.301441817929195
      ],
      [
       16.53146938613122,
       54.315359611739886
      ],
      [
       16.54037409940945,
       54.329855597768244
      ],
      [
       16.54679658086012,
       54.34479017174449
      ],
      [
       16.550674978475982,
       54.360019505557176
      ],
      [
       16.55197194116784,
       54.375396932396484
      ]
     ]
    ]
   },
   "properties": {
    "_kind": "selection-circle",
    "_radius_m": 17464
   },
   "type": "Feature"
  }
 ],
 "properties": {
  "lat": 53.61912,
  "lng": 16.645613,
  "map": "is",
  "zoom": 6.14
 },
 "type": "FeatureCollection"
}
Something that seems to only happen in Poland, going from z7 to z6 eats parts of the coastline. I would expect the coastline to get straighter when generalizing, but instead we get the sea flowing inland. --- **Location:** [z6 / 53.61912 / 16.64561](https://experiments.blahonga.org/?map=is#6.14/53.619/16.646) **Area:** circle r=17464 m @ 54.37540, 16.28263 ```map-report { "features": [ { "geometry": { "type": "Polygon", "coordinates": [ [ [ 16.55197194116784, 54.375396932396484 ], [ 16.550674978475982, 54.39077435923579 ], [ 16.54679658086012, 54.406003693048476 ], [ 16.54037409940945, 54.420938267024724 ], [ 16.53146938613122, 54.43543425305308 ], [ 16.520168198282118, 54.44935204686377 ], [ 16.506579372478978, 54.462557612494166 ], [ 16.4908337765427, 54.474923773128346 ], [ 16.473083049169567, 54.48633143587937 ], [ 16.453498139567717, 54.49667073871889 ], [ 16.43226766112282, 54.50584210850852 ], [ 16.40959607494805, 54.5137572199436 ], [ 16.385701720811827, 54.520339846174174 ], [ 16.360814714406466, 54.52552659291122 ], [ 16.335174731208273, 54.52926750894828 ], [ 16.309028698271682, 54.53152656721893 ], [ 16.282628416186753, 54.53228201175711 ], [ 16.256228134101825, 54.53152656721893 ], [ 16.230082101165234, 54.52926750894828 ], [ 16.20444211796704, 54.52552659291122 ], [ 16.17955511156168, 54.520339846174174 ], [ 16.15566075742546, 54.5137572199436 ], [ 16.13298917125069, 54.50584210850852 ], [ 16.11175869280579, 54.49667073871889 ], [ 16.09217378320394, 54.48633143587937 ], [ 16.074423055830806, 54.474923773128346 ], [ 16.05867745989453, 54.462557612494166 ], [ 16.04508863409139, 54.44935204686377 ], [ 16.033787446242286, 54.43543425305308 ], [ 16.024882732964056, 54.420938267024724 ], [ 16.018460251513385, 54.406003693048476 ], [ 16.014581853897525, 54.39077435923579 ], [ 16.013284891205668, 54.375396932396484 ], [ 16.014581853897525, 54.360019505557176 ], [ 16.018460251513385, 54.34479017174449 ], [ 16.024882732964056, 54.329855597768244 ], [ 16.033787446242286, 54.315359611739886 ], [ 16.04508863409139, 54.301441817929195 ], [ 16.05867745989453, 54.2882362522988 ], [ 16.074423055830806, 54.27587009166462 ], [ 16.09217378320394, 54.264462428913596 ], [ 16.11175869280579, 54.25412312607408 ], [ 16.13298917125069, 54.24495175628445 ], [ 16.15566075742546, 54.23703664484937 ], [ 16.17955511156168, 54.230454018618794 ], [ 16.20444211796704, 54.22526727188175 ], [ 16.230082101165234, 54.22152635584469 ], [ 16.256228134101825, 54.219267297574035 ], [ 16.282628416186753, 54.21851185303586 ], [ 16.309028698271682, 54.219267297574035 ], [ 16.335174731208273, 54.22152635584469 ], [ 16.360814714406466, 54.22526727188175 ], [ 16.385701720811827, 54.230454018618794 ], [ 16.40959607494805, 54.23703664484937 ], [ 16.43226766112282, 54.24495175628445 ], [ 16.453498139567717, 54.25412312607408 ], [ 16.473083049169567, 54.264462428913596 ], [ 16.4908337765427, 54.27587009166462 ], [ 16.506579372478978, 54.2882362522988 ], [ 16.520168198282118, 54.301441817929195 ], [ 16.53146938613122, 54.315359611739886 ], [ 16.54037409940945, 54.329855597768244 ], [ 16.54679658086012, 54.34479017174449 ], [ 16.550674978475982, 54.360019505557176 ], [ 16.55197194116784, 54.375396932396484 ] ] ] }, "properties": { "_kind": "selection-circle", "_radius_m": 17464 }, "type": "Feature" } ], "properties": { "lat": 53.61912, "lng": 16.645613, "map": "is", "zoom": 6.14 }, "type": "FeatureCollection" } ```
Owner

In fact, this happens to lakes too, a lake shouldn't grow by eating neighboring land.

In fact, this happens to lakes too, a lake shouldn't grow by eating neighboring land.
Collaborator

Fixed by absorb_boundary in commit 3ae69c3, and re-verified just now on top of the
#36 work
, which is the check that mattered: #36 adds min_width_pixels, and a thinness
test makes a narrow inlet an absorption candidate where an area test did not. Sweden's
archipelago is the hardest case for that and it did not move.

marine_water — the sea itself, at the zooms where the rollup still separates it from
inland water:

z12 z11 z10 change
Iceland 535 483 535 483 535 483 0.00%
Poland 72 652 72 658 72 679 +0.04%
Sweden 381 859 382 430 383 172 +0.34%

km². The sea does not flow inland; three levels of generalization move it by a third of a
percent at worst.

The lakes half of the report ("a lake shouldn't grow by eating neighboring land") is
answered by the same table from the other side. inland_water over the same three levels:
Iceland −0.06%, Sweden −5.05%, Poland −19.26%. Lakes shrink. That is small lakes with no
water neighbour absorbing into the land around them — the designed fallback, and ordinary
generalization rather than a moving shoreline.

The mechanism is a preference, not a prohibition, and that is deliberate: a rule that
could refuse to absorb would have to leave the polygon in place, pinning every islet in
every lake at every zoom. An island with nothing but lake around it still drops into the
lake; a coastal field with fields inland of it stays a field. Written up in
conf/common.yaml (the cover contract) and docs/performance.md.

Checked visually over CDP in real time at z5–z9 for all three countries: coastlines read as
coastlines, with no inland lobes.

Fixed by `absorb_boundary` in commit `3ae69c3`, and **re-verified just now on top of the #36 work**, which is the check that mattered: #36 adds `min_width_pixels`, and a thinness test makes a narrow inlet an absorption candidate where an area test did not. Sweden's archipelago is the hardest case for that and it did not move. `marine_water` — the sea itself, at the zooms where the rollup still separates it from inland water: | | z12 | z11 | z10 | change | |---|---:|---:|---:|---:| | Iceland | 535 483 | 535 483 | 535 483 | **0.00%** | | Poland | 72 652 | 72 658 | 72 679 | **+0.04%** | | Sweden | 381 859 | 382 430 | 383 172 | **+0.34%** | km². The sea does not flow inland; three levels of generalization move it by a third of a percent at worst. **The lakes half of the report** (*"a lake shouldn't grow by eating neighboring land"*) is answered by the same table from the other side. `inland_water` over the same three levels: Iceland −0.06%, Sweden −5.05%, Poland −19.26%. Lakes *shrink*. That is small lakes with no water neighbour absorbing into the land around them — the designed fallback, and ordinary generalization rather than a moving shoreline. The mechanism is a **preference, not a prohibition**, and that is deliberate: a rule that could refuse to absorb would have to leave the polygon in place, pinning every islet in every lake at every zoom. An island with nothing but lake around it still drops into the lake; a coastal field with fields inland of it stays a field. Written up in `conf/common.yaml` (the `cover` contract) and `docs/performance.md`. Checked visually over CDP in real time at z5–z9 for all three countries: coastlines read as coastlines, with no inland lobes.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
art/ismap#26
No description provided.