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

Unable to add layers with M (measure) geometries from PostGIS #55223

Closed
2 tasks done
Michael-cd30 opened this issue Nov 8, 2023 · 2 comments · Fixed by #56199
Closed
2 tasks done

Unable to add layers with M (measure) geometries from PostGIS #55223

Michael-cd30 opened this issue Nov 8, 2023 · 2 comments · Fixed by #56199
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! PostGIS data provider Regression Something which used to work, but doesn't anymore

Comments

@Michael-cd30
Copy link

What is the bug or the crash?

The layer is considered not to have a geometry.

Steps to reproduce the issue

On PostGIS run :

create table point_with_measure as
select ST_GeomFromText('POINT M (797290.9084747223 6295271.877055189 24500)', 2154) as geom

Try to display this layer in QGIS.

3.28.12 --> KO
3.34.0 --> KO
3.16.16 --> OK

Versions

Version de QGIS
3.28.12-Firenze
Révision du code
dcc633b
Version de Qt
5.15.3
Version de Python
3.9.5
Version de GDAL/OGR
3.7.2
Version de Proj
9.3.0
Version de la base de données du registre EPSG
v10.094 (2023-08-08)
Version de GEOS
3.12.0-CAPI-1.18.0
Version de SQLite
3.41.1
Version de PDAL
2.5.5
Version du client PostgreSQL
unknown
Version de SpatiaLite
5.1.0
Version de QWT
6.1.6
Version de QScintilla2
2.13.4
Version de l'OS
Windows 10 Version 2009

Extensions Python actives
grassprovider
2.12.99
processing
2.12.99
sagaprovider
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

image

@Michael-cd30 Michael-cd30 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 8, 2023
@lbartoletti lbartoletti added Regression Something which used to work, but doesn't anymore PostGIS data provider labels Nov 8, 2023
@lbartoletti
Copy link
Member

Indeed, there is a regression here. Point type doesn't have M:

image

It's OK with Z create table temp_oslandia.point_with_zztop as select ST_GeomFromText('POINT Z (797290.9084747223 6295271.877055189 24500)', 2154) as geom:

image

Or ZM
image

@Michael-cd30
Copy link
Author

It's also KO with Linestring M

PG Query :

create table test_linestringm as
with test_measure as (
    select ST_GeomFromText('LINESTRING M (796091.2 6313188.3 0,796089 6313175 13.480726983172712,796087 6313166.1 22.602678529121157,796083.6 6313156.5 32.786980173957)', 2154) as XYM
)
select
    XYM,
    ST_Force2D(XYM) as XY
from test_measure

QGIS display :

image

lbartoletti added a commit to lbartoletti/QGIS that referenced this issue Feb 6, 2024
Unlike Geometry(Z), GeometryM contains already M suffix.
It's useless to add M suffix here, since it will add a new name
and the geometry type name will be something like GeometryMM.

Fixes qgis#55223
lbartoletti added a commit to lbartoletti/QGIS that referenced this issue Feb 6, 2024
Unlike Geometry(Z), GeometryM contains already M suffix.
It's useless to add M suffix here, since it will add a new name
and the geometry type name will be something like GeometryMM.

Fixes qgis#55223
lbartoletti added a commit to lbartoletti/QGIS that referenced this issue Feb 6, 2024
lbartoletti added a commit that referenced this issue Feb 6, 2024
Unlike Geometry(Z), GeometryM contains already M suffix.
It's useless to add M suffix here, since it will add a new name
and the geometry type name will be something like GeometryMM.

Fixes #55223
qgis-bot pushed a commit that referenced this issue Feb 6, 2024
Unlike Geometry(Z), GeometryM contains already M suffix.
It's useless to add M suffix here, since it will add a new name
and the geometry type name will be something like GeometryMM.

Fixes #55223
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! PostGIS data provider Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants