Skip to content

[Bug]: A GeoTIFF read in place across a 0–360° seam is drawn as two parts that don't see each other #3345

Backlog

Description

@elpidioassinaturas

What happens

Since #1109, a global grid stored from 0 to 360° and seen across its seam is read in two strips when it is read in place and zoomed in past its overview: draw_in_place in crates/render/src/raster.rs reads want.cols and want.cols2. Each strip is then drawn as a raster of its own. A part has no whole turn (full_turn_width is None for it), so a cell at a strip's edge sees nothing past the seam.

Anything that reads a cell's neighbours shows a line there that the same view of the file read whole doesn't have:

The line follows the seam, so it moves with the map when it is dragged.

Found in the review of #3342, which reads the view with flat ground's neighbourhood around it but leaves the seam as it was.

Steps

  1. Add a global DEM stored 0–360° as a cloud-optimised GeoTIFF by its address (read in place).
  2. Style it as a Shaded Relief, with "flats": {"amount": 1, "size": 6} to see it best.
  3. Zoom in past its overview on 0° longitude, so the seam is in view.

Expected

The view across the seam is drawn as the file read whole draws it: each strip reads the other's columns as its neighbours.

Actual

A line along the seam: one cell wide in the light, up to size cells with flat-area detail.

Proposed fix

Read each strip with the other strip's first columns as its margin (a strip ending at the last column reads the first pad columns past it, and the reverse), or join the two strips into one part before drawing it. A test needs a global option in rustgis_data::raster::cog::example (a grid from 0 to 360°). It would compare a view across the seam, read in place, with the middle of a wider view, as flat_ground_detail_read_in_place_has_no_step_at_the_views_edges does for the view's edges (#3342).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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