Bug report #10091

Oracle provider SRID management

Added by Médéric RIBREUX over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:Data Provider/Oracle
Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18559

Description

Hello,

when you open a layer in Oracle Spatial, the first query grabs the list of the tables with their SRID. Then Qgis launch a query per layer to grab the geometry type and SRID also:

SELECT DISTINCT t."COLONNE_GEOMETRIQUE".SDO_GTYPE,t."COLONNE_GEOMETRIQUE".SDO_SRID
FROM (SELECT "GEOM" FROM "SCHEMA"."TABLE_A_INTERROGER" WHERE "COLONNE_GEOMETRIQUE" IS NOT NULL AND rownum<=100) t
WHERE NOT t."COLONNE_GEOMETRIQUE" IS NULL;

When this table specific query is launched, a layerProperty.srids.clear() is made (see src/provider/oracle/qgsoracleconn.cpp). Then the SRID is computed from the results of the query above.

When you have an empty layer, this query returns nothing and then the SRID of the layer is unknown even when it is well declared in USER_SDO_GEOM_METADATA (or ALL_SDO_GEOM_METADATA).

So, I believe that the layerProperty.srids.clear() function should only be launched when there are SRIDs returned by the query above. If no SRIDs are returned, just keep the one that has been returned for the complete tables list query. I think that the layerProperty.srids.clear() statement should be in the bloc code that get the srids (and the geometry). Otherwise it can perhaps be completly removed...

Associated revisions

Revision 3978bff4
Added by Jürgen Fischer over 10 years ago

oracle provider:
  • retrieve comment of materialized views (implements #10063)
  • use detected srid (fixes #10091)
  • initialize mUseEstimatedMetadata (fixes #10092)
  • also consider username in temporary saved credentials (fixes #10093)

History

#1 Updated by Jürgen Fischer over 10 years ago

  • Target version changed from Version 2.4 to Future Release - High Priority
  • Category set to Data Provider/Oracle

#2 Updated by Jürgen Fischer over 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF