qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.55k stars 2.99k forks source link

Saving style as SLD creates wrong rules #33289

Open Navid61 opened 4 years ago

Navid61 commented 4 years ago

Describe the bug

I add a layer from the PostGIS server to my canvas for the first time it shown with a default symbol and color, I changed the symbol and style and layers loaded with my new style without any problem and I saved the layer new style in sld format, for next time when I load that sld I can see layer style in canvas it seems layer disappeared or gone but I can see my style in Layers Window!

How to Reproduce

I took a screenshot for each step [1.]I add a layer from PostGIS to canvas and it loaded with the random symbols (https://imgur.com/zShfECj) [2.]In this picture, I represent my new install and I saved it to a sld file (https://imgur.com/xxNvo37) [3.]I load sld(https://imgur.com/UZf191Z) [4.]Finall It seems it load completely without a problem but I can't see the layer! (https://imgur.com/EqFzTjv)

qgis_style_issue.zip

QGIS version 3.4.13-Madeira QGIS code revision QGIS code revision
Compiled against Qt 5.11.3 Running against Qt 5.11.3
Compiled against GDAL/OGR 2.4.0 Running against GDAL/OGR 2.4.0
Compiled against GEOS 3.7.1-CAPI-1.11.1 Running against GEOS 3.7.1-CAPI-1.11.1 27a5e771
PostgreSQL Client Version 11.5 (Debian 11.5-1+deb10u1) SpatiaLite Version 4.3.0a
QWT Version 6.1.4 QScintilla2 Version 2.10.4
Compiled against PROJ 5.2.0 Running against PROJ Rel. 5.2.0, September 15th, 2018
Active python plugins db_manager; processing; MetaSearch; quick_map_services; QuickOSM

Additional context OS:Debian 10 x64, PostgreSQL 12, PostGIS 3

gioman commented 4 years ago

The problem is that saving a style as SLD it creates classes/rules that makes use the = operator and compare against a value always written in scientific notation

Screenshot_20191209_091558

Pedro-Murteira commented 2 years ago

@Navid61 Hello, I've tested this issue and I can't seem to replicate it. I managed to load SLD and it applied to the layer without any problems. Are you still having this issue?

Navid61 commented 2 years ago

Hi, thank you for your answer, actually, I didn't check again. However, I'll check, If it happened again I 'll mention it here.

github-actions[bot] commented 2 years ago

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.

Navid61 commented 2 years ago

Thank you for your concern. I did check again with QGIS 3.22.3 x64, This problem is not solved in the new version!. you can check with the sample I added already above. It can prove my answer. This is my system specifications: My OS is Debian 11 x64

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
</head>
<body>
<p>
QGIS version | 3.22.3-Białowieża
Qt version | 5.15.2
Python version | 3.9.2
GDAL/OGR version | 3.2.2
PROJ version | 7.2.1
EPSG Registry database version | v10.008 (2020-12-16)
GEOS version | 3.9.0-CAPI-1.16.2
SQLite version | 3.34.1
PDAL version | 2.2.0
PostgreSQL client version | 13.5 (Debian 13.5-0+deb11u1)
SpatiaLite version | 5.0.1
QWT version | 6.1.4
QScintilla2 version | 2.11.6
OS version | LMDE 4 (debbie)
</p>
</body>
</html>
Pedro-Murteira commented 2 years ago

@Navid61 Confirmed, I was able to replicate it this time aswell. After loading the style, the layer vanishes. (QGIS 3.22.3., Windows 10).

Navid61 commented 2 years ago

I did research, I understood this is not a bug! this issue is a "missing feature", we should be hopeful, Someone to decide to complete this part in QGIS. Based on documents QGIS ONLY do fully support QML not SLD. https://github.com/qgis/QGIS/issues/23356

Mr-Strain commented 1 year ago

I ran into this problem to. Numbers with 6 digits seems ok, but 7 digits you get a wrong rule in Qgis like gioman mentioned with his first response.

I would say this SLD-Styles are not backward compatible with Qgis. Bug or Missing Feature, i dont know ;)

But i could see some problems for my future hear.