Bug report #6392

CRS not recognized when opening raster file that contains one

Added by Tim Caughron over 11 years ago. Updated over 11 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Projection Support
Affected QGIS version:1.8.0 Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:15648

Description

Hello, and please excuse me if I don't provide all the needed info. New to bug reporting, but trying my best.

I am running QGIS 1.8.0 Ubuntu Precise version from the repo obviously on Ubuntu 12.04 Pinguy build of the OS. I have noticed a bug that is not present in the Windows 1.8.0 version which I also run on my other OS.

Basically, I am working with georeferenced .tif files that contain a predefined CRS. In Windows QGIS, when I open those files and go to the properties for the layer, the existing CRS is defined correctly as a "User" CRS like this: USER:100035 - * Generated CRS (+proj=lcc +lat_1=38.66667 +lat_2=33.33333 +lat_0=34.16667 +lon_0=-118.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs)

However, when I do the same exact procedure in my Ubuntu version it always sets the CRS to EPSG:4326. It does not matter what radio button settings I have selected in System Properties for the CRS nor in the layer Properties for the CRS. Furthermore, if I open a saved project that was done in the Windows version into the Linux version, it will read the CRS correctly as saved in Windows, but if I try yet again to bring in a new layer into the project, it reverts back to setting at the default EPSG:4326.

Finally, if I do open a existing project that retains the correct CRS, I notice that it is correctly referenced in the bottom right corner of the GUI in the CRS Status display. However, when adding a new raster, that information is not available to chose from in the dialogue to select a CRS.

Because you will ask, I have tried this with OTFR on and off. I have selected "Prompt for CRS" in the Settings->CRS "Coordinate Reference System for new layers" dialogue. I have also selected the other settings "Use project CRS" and "Use default CRS..." to test, and they are working as expected.

My theory of a bug being present is based on the fact it works correctly in Windows, and in the "Coordinate Reference System for new layers" dialogue the text reads "When a new layer is created, or when a layer is loaded that has no Coordinate System Reference (CRS)" I have selected "Prompt for CRS". The issue is that the files I am loading do have a CRS.

I have checked the Issues section and unable to find this bug as being reported. There are several reports that are similar such as #5142, but none that detail this exact behavior.

The files I am using are larger than the 5 MB maximum for upload. I can email the files directly to anyone needing them.

Thanks for the help.

History

#1 Updated by Giovanni Manghi over 11 years ago

  • Category set to Projection Support
  • Operating System set to Linux
  • OS version set to Ubuntu 12.04
  • Affected QGIS version changed from master to 1.8.0
  • Status changed from Open to Feedback
  • Target version set to Version 2.0.0

please try share sample data, for example using dropbox or another virtual drive. Or just mail it to me giovanni.manghi at faunalia.pt

#2 Updated by Magnus Homann over 11 years ago

What is the version of GDAL for each Qgis system? It shows in "Help -> About" menu.

#3 Updated by Tim Caughron over 11 years ago

Magnus Homann wrote:

What is the version of GDAL for each Qgis system? It shows in "Help -> About" menu.

There definitely is a difference in GDAL versions.

My Ubuntu is built against GDAL 1.7.3.

Windows built against GDAL 1.9.1.

Could possibly be a culprit. If you might suggest building against 1.9.x for my Ubuntu version could you also include a link that could help explain to me how to do that. Have not compiled any programs to date, so any help in htat direction would be great. Thanks for the awesome idea of checking versions.

#4 Updated by Tim Caughron over 11 years ago

Giovanni Manghi wrote:

please try share sample data, for example using dropbox or another virtual drive. Or just mail it to me giovanni.manghi at faunalia.pt

Here are several files. One is a project file, the others are files from the project that are also geocoded as described in my post.

Thanks for the help.

http://dl.dropbox.com/u/48733055/Los%20Angeles.qgs
http://dl.dropbox.com/u/48733055/Los%20Angeles.tif
http://dl.dropbox.com/u/48733055/Los%20Angeles%2091%20North.tif
http://dl.dropbox.com/u/48733055/Los%20Angeles%2091%20South.tif

#5 Updated by Giovanni Manghi over 11 years ago

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

Could possibly be a culprit. If you might suggest building against 1.9.x for my Ubuntu version could you also include a link that could help explain to me how to do that. Have not compiled any programs to date, so any help in htat direction would be great. Thanks for the awesome idea of checking versions.

it is definitely the gdal version. You don't need to compile to get qgis 1.8 and gdal 1.9, just use the ubuntugis repository.

#6 Updated by Tim Caughron over 11 years ago

Giovanni Manghi wrote:

it is definitely the gdal version. You don't need to compile to get qgis 1.8 and gdal 1.9, just use the ubuntugis repository.

Well I have downloaded from the ubuntugis repo and am now running against GDAL 1.9.1. QGIS is version 1.9.0-developer.

Sad to report that the exact same behavior is still present. It is still forcing the CRS to EPSG:4326 and not recognizing the georeferenced information for the file.

I have turned off OTFR and selected Prompt for CRS in settings. Still not getting the behavior experienced in the Windows version.

#7 Updated by Magnus Homann over 11 years ago

Unfortunately, it works for me on Ubuntu 12.04 (amd64) and creates a user CRS. Here are my versions:

"
QGIS version
1.9.0-Master
QGIS code revision
331ef1b
Compiled against Qt
4.8.1
Running against Qt
4.8.1
Compiled against GDAL/OGR
1.9.1
Running against GDAL/OGR
1.9.1
GEOS Version
3.3.3
PostgreSQL Client Version
9.1.5
SpatiaLite Version
3.1.0-RC2
QWT Version
5.2.2
PROJ.4 Version
470

This copy of QGIS writes debugging output.
"

Could you paste your code info too?

#8 Updated by Tim Caughron over 11 years ago

I am also running AMD64 Ubuntu 12.04, however it is the Pinguy version. My versions are mostly the same except for "QGIS code revision" reads differently and SpatiaLite Version is different - mine is a beta. Need to figure out how to fix that one. Here is a copy of my versions:

QGIS version
1.9.0-Master
QGIS code revision
exported
Compiled against Qt
4.8.1
Running against Qt
4.8.1
Compiled against GDAL/OGR
1.9.1
Running against GDAL/OGR
1.9.1
GEOS Version
3.3.3
PostgreSQL Client Version
9.1.5
SpatiaLite Version
3.0.0-beta
QWT Version
5.2.2
PROJ.4 Version
470

Mine does not say the bit about writing debugging output either.

Thanks.

#9 Updated by Tim Caughron over 11 years ago

Okay, got the Spatialite updated to v. 3.1.0-RC2 as noted below. Still getting the undesired behavior. Only difference between my versions and yours is the "QGIS code revision exported" line. Really hoping to get this worked out, I like working inside Linux better than my Windows environment.

QGIS version
1.9.0-Master
QGIS code revision
exported
Compiled against Qt
4.8.1
Running against Qt
4.8.1
Compiled against GDAL/OGR
1.9.1
Running against GDAL/OGR
1.9.1
GEOS Version
3.3.3
PostgreSQL Client Version
9.1.5
SpatiaLite Version
3.1.0-RC2
QWT Version
5.2.2
PROJ.4 Version
470

#10 Updated by Giovanni Manghi over 11 years ago

Sad to report that the exact same behavior is still present. It is still forcing the CRS to EPSG:4326 and not recognizing the georeferenced information for the file.

Hi, I cannot replicate the issue. I'm on Ubuntu 12.04 64 bit too.

The rasters are geotiffs, you can check it with gdalinfo

