Skip to main content
Using FME Desktop 2013 Build 13262 on a Win 7 Pro 64 Bit environment, I try to import data coming from an INTERLIS-Source into PostGIS 2.0, I obtain error messages on all tables reading:

 

Bulk copy failed on table 'gueterzettel.dmg24bodnkung_boflaeche' using delimiter ':'. Error was 'ERROR: Dimensions mismatch in lwcollection

 

 

The strange thing about it is that usually PostGIS comes up with a straight constraint violation message if geometries e.g. have only 2D but are defined to have 3D in PostGIS.

 

I do check the dimensions of the geometries to be written using DimensionsExtractor and convert them to be 3D using the 3D Forcer if they were effectively 2D.

 

 

Does anybody have a hint for me? I expecially wonder what this lwcollection might be?
Hi,

 

 

lwcollection is an internal object in PostGIS.

 

 

What happens if you set "Bulk copy insert" to NO on the Writer?

 

 

You might also try to set "Insert WKT" to YES, but expect it to be much slower.

 

 

Also, try to insert an inspection point on the last connector before the Writer. This will enable you to stop and inspect the offending geometry to check for problems.

 

 

Interlis can sometimes be tricky (depending on the model) as it is possible to "hide" the geometries inside a list (for multi-part support), etc. Using Inspectors, make sure that your geometries are correctly displayed before you output them to the writer.

 

 

David
Thank you for your ideas, David!

 

 

Neither 'Bulk copy insert' to NO, nor 'Insert WKT' to YES could solve the problem.

 

 I am still trying to find a insertion point definition that will show me the offending object, since I do not get any information on that object's attributes in the error message. However, when I redirect to visualizer, everything looks fine so far...
I can see how this is a case that can be a challenge to debug. A couple of things to try:

 

  • If you are writing to an existing table, you might also try to write to a new (temporary) table.
  • Try dropping and re-creating the GIST (spatial) index on the existing table.
David
Neither dropping the spatial index nor writing to a new table could solve the problem. I am still in need of a solution...
So far, I found out, that the 3DForcer does not seem to work correctly. There are still some 2D features around.

 

 

I changed the PostGIS constraints to 2D and replaced the 3DForcer by a 2DForcer, now all features are written.

 

 

Now I have to find out how I can get the 3DForcer to working as desired...
Hello,

 

 

I recently encountered with the same problem with the error message when writing to PostGIS database, geometry (linestring).

 

 

The geometry in my case had to be 3D line, but instead there were also lines wich had more segments and that is why the import wasn't succesful.

 

 

Filtering with the transformer PartCounter you could distinguish geometry with more than one line segment in the geometry.

 

 

Irena
Hi,

 

 

I just ran into the same error.

 

 

Apparently (according to this source code from PostGIS: https://github.com/fredj/postgis/blob/master/liblwgeom/g_serialized.c) it's got something to do with a collection object with a member object with a different dimension than that of the collection object itself.

 

 

I'm still looking into why such objects are present at all.

 

 

Lars

Reply