Bug report #8333

DB Manager's "Import vector layer"'s SRID confirmation dialog has unclear purpose

Added by Aren Cambre almost 11 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:DB Manager
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:17121

Description

I just imported an OpenStreetMap SHP for Texas. In the DB Manager's Import Vector Layer dialog, I checked both Source SRID and Target SRID and entered 900913 and 3081, respectively. (900913 per http://wiki.openstreetmap.org/wiki/Mercator, and it is already in my spatial_ref_sys table.)

After pressing OK, one of those dialogs pops up where you are asked to enter an SRID.

Here's what's confusing: is it asking me to set the SRID of the source or the destination? And why is it even bothering to ask me this when I entered valid SRIDs?

History

#2 Updated by Aren Cambre almost 11 years ago

Don't know if this matters, but it appears the projection is in fact in 4326 despite what http://wiki.openstreetmap.org/wiki/Mercator says. The roads.prj file is identical to http://spatialreference.org/ref/epsg/4326/prj/.

#3 Updated by Giovanni Manghi almost 11 years ago

Aren Cambre wrote:

Don't know if this matters, but it appears the projection is in fact in 4326 despite what http://wiki.openstreetmap.org/wiki/Mercator says. The roads.prj file is identical to http://spatialreference.org/ref/epsg/4326/prj/.

The shapefiles from OSM are in WGS84, not in google mercator.

#4 Updated by Giovanni Manghi almost 11 years ago

  • Status changed from Open to Closed
  • Resolution set to invalid

Actually that "srid confirmation dialog" it seems that makes a lot of sense, in fact it shows when you choose an unknown (to qgis) SRID in the import vector layer dialog. In your case you are trying to use 900913, that does not exist anymore, as it has been replaced (as code) by 3857. But as I said, you should anyway choose WGS84 as input srid from your osm data.

#5 Updated by Aren Cambre almost 11 years ago

  • Resolution deleted (invalid)
  • Status changed from Closed to Reopened

The problem is it doesn't tell me which of the two SRIDs is unknown.

Both SRIDs I entered were known to my PostGIS: 3081 is obviously known, and the query at http://wiki.openstreetmap.org/wiki/Mercator#PostGIS_.2F_SQL to add 900913 failed with this because that SRID was already in the spatial_ref_sys table:

ERROR: duplicate key value violates unique constraint "spatial_ref_sys_pkey"
DETAIL: Key (srid)=(900913) already exists.

UPDATE: Sorry, just saw that you mentioned that the SRID is unknown to QGIS. That's fine, but the problem remains that the GUI does not tell me which of the two SRIDs it is asking me about.

#6 Updated by Giovanni Manghi almost 11 years ago

  • Operating System deleted (Windows 7 x64)
  • Status changed from Reopened to Feedback

Aren Cambre wrote:

UPDATE: Sorry, just saw that you mentioned that the SRID is unknown to QGIS. That's fine, but the problem remains that the GUI does not tell me which of the two SRIDs it is asking me about.

That's easy to understand, just enable one between source srid or target srid -> you will notice that the "srid confirmation dialog" will show only when the "source srid" is unknown to qgis. In this case the source srid will be applied also for the target srid.

If you enable just the target srid then if the srid is unknown to qgis then the original srid of the vector is applied (silently, and this is probably the real issue) for both the source and target srid.

If you agree to this description then the subject of this ticket should be rephrased. Not even sure if this can be considered a bug of the tool, maybe it would be just enough to add a not to the documentation.

#7 Updated by Aren Cambre almost 11 years ago

the "srid confirmation dialog" will show only when the "source srid" is unknown to qgis.

if the srid is unknown to qgis then the original srid of the vector is applied

The UI needs to explain both of these. That's why I filed as a bug: the UI is not informing the user of something that can be critical for the user to know.

#8 Updated by Paolo Cavallini almost 11 years ago

Please suggest text for popup

#9 Updated by Aren Cambre almost 11 years ago

If qgis does not recognize either value, it should simply indicate that and request that a new value be entered. It also should not fill in target SRID with source SRID if target SRID is not understood.

Suggested text: QGIS does not understand the source SRID. Please choose from this list.

(change source to target if the target SRID is not understood)

Note that I did not use "invalid". There appear to be valid SRIDs that QGIS does not understand, and QGIS not understanding something does not make it invalid.

#10 Updated by Paolo Cavallini over 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - High Priority

#11 Updated by Giovanni Manghi about 10 years ago

  • Status changed from Feedback to Open

#12 Updated by Giovanni Manghi about 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#13 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF