Bug report #3977

Bogus missing CRS error

Added by Aren Cambre about 13 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:cfarmer -
Category:Processing/QGIS
Affected QGIS version:master Regression?:
Operating System: Easy fix?:
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:13974

Description

I am trying to run the ftools Difference function on two shapefile layers. After pressing OK, I get a dialog with this warning:

Input CRS error: One or more input layers missing coordinate reference information, results may not be as expected.

Indeed, the resulting SHP is identical to my selection in the input vector layer.

This is incorrect. Both my input vector layers have CRSes specified. The input vector layer has this CRS:

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

The difference layer has this CRS:

+proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

I'm using ftools 0.5.10 with QGIS 1.6.0.

History

#1 Updated by Aren Cambre about 13 years ago

Where I wrote "Both my input vector layers have CRSes specified", I should have written "Both my input and difference vector layers have CRSes specified"

#2 Updated by Aren Cambre about 13 years ago

It gets even weirder. Sometimes it does work, sometimes it doesn't.

#3 Updated by Aren Cambre about 13 years ago

It even happens if both layers have this CRS:

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

#4 Updated by Giovanni Manghi almost 13 years ago

  • Assignee set to cfarmer -
  • Pull Request or Patch supplied set to No

#5 Updated by Giovanni Manghi almost 13 years ago

  • Status changed from Open to Feedback

I'm almost sure that ftools tools need to all the input vectors to be in the same CRS. Carson (the toolbox author), can you leave feedback?

#6 Updated by Giovanni Manghi almost 13 years ago

Aren Cambre wrote:

It even happens if both layers have this CRS:

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

Can you please attach sample data? thanks

#7 Updated by Aren Cambre almost 13 years ago

I've uploaded two SHPs to https://locker.smu.edu/xythoswfs/webui/_xy-1905192_1-t_VKORAv6z. One is a SHP of all school districts in Texas, the other is a SHP of counties in the Dallas-Ft. Worth area.

Try to use the difference function to only show the school districts within the DFW-area counties, and you'll see the problem. Just tried it with QGIS 1.7.1 and got the same warning and the resulting SHP that was not different than the original.

I set the project to EPSG:3081 and told it to transform layers on the fly, but not sure that matters for this tool?

Note that if it is true that the layers must have the same coordinate systems, then the error should tell me this. And if this is true, a feature request ought to be opened to overcome this limitation.

#8 Updated by Aren Cambre almost 13 years ago

Whoops, just noticed the two SHPs have different coordinate systems. I regret that I do not remember which SHPs I was working with when I posted this. If I come across 2 SHPs with the same CRS where I get this error, I'll report it here. Barring that, if it's true that both SHPs must have the same CRS, then the error message is not giving me useful information.

#9 Updated by Aren Cambre over 12 years ago

I opened #4564 to document the inadequate error message.

Can this be converted to a feature request, that ftools might automagically reproject one of the layers so that the "they must have the same CRS" requirement goes away? In my work, it's really common to combine datasets with different CRSes, and it would sure help prevent time waste of manually reprojecting layers. Seems that if qgis can reproject on the fly, ftools ought to be able to do it, too.

#10 Updated by Giovanni Manghi over 12 years ago

  • Target version set to Version 1.7.4

#11 Updated by Giovanni Manghi over 12 years ago

  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No
  • Status changed from Feedback to Closed
  • Resolution set to invalid

Aren Cambre wrote:

I opened #4564 to document the inadequate error message.

Can this be converted to a feature request, that ftools might automagically reproject one of the layers so that the "they must have the same CRS" requirement goes away? In my work, it's really common to combine datasets with different CRSes, and it would sure help prevent time waste of manually reprojecting layers. Seems that if qgis can reproject on the fly, ftools ought to be able to do it, too.

I'll merge this and #4564 and make it a feature request to allow use ftools tools with layer with different CRSs.

#12 Updated by Giovanni Manghi about 7 years ago

The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

Also available in: Atom PDF