Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Categorized symbolization does not work on bigint columns in QGIS #33585

Closed
reald opened this issue Jan 2, 2020 · 3 comments · Fixed by #33992
Closed

Categorized symbolization does not work on bigint columns in QGIS #33585

reald opened this issue Jan 2, 2020 · 3 comments · Fixed by #33992
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Symbology Related to vector layer symbology or renderers

Comments

@reald
Copy link

reald commented Jan 2, 2020

Describe the bug

Categorized symbolization does not work on bigint columns. Reproduced with spatiallite.

How to Reproduce

  1. Add a vector layer (spatialite in this case). Note: Steps to create test database with sample values described below.
  2. Go to Properties -> Symbolization -> Categorized. Select bigint column ("id") as value, random colors, then choose classification.

Screenshot_20200102_195257

  1. Shown values are not bigint and do not match database:

987654321012345 in db seems to be 821493369 here
987654321012346 in db seems to be 821493370 here

  1. All bigint values in db are treated as "n/a" and become the same color:

Screenshot_20200102_195056

QGIS and OS versions

QGIS-Version 3.10.1-A Coruña QGIS-Codeversion ef24c52
Kompiliert gegen Qt 5.9.5 Laufendes Qt 5.9.5
Kompiliert mit GDAL/OGR 2.2.3 Läuft mit GDAL/OGR 2.2.3
Kompiliert mit GEOS 3.6.2-CAPI-1.10.2 Läuft mit GEOS 3.6.2-CAPI-1.10.2 4d2925d6
Kompiliert mit SQLite 3.22.0 Läuft mit SQLite 3.22.0
PostgreSQL-Client-Version 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) SpatiaLite-Version 4.3.0a
QWT-Version 6.1.3 QScintilla2-Version 2.10.2
PROJ.4-Version 493
BS-Version Ubuntu 18.04.3 LTS
Aktive Python-Erweiterungen QuickOSM; QuickWKT; OnlineRoutingMapper; qfieldsync; pluginbuilder3; MapsPrinter; OSMtools; quick_map_services; SelectWithin; ORStools; mmqgis; db_manager; processing; MetaSearch

Additional context

Create test database:

$>sqlite3 bigint.db
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> CREATE TABLE IF NOT EXISTS test (
...> "id" BIGINT,
...> "value" INT);
sqlite> SELECT load_extension('mod_spatialite.so');
sqlite> SELECT InitSpatialMetaData(1);
1
sqlite> SELECT AddGeometryColumn('test', 'position', 4326, 'LINESTRING', 'XYM');
1
sqlite> INSERT INTO test (id, value, position) VALUES
(987654321012345, 1, ST_GeomFromtext('LINESTRINGM(10.416255 55.3786316 1577093516, 10.516255 55.4786316 157709)', 4326) ),
(987654321012346, 2, ST_GeomFromtext('LINESTRINGM(10.316255 55.3786316 1577093516, 11.216255 56.3786316 157709)', 4326) );

@reald reald added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 2, 2020
@reald
Copy link
Author

reald commented Jan 2, 2020

Possible workaround: Categorize by "to_string(id)" and not "id".

@reald reald changed the title Categorized symbolization does not work on bigint columns Categorized symbolization does not work on bigint columns in QGIS Jan 2, 2020
@gioman gioman added the Symbology Related to vector layer symbology or renderers label Jan 3, 2020
@elpaso elpaso self-assigned this Jan 22, 2020
@elpaso
Copy link
Contributor

elpaso commented Jan 22, 2020

@reald how exactly did you add the layer?
Can you paste the provider information?

@elpaso elpaso added the Feedback Waiting on the submitter for answers label Jan 22, 2020
@elpaso
Copy link
Contributor

elpaso commented Jan 22, 2020

@reald nevermind, found the issue (it works with OGR provider btw, the issue is in spatialite provider).

@elpaso elpaso removed the Feedback Waiting on the submitter for answers label Jan 22, 2020
elpaso added a commit to elpaso/QGIS that referenced this issue Jan 22, 2020
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants