Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#561 closed bug (fixed)

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

Reported by: tutey@… Owned by: homann
Priority: major: does not work as expected Milestone:
Component: Projection Support Version: 0.8
Keywords: Cc:
Must Fix for Release: Yes Platform: Debian
Platform Version: Ubuntu Dapper Awaiting user input: no

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",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",15],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    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

Attachments (4)

force_lrconnect_cl_onlycat139.tar.bz2 (1.7 KB ) - added by tutey@… 17 years ago.
shapefile
topo.tif (33.1 KB ) - added by tutey@… 17 years ago.
raster
ticket561.log.bz2 (12.1 KB ) - added by tutey@… 17 years ago.
ticket561_global.log.bz2 (11.7 KB ) - added by tutey@… 17 years ago.

Download all attachments as: .zip

Change History (20)

by tutey@…, 17 years ago

shapefile

by tutey@…, 17 years ago

Attachment: topo.tif added

raster

comment:1 by anonymous, 17 years ago

Summary: raster's projection is never recognizedraster's and vector's projection is never recognized

comment:2 by homann, 17 years ago

Owner: changed from nobody to homann
Status: newassigned

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.

in reply to:  2 comment:3 by tutey@…, 17 years ago

Replying to 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

comment:4 by homann, 17 years ago

Resolution: worksforme
Status: assignedclosed

With 0.8 r6521 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"

in reply to:  4 comment:5 by tutey@…, 17 years ago

Replying to homann:

With 0.8 r6521 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

comment:6 by homann, 17 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.

comment:7 by tutey@…, 17 years ago

Resolution: worksforme
Status: closedreopened

Thanks for the instruction.

  1. built QGIS 6540 with debug
  1. run QGIS, set Settings->Options->Projection->Prompt for projection, exit
  1. qgis --lang=en tmp/topo.tif &> ticket561.log
  1. the "Layer Projection Selector" pops up - apparently the projection was not recognized
  1. ll/WGS84 is suggested - I press OK, then I exit QGIS

The log is attached. Line 378 is when #4 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

by tutey@…, 17 years ago

Attachment: ticket561.log.bz2 added

comment:8 by homann, 17 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.

in reply to:  8 comment:9 by tutey@…, 17 years ago

Replying to 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.

by tutey@…, 17 years ago

Attachment: ticket561_global.log.bz2 added

comment:10 by homann, 17 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.

in reply to:  10 comment:11 by tutey@…, 17 years ago

Summary: raster's and vector's projection is never recognizedraster's and vector's projection never recognized in "Prompt for projection" mode

Replying to 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

comment:12 by homann, 17 years ago

Milestone: Version 0.8.1 ReleaseVersion 0.9 Release
Resolution: fixed
Status: reopenedclosed

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?

in reply to:  12 comment:13 by tutey@…, 17 years ago

Milestone: Version 0.9 ReleaseVersion 0.8.1 Release
Resolution: fixed
Status: closedreopened

Replying to 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

comment:14 by homann, 17 years ago

Milestone: Version 0.8.1 ReleaseVersion 0.9 Release
Resolution: fixed
Status: reopenedclosed

comment:15 by homann, 17 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.

comment:16 by (none), 15 years ago

Milestone: Version 0.9

Milestone Version 0.9 deleted

Note: See TracTickets for help on using tickets.