Skip to content

[Bug]: A mobile map package and a layout's globe locator simplify geometry without saying what they leave or move #1811

Closed

Description

@flight1973

Before you start

  • I searched the existing issues and did not find a duplicate.
  • This is a bug report, not a usage question.

What happened?

Two commands simplify geometry through rustgis_analysis::simplify_geometry and never say what that did to it:

  • map.package with "mobile": true (crates/engine/src/cmd/items.rs, package_map) simplifies every vector layer's geometry before packaging it.
  • A layout's globe locator (crates/engine/src/cmd/layout.rs) simplifies the polygons it draws on the disc.

Neither reports anything Simplify itself reports (or, with #1808, will report): a latitude past ±90° moved to the pole, a line or polygon left unsimplified because a coordinate is missing (NaN) or a longitude is too far out for the analysis plane, a line part of one vertex dropped, a feature too intricate to simplify whole within the work allowed. For the package, that changes the data people take into the field with no word about it.

Steps to reproduce

  1. Make a line layer with one vertex at latitude 95° (bad data, but files have it), for example a GeoJSON LineString [[0, 80], [1, 95], [2, 80]].
  2. Package the map for mobile:
    rustgis-cli run --data bad.geojson --cmd 'map.package={"path": "out.rgismpk", "mobile": true}'
  3. Reading the file warns "1 feature has a latitude past ±90°: longitude and latitude may be swapped", which is right. Then open the package's Map.rgismap: the vertex is at 90°. Packaging moved it to the pole and said nothing about that. A package without "mobile" keeps it at 95°, so it's the simplifying that moves it.

The same layer through the Simplify tool says "1 vertex(es) with a latitude past a pole found (taken as that pole)" (with #1808).

Expected behavior

The mobile package and the locator say what Simplify says, one notice per kind with a count, through Session::notify. A clean layer says nothing.

My plan would be to have simplify_geometry return what it left alone, as the tool's simplify_checked does in #1808, and have both callers report it. That waits for #1808.

How are you running RustGIS?

Command line (rustgis-cli)

Version

main at fbc5bab (rustgis-cli built from it).

Operating system, browser and graphics

macOS

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