Skip to content

[Feature]: QGIS projects in a geographic coordinate system open in Equirectangular, as QGIS draws them #883

Closed

Description

@pick2510

Before you start

What problem does this solve?

Piece 1 of #882. A QGIS project whose coordinate system is geographic opens in RustGIS in Web Mercator. The import adds the note "the project's coordinate system EPSG:4326 (EPSG:4326 is in degrees: pick a projected coordinate system), drawn in Web Mercator". Typical examples are EPSG:4326, ETRS89 (EPSG:4258) and NAD83 (EPSG:4269).

QGIS draws such a project as plate carrée, with longitude and latitude as x and y. That's 9 of the 27 real projects in the audit corpus (#881, the QGIS Training Manual's world.qgs, example.qgs and the processing exercises). In Web Mercator, high latitudes are stretched and the map doesn't look like the one the project was made in.

map.projection refuses a coordinate system in degrees on purpose (crates/map/src/projection.rs). RustGIS already has the projection QGIS uses here: the Equirectangular (Plate Carrée) preset (+proj=eqc), which lays longitude and latitude out on a regular grid the same way.

Proposed solution

In project.importQgis (crates/engine/src/cmd/qgis.rs), when the project's coordinate system is geographic, set the map to the equirectangular preset instead of falling back to Web Mercator:

  • An EPSG code whose PROJ definition is +proj=longlat counts as geographic.
  • The importer checks this itself rather than matching map.projection's error text.

No new command or dependency. map.projection keeps refusing degrees when a user picks one.

What it carries over:

  • The view: the project's extent (in degrees) converts to the map's coordinates as for any projection.
  • The shape: a plate carrée like QGIS's canvas.
  • A small approximation: the preset uses WGS 84, and a project on another geographic datum (ETRS89, NAD83) is drawn on WGS 84. That's sub-metre to a few metres, below what a map at these scales shows. Instead of the current Web Mercator note, the import says "drawn in Equirectangular (WGS 84)" only when the datum differs.
  • Scale ranges and reference scales: QGIS computes the scale of a degree-based canvas at the map's centre latitude. The test checks that the visibility ranges of world.qgs behave the same at a few zoom levels, and the pull request reports it.

Crates: rustgis-engine (the import); rustgis-map only if a helper to tell geographic codes apart belongs in projection.rs.

Tests:

  • An engine test in crates/engine/src/tests.rs: a project in EPSG:4326 opens with the Equirectangular projection and its extent, without the Web Mercator note; a project in EPSG:4258 opens the same way, with the datum note.
  • every_corpus_file_reads (test(map): a corpus of QGIS projects and styles the importer reads #881) is unchanged. Rendering the Training Manual's world.qgs beside QGIS shows the same layout of the world (screenshots in the pull request, not committed).

Estimated scope

Small: a minor tweak, small UI change, or text adjustment

Alternatives considered

  • Let map.projection accept geographic codes and draw them as plate carrée under their own name. Simpler for the importer, but it hides the choice from users who pick a projection, and the map's units would be degrees, which the camera and measurement code don't expect.
  • Keep Web Mercator and only reword the note. It's the current behaviour, and the map looks unlike QGIS's.

Activity

  1. added a commit that references this issue on Oct 25, 2026
    4a8d598
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