Bug report #561

raster's and vector's projection never recognized in "Prompt for projection" mode

Added by Redmine Admin almost 14 years ago. Updated over 11 years ago.

Status:Closed
Priority:Low
Assignee:Magnus Homann
Category:Projection Support
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10620

Description

QGIS fails to recognize a valid projection info in rasters and vectors and defaults to WGS84. Please see that the raster and vector in question do have a valid projection info:

$ gdalinfo tmp/lzn_32633.tif Driver: GTiff/GeoTIFF
Size is 720, 360
Coordinate System is:
PROJCS["WGS 84 / UTM zone 33N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235629972,
                AUTHORITY[[EPSG""7030]],
            AUTHORITY[[EPSG""6326]],
        PRIMEM[[Greenwich]],
        UNIT[[degree]],
        AUTHORITY[[EPSG""4326]],
    PROJECTION[[Transverse_Mercator]],
    PARAMETER[[latitude_of_origin]],
    PARAMETER[[central_meridian]],
    PARAMETER[[scale_factor]],
    PARAMETER[[false_easting]],
    PARAMETER[[false_northing]],
    UNIT["metre",1,
        AUTHORITY[[EPSG""9001]],
    AUTHORITY[[EPSG""32633]]

The problem is present with all the rasters and vectors I tried. An example GeoTIFF and shapefile are attached.

Using QGIS 0.8 SVN 6474, GDAL 1.4.0

Maciek

force_lrconnect_cl_onlycat139.tar.bz2 - shapefile (1.7 KB) Redmine Admin, 2007-01-31 10:35 AM

topo.tif - raster (33.1 KB) Redmine Admin, 2007-01-31 10:40 AM

ticket561.log.bz2 (12.1 KB) Redmine Admin, 2007-02-06 02:44 AM

ticket561_global.log.bz2 (11.7 KB) Redmine Admin, 2007-02-06 06:31 AM

History

#1 Updated by Magnus Homann almost 14 years ago

  • Status changed from Open to In Progress

Qgus can only handle projections that are defined in its database. Please define your own projection with the values above, and see if it works.

#2 Updated by Redmine Admin almost 14 years ago

Replying to [comment:2 homann]:

Qgus can only handle projections that are defined in its database. Please define your own
projection with the values above, and see if it works.

This projection is defined in QGIS database. It's the QGIS SRSID: 2267, ie. PostGIS/EPSG SRID: 32633.

This bug is valid for any GIS data I tried with any projection, defined or not in QGIS database. QGIS will not recognize the projection info of the raster or vector, and assign the defualt or the user specified projection, or ask for the projection - depending on the setting in Settings > Options > Projection.

BTW - I really think it is not a good idea to set latlong/WGS84 by default if projection unknown. Or any other. If the projection info is unknown, simply a non-projected XY with 0,0 in the lower left should be set.

Maciek

#3 Updated by Magnus Homann almost 14 years ago

  • Status changed from In Progress to Closed
  • Resolution set to worksforme

With 0.8 and 0.9 (trunk) I get the following result, which is QGIS SRSID 2267.

"+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"

#4 Updated by Redmine Admin almost 14 years ago

Replying to [comment:4 homann]:

With 0.8 and 0.9 (trunk) I get the following result, which is QGIS SRSID 2267.

"+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"e this

Hi,

That's cool. But I wonder why it doesn't for me. It always gives me:
"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"

I have this problem on 3 different machines with Ubuntu Dapper. QGIS and several other FOSS GIS packages built from source, including PROJ.4 and GDAL.

PROJ is 4.5 and GDAL is 1.4.0. What are yours? All my software built from source is installed in /usr/local. Could that matter? Where is yours? What elase could be the culprit (besides me, but I don't have any idea yet what I could be doing wrong here).

I'm not sure if closing the ticket by "worksforme" was the right thing. I guess this option should be left for hopeless cases without any feedback from the reporter, while I'm still here, having an issue.

Maciek

#5 Updated by Magnus Homann almost 14 years ago

I have proj 4.4.9 and gdal 1.3.1. Edgy eft standard installation I believe. It also works on my win32 machine with svn 0.8 (but 0.8.0 release crashes)

Update qgis to latest svn, compile with debug, and pipe the output to a file. Open qgis, open raster, check proj, close qgis. Attach the file, and I'll have a look.

(In bash)

$ qgis &> ticket561.log

I prefer to close ticket I can not do anything more about. Please re-open when new info arrives.

#6 Updated by Redmine Admin almost 14 years ago

  • Resolution deleted (worksforme)
  • Status changed from Closed to Feedback

Thanks for the instruction.

1. built QGIS 6540 with debug

2. run QGIS, set Settings->Options->Projection->Prompt for projection, exit

3. qgis --lang=en tmp/topo.tif &> ticket561.log

4. the "Layer Projection Selector" pops up - apparently the projection was not recognized

5. ll/WGS84 is suggested - I press OK, then I exit QGIS

The log is attached. Line 378 is when #3908 takes place. It reads:

Item selected full string : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

Which doesn't match the raster's projection. However, in at least 4 lines before this, a correct string:

+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

is present. As I can see, in line 354 a correct QGIS srsid 2267 is returned. What happens next I don't understand, but for some reason this correct choice is dropped in favor of 2585.

Maciek

#7 Updated by Magnus Homann almost 14 years ago

Thanks! Using Prompt for projection, qgis crashes for me (which I'll look into). Can you repeat with using 'Global' setting? It might be two different errors, or it might not.

#8 Updated by Redmine Admin almost 14 years ago

Replying to [comment:8 homann]:

Thanks! Using Prompt for projection, qgis crashes for me (which I'll look into).

For me it never crashed here.

Can you repeat with using 'Global' setting?

Yes, it is still the same. The log looks somewhat different (attached), yet the result is still that when I enter Settings->Project Properties->Projection still I can see that latlon/WGS84 (QGIS srid: 2585) is selected there, instead of utm33/WGS84 (QGIS srid: 2267). However, it is interesting that when I move cursor over the canvas, UTM x,y coordinates are returned, not lat,lon.

#9 Updated by Magnus Homann almost 14 years ago

Okay, a couple of things:

1) The crash is something you might see, but not directly related to this (see #571).

2) It should never ask for projection as you have a GeoTIFF with proj info, that's a bug (and it is fixed in 'trunk' / 0.9)

3) Settings->Project Properties->Projection does not get set by reading raster/vector. You have to do that manually. Right-click on the layer, select 'Properties' and the 'General' tab, to confirm that the layer SRS is ni fact 2267.

4) Do you have 'Enabled on the fly projection' ticked? If you do have that, have the layer SRS 2276 and the project projection 2585 and zoom to layer extent, you will reproduce #571.

If you have the possibility to join #qgis at freenode IRC, we could discuss this more.

#10 Updated by Redmine Admin almost 14 years ago

Replying to [comment:10 homann]:

1) The crash is something you might see, but not directly related to this (see #571).

You propably mean #574 I guess.

2) It should never ask for projection as you have a GeoTIFF with proj info, that's a bug (and it is fixed in 'trunk' / 0.9)

Will that be backported to 0.8? Please note that the same happens for eg. an shp with a valid prj file (sorry if that was obvious; I'm writing this just in case).

3) Settings->Project Properties->Projection does not get set by reading raster/vector.

Ah, right. I got confused due to problems with "Prompt for projection" mode.

You have to do that manually. Right-click on the layer, select 'Properties' and the 'General' tab, to confirm that the layer SRS is ni fact 2267.

Works fine.

4) Do you have 'Enabled on the fly projection' ticked? If you do have that, have the layer SRS 2276 and the project projection 2585 and zoom to layer extent, you will reproduce #571.

