Bug report #10705

Symbology based on a field from a CSV join (plus CSVT) does not render

Added by Vitor George almost 10 years ago. Updated almost 8 years ago.

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

Description

new description:

the issue arises when doing a join with a csv+csvt, not when using just the csv.

Moreover the crash is solved on qgis master, but any symbology based on a joined field (from csv+csvt) does not work (the classes are created but not rendered).


Hi,

I'm trying apply graduated style to a vector layer create from a shapefile joined to a csv, but the program is crashing.

Sample data:

https://dl.dropboxusercontent.com/u/3291375/qgis-bug/sample-data.zip

These are the steps to reproduce:

1) Add the csv and shapefile layers to a new project;

2) Open vector layer properties, join layers using 'Cod_setor' and 'CD_GEOCODI' fields and apply;

3) Go to styles area. Select 'Graduated' style, column 'censo-2010-sp-data_V009' and click 'Ok'.

The program will crash, both in Windows and OSX. It worked in previous versions of QGIS.

Backtrace attached is for OSX 1.7.5 installed from Kingkhaos package .

backtrace.txt Magnifier (84.5 KB) Vitor George, 2014-06-24 12:58 PM

censo-2010-sp-data.csvt.csv Magnifier (138 Bytes) Vitor George, 2014-06-26 08:49 AM

censo-2010-sp-data.csvt (138 Bytes) Vitor George, 2014-06-26 08:53 AM

History

#1 Updated by Giovanni Manghi almost 10 years ago

  • Status changed from Open to Feedback

Olá Vitor,

this is strange because on Linux and Windows (tested on both 2.2 and master) that field should not be available for graduated symbology as it is "string" and not a number. On Mac is available?

Anyway in the symbology tab instead of choosing directly the field for classification you can click on the expression builder icon and create an expression like

toreal(  "censo-2010-sp-data_V009"  )

and this will work, with no crashes.

Please test (QGIS master if you can) and report back. Thanks.

#2 Updated by Giovanni Manghi almost 10 years ago

weird, if I open the project you attached (some of) the joined fields are numeric (double/int), not sure how you achieved that. Maybe it is me that I don't know how to do it :) anyway even using your project, on qgis master, no crash.

#3 Updated by Vitor George almost 10 years ago

Ciao Giovanni,

Thanks for your solution, it works now. But I still think it is a bug because the field is indeed a number type and it should style it properly.

I created a .csvt file (attached) to enforce field type, and results are the same.

Another problem is that the second field ("Nome_do_municipio") is defined as "Double" in QGIS, besides being declared as "String" in the .csvt file.

#4 Updated by Vitor George almost 10 years ago

Sorry, I've not uploaded the correct .csvt file.

#5 Updated by Giovanni Manghi almost 10 years ago

  • Target version changed from Version 2.2 to Future Release - High Priority
  • Category changed from Data Provider/Delimited Text to Symbology
  • Subject changed from Crashes when styling a shapefile with a joined csv file to Symbology based on a field from a CSV join (plus CSVT) does not render
  • Status changed from Feedback to Open
  • Affected QGIS version changed from 2.2.0 to master
  • OS version deleted (1.7.5)
  • Operating System deleted (OSX)

Vitor George wrote:

Ciao Giovanni,

Thanks for your solution, it works now. But I still think it is a bug because the field is indeed a number type and it should style it properly.

I created a .csvt file (attached) to enforce field type, and results are the same.

Another problem is that the second field ("Nome_do_municipio") is defined as "Double" in QGIS, besides being declared as "String" in the .csvt file.

So the issue arises when using a csv+csvt, not when using just the csv.

Moreover the crash is solved on qgis master, but any symbology based on a joined field (from csv+csvt) does not work (the classes are created but not rendered).

#6 Updated by Nyall Dawson almost 8 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Not reproducible in master

Also available in: Atom PDF