Driver: GTiff/GeoTIFF
Files: /home/gio/Downloads/Los Angeles 91 South.tif
Size is 11002, 4138
Coordinate System is:
PROJCS["Los Angeles Sectional",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6269"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4269"]],
PROJECTION["Lambert_Conformal_Conic_2SP"],
PARAMETER["standard_parallel_1",38.66667],
PARAMETER["standard_parallel_2",33.33333],
PARAMETER["latitude_of_origin",34.16667],
PARAMETER["central_meridian",-118.5],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]
Origin = (-343329.997319777728990,17504.608481576869963)
Pixel Size = (63.486089999999990,-63.486089999999997)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( -343329.997, 17504.608) (122d13'52.13"W, 34d15'54.96"N)
Lower Left ( -343329.997, -245200.832) (122d 7'29.96"W, 31d53'56.01"N)
Upper Right ( 355143.965, 17504.608) (114d38'26.14"W, 34d15'40.02"N)
Lower Right ( 355143.965, -245200.832) (114d45' 1.43"W, 31d53'41.52"N)
Center ( 5906.984, -113848.112) (118d26'12.13"W, 33d 8'23.94"N)
Band 1 Block=11002x128 Type=Byte, ColorInterp=Palette
Min=0.000 Max=255.000
Minimum=0.000, Maximum=255.000, Mean=118.878, StdDev=71.458
NoData Value=256
Metadata:
RepresentationType=THEMATIC
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=118.8780422541
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=71.458288773115
Color Table (RGB with 256 entries)
0: 0,0,0,255

and so QGIS has no reason to force the CRS to wgs84.

The maps are added with the following CRS

+proj=lcc +lat_1=38.66667 +lat_2=33.33333 +lat_0=34.16667 +lon_0=-118.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

and they overlap correctly with layers from other sources.

This should be a local problem. Try on another machine and/or a clean installation in your box.

#11 Updated by Magnus Homann over 11 years ago

Hav you tried running the program 'crssync'? It's in the qgis lib direcotry. You might have to set LD_LIBRARY_PATH also. I believe it's a good idea when changing gdal.

#12 Updated by Tim Caughron over 11 years ago

Magnus Homann wrote:

Hav you tried running the program 'crssync'? It's in the qgis lib direcotry. You might have to set LD_LIBRARY_PATH also. I believe it's a good idea when changing gdal.

Yes, I have just tried this and received a message similar to ;an update was not necessary".

Still unresolved after CRSSYNC.

Is it possible to reopen this ticket to others that may have had similar experiences?

Thanks, Tim.

#13 Updated by Tim Caughron over 11 years ago

Giovanni Manghi wrote:

Sad to report that the exact same behavior is still present. It is still forcing the CRS to EPSG:4326 and not recognizing the georeferenced information for the file.

Hi, I cannot replicate the issue. I'm on Ubuntu 12.04 64 bit too.

The rasters are geotiffs, you can check it with gdalinfo

...

and so QGIS has no reason to force the CRS to wgs84.

The maps are added with the following CRS

+proj=lcc +lat_1=38.66667 +lat_2=33.33333 +lat_0=34.16667 +lon_0=-118.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

and they overlap correctly with layers from other sources.

This should be a local problem. Try on another machine and/or a clean installation in your box.

That is what I am starting to think also. Before I nuke my system and do a clean install, is there any way to effectively and entirely remove qgis and all dependencies installed with it and then do a clean install of the software to see if it resolves. I have tried to remove via apt-get a couple times, however, that has not helped. Not sure if I am getting all dependencies out via that method.

Thanks again.

#14 Updated by Giovanni Manghi over 11 years ago

That is what I am starting to think also. Before I nuke my system and do a clean install, is there any way to effectively and entirely remove qgis and all dependencies installed with it and then do a clean install of the software to see if it resolves. I have tried to remove via apt-get a couple times, however, that has not helped. Not sure if I am getting all dependencies out via that method.

try delete the ~/.qgis and ~/.config/QuantumGis folders

Also available in: Atom PDF