-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Z dimension of PostGIS geometries not recognized when added via DB Manager #34894
Comments
@nwanner way too old, you must test also on 3.10.3/3.12.0. Thanks! |
@gioman. Thanks for the reminder - didn't realize I'd had this computer 8 months already. I installed version 3.12 and confirmed the same behavior regarding LineString vs LineStringZ. The behavior wasn't exactly like it was previously - I can no longer add 3D views via the DB Manager window. In the previous the 3.8 version it (presumably) took the first field in the view and used it as the oid (the view is written so that the field serves as a primary key). Adding the layer still works correctly through the layer menus. Thanks! Updated QGIS and OS versions |
I confirm the same problem with table of type PointZ. Tested with QGIS 3.14.1-Pi (code revision de08d6b) and QGIS 3.10.8-A Coruña (code revision d09a4f2) on Windows 10. Other information about both versions: |
Hmmm I can not reproduce on Qgis 3.16. Can you give more informations please (postgresql, postgis versions), etc. ? |
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". |
I have already tested with Qgis 3.16.2 on Windows 10 and I still have the same problem. Adding a PointZ PostGIS table via DB Manager the layer Geometry is Point while adding the same table via browser panel or data source manager the layer geometry is PointZ. We use PostgreSQL v. 11 and PostGIS v. 3 Other information about QGIS version: |
Sorry for the delayed response - you caught me in the middle of some database schema changes. I just verified that the issue is still present in QGIS 3.16.1. Adding a layer via the Layer menu results in LineStringZ while adding via Database Manager results in just LineString. QGIS, PostgreSQL and PostGIS versions follow. QGIS version PostgreSQL: Server version: PostGIS: Library: |
@nwanner you must test on 3.16.3 or master anyway. |
The issue is still present in QGIS 3.18.0 QGIS version PostgreSQL: Server version: PostGIS: Library: |
@nwanner I reproduced the error. I think I have a fix |
@lbartoletti That is awesome! Thank you! |
…ports [Backport queued_ltr_backports] Fix Z/M dimension URI via DB Manager. Fixes #34894
Describe the bug
A PostGIS layer can be added to the QGIS canvas through either the menus Layer-->Add Layers-->Add PostGIS Layers, or by right-clicking on the table/view in the DB Manager and choosing Add to Canvas. There is no issue adding via the menus. However, when layers with 3-dimensional geometry (PointZ, LineStringZ) are added using the DB Manager, they are recognized as 2-dimensional Point and LineString layers.
How to Reproduce
Create table with 3D geometry in PostGIS (PointZ or LineStringZ)
Add the layer to the canvas using the menus
Add the layer to the canvas using DB Manager
Right-click on the layer, choose Properties, and go to the Information tab.
Under Information from Provider at the top, the Geometry enter is "Line (LineStringZ)" for the layer added via the menus, and "Line (LineString)" (no Z) for the layer added from DB Manager.
QGIS and OS versions
QGIS version
3.8.0-Zanzibar
QGIS code revision
11aff65
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
2.4.1
Running against GDAL/OGR
2.4.1
Compiled against GEOS
3.7.2-CAPI-1.11.0
Running against GEOS
3.7.2-CAPI-1.11.0 b55d2125
PostgreSQL Client Version
9.2.4
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
5.2.0
Running against PROJ
Rel. 5.2.0, September 15th, 2018
OS Version
Windows 10 (10.0)
Additional context
As an additional demonstration, using the plugin qgis2threejs the layer added from the menus will render correctly and recognize the Z value, while the Z value option is not available for layers added form DB Manager and can only be set to match a particular value or a DEM.
The text was updated successfully, but these errors were encountered: