1

I'm trying to insert a shapefile into PostGIS using FME but I always get an error saying:

ERROR: Column has M dimention but geometry does not
CONTEXT: PL/pgSQL function debug.trig_fonc_force_geom_3d() line 6 at assignment

If I inspect the features in FME Data Inspector, the geometry info for the existing data in postGIS looks the same as the shapefile data, i.e.:

IFMELine (2 Coordinates)
Closed           No
Measures (1)     <default_measure>
Coordinates (2)  Coordinate Dimension: 3
0                -3.432432, 40.23948723, 0, <0>
1                -3.238473, 40.42348234, 0, <0>

I have tried every combination of setting/removing Z and M values but it doesn't make any difference. I've tried both Spatial Type options in the wirter (Geometry/Geography) - what can I do?

Note: I'm inserting into an existing table containing geometry. When the table was empty I was able to use FME to insert one batch of data but now I'm getting this error.

2
  • 1
    Do you try to insert in an existing table or do you create a new one on the fly using FME? Mar 2 at 12:22
  • @nielsgerrits I'm inserting into an existing table. Maybe I should also say that the data that is currently in the table was inserted into an existing but empty table using FME so it went in ok when the table was empty but not anymore.
    – BTL
    Mar 2 at 13:04
1

The clue was in this line:

CONTEXT: PL/pgSQL function debug.trig_fonc_force_geom_3d() line 6 at assignment

There was a rogue trigger in the database which used ST_Force3D before inserting, which I guess knocked off the M-values - I changed this to ST_Force4D and I seem to be in business.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.