Get only "SRID" CRS identifier (not authority+identifier) for GeoPackage layers #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While for PostgreSQL/PostGIS and MSSQL ST_SRID resp. STSrid are used to get a simple integer EPSG code:
qgis-discovery-plugin/Discovery/mssql_utils.py
Line 113 in f652251
qgis-discovery-plugin/Discovery/dbutils.py
Line 179 in f652251
For GeoPackage the layer's CRS's
authid()
is used, which is a full string with authority identifier and code (e.g. "EPSG:4326"):qgis-discovery-plugin/Discovery/gpkg_utils.py
Line 53 in f652251
This breaks the transformation in
select_result()
asQgsCoordinateReferenceSystem.fromEpsgId(foo)
is used, which takes only the integer identifier.qgis-discovery-plugin/Discovery/discoveryplugin.py
Line 383 in f652251
This PR simply strips "EPSG:" from the GeoPackage's auth ID. This won't work with non-EPSG CRSses but then I am not sure what would happen in PostGIS/MSSQL in those cases. It's an improvement for sure as it makes things work again.
Fixes follow-up comments in #95