QField icon indicating copy to clipboard operation
QField copied to clipboard

Geometry has M dimension but column does not - PostGIS ERROR when synchronise from QField

Open ioioio25 opened this issue 4 years ago • 3 comments

Error_M_dimension_example Hello, I did some GPS reading(3 dimensions) with QField (lines) and when I try to synchronize with the PostgreSQL table, I get this error message:

'' PostGIS error while adding features: ERROR: Geometry has M dimension but column does not''.

I would like to mention that in PostgreSQL my line entities are "LineStringZ" types. ... It seemed that QField introduced by default the ''M '' dimension ... Have anyone any idea why and how to fix this? Thank you.

ioioio25 avatar May 29 '20 13:05 ioioio25

Thanks for reporting. If it's a bug, then it's rather QFieldSync or QGIS (offlineediting) related. But I leave this issue open here at the moment, since possibly someone else noticed the same misbehavior.

signedav avatar Jun 02 '20 05:06 signedav

I have a similar issue, but concerning the Z dimension. ERROR: Geometry has Z dimension but column does not.

qnmai avatar Aug 12 '21 01:08 qnmai

I have the same issue.

My postgis point is only for x,y geom as well as exported gpkg from qfield.

After edition in qfield in the Tab, I don't know why but in 305 points one have one z value contrary to other that have null values :

error after QFIELD Sync "2021-12-01T15:15:13 WARNING Commit errors: ERROR: 305 feature(s) not added - geometry type is not compatible with the current layer. "

Ogrinfoto list z values. ogrinfo -so -dialect SQLite -sql "SELECT DISTINCT GeometryType(geom) FROM plantio_9bc85e75_c8ee_494f_bf8e_00724c8b06b1" data.gpkg

To solve the problem I need to use the following ogrinfo -dialect SQLite -sql "UPDATE plantio_9bc85e75_c8ee_494f_bf8e_00724c8b06b1 SET geom = MakePoint(x(geom), y(geom)) WHERE z(geom) IS NOT NULL" data.gpkg

clardeux avatar Dec 03 '21 09:12 clardeux