Skip to main content

Using FME Desktop 2013 Build 13262 on a Win 7 Pro 64 Bit environment, I obtain polygon as well as curvepolygon objects from within one and the same INTERLIS table as source. I want to write to a PostGIS 2.0 table where the feature representation is defined as:

 

 

(..)

 

geometrie geometry

 

CONSTRAINT enforce_dims_geometrie CHECK (st_ndims(geometrie) = 2),

 

CONSTRAINT enforce_geotype_geometrie CHECK (geometrytype(geometrie) = 'CURVEPOLYGON'::text OR geometrie IS NULL),

 

(..)

 

 

From FME I obtain the below error message:

 

 

Error executing SQL command ('INSERT INTO "gueterzettel"."dmg24bodnkung_boflaeche" ("t_id", "t_type", "qualitaet", "art", "t_lastchange", "t_createdate", "t_user", "entstehung", "geometrie") values (456600001, E'4566_590011997', E'AV93', E'Gebaeude', NULL, NULL, NULL, E'410000050', GeomFromEWKT('SRID=2056;POLYGON ((2710489.569 1267666.833,2710484.868 1267671.265,2710482.748 1267669.017,2710480.423 1267666.55,2710481.529 1267665.507,2710478.463 1267662.283,2710481.285 1267659.603,2710484.121 1267656.911,2710487.337 1267653.76...'): 'ERROR: new row for relation "dmg24bodnkung_boflaeche" violates check constraint "enforce_geotype_geometrie"

 

 

According to the PostGIS documentation "A CURVEPOLYGON is just like a polygon, with an outer ring and zero or more inner rings. The difference is that a ring can take the form of a circular string, linear string or compound string.".

 

How can I make FME write the pure polygon features correctly to the PostGIS curvepolygon table?
Hi,

 

 

what happens if you set the attribute "postgis_type" to the string "postgis_curvepolygon" just before the writer?

 

 

See also here for alle the possible values.

 

 

David
Thank you for your idea, David!

 

 

I added an AttributeCreator immediately before the PostGIS writer, creating an attribute named 'postgis_type' with the default value 'postgis_curvepolygon'.

 

Result and error message are the same as before, still polygons around.

 


Then I would try a a GeometryCoercer with some different values, but I suspect that this would ultimately be a case for the Safe support team.

 

 

Unless someone here has some other suggestions, of course...

 

 

David
By the way, have you tried to uncheck the option "Create generic spatial columns" when you create the Writer? That will enable you to explicitely set the output geometry types, such as "postgis_curvepolygon". That might be better than setting "postgis_type".

 

 

See this article for more details, under the heading "Geometry support updates".

 

 

Let us know how it works out!

 

 

David
Leaving the writer option "Create generic spatial columns" unchecked and setting the feature's allowed geometries to 'postgis_curvepolygon' explicitly is what I have tried, too. It did not change result and error message.

 

 

I have also tried the GeometryCoercer with various geometry types, no success.

 

 

I will contact the Safe support team with this issue...
Done:

 

Safe support case No. C75151

Reply