I've encountered a problem with the Categorized renderer in QGIS. I have a GeoPackage file including a set of data points, with approximately 30 attributes (mainly strings). I'm trying to set the colour of points depending on a string attribute value, using Categorized renderer.

When I click on the "Classify" button, the values of the relevant attibute are not loaded and the classification won't succeed: there's only one symbol/colour for all points. The values can't be loaded in the Field Calculator, too: upon clicking the "Unique" or "Sample" button the field beneath stays empty. The Attribute Table on the other hand is displayed correctly, with all values for all attributes in the right cells.

This occurs both in QGIS 2.18 and in QGIS 3.2, in the case of this specific file only. Also, some of the attributes are not affected. The problem can be bypassed by saving the file as Shapefile instead of GeoPackage, however then the attribute labels (Headings in Attribute Table) are cut short, so such approach is not practical.

Could someone help me understand what is going on and how to make it work?

I suppose it may be a text coding issue, but I can't change the coding method for GeoPackage format (the field is greyed out).

The GeoPackage file can be downloaded from here: https://drive.google.com/file/d/1-GUObpa4yanmX9Y1tBIPAmsh1kgQB9NL/view?usp=sharing

The file contains a list of creches in Olsztyn, Poland, with addresses geocoded using MMQGIS/Google Maps (publicly accessible data only). I've only been able to use the Categorized renderer with the attribute "Telefon" (phone number), but not with other atributes.

  • Try to create a small GeoPackage with that can be used for reproducing the issue. It does not need to contain real data. – user30184 Jul 1 '18 at 17:04
  • @user30184 I've added the file to original post. – Jurek Gozdek Jul 1 '18 at 20:38
  • I can reproduce your issue but I have not yet discovered how to fix it. – user30184 Jul 2 '18 at 21:19
  • 1
    Yes, it seems QGIS is ignoring fields if their name contain spaces. Perhaps a bug? I saved the file as GML, which replaced space by underscore, then saved it again as GeoPackage. (I had to exclude fid field in this process) – Kazuhito Jul 3 '18 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.