Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PostgreSQL provider] Retrieve CRS from spatial_ref_sys #43338

Merged
merged 2 commits into from
May 22, 2021

Commits on May 21, 2021

  1. [PostgreSQL provider] Retrieve CRS from spatial_ref_sys

    instead of relying on QgsCoordinateReferenceSystem::createFromPostgisSrid()
    which contrary to what its name suggest doesn't use postgis at all, but
    the QGIS CRS database.
    
    I detected the issue initially on a database where my spatial_ref_sys
    table had been emptied and a few entries where assigned with SRIDs in
    the EPSG range but with definitions that weren't the ones from EPSG.
    There is no guarantee that EPSG:XXXX gets a SRID of XXXX
    
    And the past implementation of the fallback case of QgsPostgresProvider::crs()
    only looked at proj4text instead of using the WKT from srtext.
    rouault committed May 21, 2021
    Configuration menu
    Copy the full SHA
    cd3fb36 View commit details
    Browse the repository at this point in the history
  2. Remove QgsCoordinateReferenceSystem::createFromPostgisSrid()

    This method was private and only used by the Postgres provider through
    friend class.
    rouault committed May 21, 2021
    Configuration menu
    Copy the full SHA
    f79be39 View commit details
    Browse the repository at this point in the history