I can reproduce, only that it's #574 ;).

If you have the possibility to join #qgis at freenode IRC, we could discuss this more.

Thanks for your kind proposition but I don't IRC. If I did, I would dissaper from the real world for good :).

Maciek

#11 Updated by Magnus Homann almost 14 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

It's #574, that's right. I don't think it will ge backported, projection implementation has changed for 0.9, and we don't want to mess it up in 0.8.

I hope it's ok to set as fixed in 0.9?

#12 Updated by Redmine Admin almost 14 years ago

  • Resolution deleted (fixed)
  • Status changed from Closed to Feedback

Replying to [comment:12 homann]:

It's #574, that's right. I don't think it will ge backported, projection implementation has changed for 0.9, and we don't want to mess it up in 0.8.

I hope it's ok to set as fixed in 0.9?

It is execellent this bug is fixed in 0.9 but it is still there in 0.8. Why close it for 0.8 then?

If it cannot be fixed in 0.8.1 - too bad, but so be it. But closing it is pretending there is no problem.

Regards,
Maciek

#13 Updated by Magnus Homann almost 14 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

#14 Updated by Magnus Homann almost 14 years ago

Closing it means that we have a fix for it. Please, we have many more bugs without any fix at all to worry about.

#15 Updated by Anonymous over 11 years ago

Milestone Version 0.9 deleted

Also available in: Atom PDF