Skip to content

Terrain water: a lake the water layer doesn't draw (definition query, or a project naming a streamed layer) still shapes the ground #2305

Closed

Description

@elpidioassinaturas

A definition query hides a lake, but the ground still holds it

terrain::water::polygons reads every row of the water layer (layer.dataset.features). The fill applies the layer's row eligibility (definition query; display filter and view distance go the same way in draw_chunk), but the water does not. A lake the layer no longer draws:

Steps (rustgis-cli, cop30_venda_nova.tif + lagos.geojson, 125 polygons):

rustgis-cli run --data cop30_venda_nova.tif --data lagos.geojson \
  --cmd 'raster.symbology={"layer":"cop30_venda_nova","type":"shadedRelief","azimuth":315,"altitude":45,"zFactor":1.5}' \
  --cmd 'layer.color={"layer":"lagos","color":"#1F5FA880"}' \
  --cmd 'layer.definitionQuery={"layer":"lagos","where":"AREA_HA < 17"}' \
  --cmd 'map.terrain={"layer":"cop30_venda_nova","exaggeration":2,"water":{"layer":"lagos","shore":0.6}}' \
  --cmd 'map.goToXY={"lon":-41.1492,"lat":-20.3019,"scale":12000}' \
  --cmd 'share.exportMap={"path":"definition_query.png","width":1600,"height":1000}'

The query hides the 17.4 ha reservoir. Its fill is gone, but its shape stays: lit flat with no relief texture, and outlined by the shore band.

A project naming a streamed layer as the water reads it from the view's sample

map.terrain refuses a layer read a view at a time ("'…' is read a view at a time: water needs a layer that holds all its polygons"). Reading a project doesn't apply that check. A .rgis whose view.terrain.water.layer names a streamed layer (a hand edit, another tool, or a newer writer) opens without a word. Its water then comes from the rows the view happens to hold.

Steps:

  1. Make a shapefile above STREAM_ABOVE (100,000 rows): the 125 lakes plus 300,000 tiny squares spread over the DEM. Adding it says "300125 features, read in place a view at a time".
  2. Save a project with terrain from the DEM (no water), then set maps[0].view.terrain.water = {"layer":"lagos_near","shore":0.6} in the file.
  3. Reference: the same data with layer.loadAll before map.terrain and saved (the layer is then kept whole in the project).
  4. Open each and export the whole DEM (map.goToXY scale 60,000, 3200 × 2000).

At 1:12,000 (about 7,000 rows in view) the two exports are identical pixel for pixel. With the whole DEM in view (all 300,125 rows, above VIEW_LIMIT 250,000), they differ in 157,396 pixels. In the streamed one the reservoir, which fell outside the view's sample, keeps its fill but is not flat, not lit flat, and has no band. In the reference it has all three. Which lakes drop changes with the sample.

Not reachable through layer.repairSource: a small layer is kept in the project, and the command refuses it ("there's no file to repair").

Choices in this proposal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions