Skip to main content
Question

Dynamic featureWriter - PostGIS Format : force native geometry type

  • June 5, 2026
  • 3 replies
  • 43 views

arthur_bazin
Contributor
Forum|alt.badge.img+19

I have mixed data that includes lines, polygons, curves and curved_polygons.

I want all these features to go into my PostGIS databases, two tables :

  • “my_lines” defined as geometry(multicurve)
  • “my_surfaces” defined as geometry(multisurface)

Here some remind about Postgis geometries : 

  • multicurve geometry type allows you to store polylines and curves in the same column
  • multisurface geometry allows you to store polygons and curve polygons in the same column

Here is an blog post I wrote on the sibject : https://blog.arthurbazin.com/sig/bien-demarrer-avec-les-sig#types_de_geometries

For reading, no problem at all for FME. For writing, I can specify the geometry type :

If I have polygons, they are casted as multisurfaces and all is good.

But when it comes to dynamic, how can I achieve to set this parameter dynamically ? 

I’ve try to use “from first feature” but curvedpolygons objects (even if I cast them to multi) are not mapped to multicurve ou multisurface and I can have polygons as first features (I can not control the order).
Note : for cuves (lines), you can use the pathBuilder to convert it into geometries that will be cast to postgis_multicurve. But nothing for polygons :-(

I’ve try to use “from schema definition” but I can not find a fme_geometry_type that correspond to postgis_multisurface or postgis_multicurve.

I’ve looked into the Postgis.fmf metafile but it seems there is no specific geometry type mapping.

So, is there a way to define a native geometry datatype to use with a dynamic writer ?

3 replies

j.botterill
Influencer
Forum|alt.badge.img+58
  • Influencer
  • June 8, 2026

No — you can’t directly define a PostGIS “native geometry datatype” (e.g. MULTISURFACE, MULTICURVE) in a fully dynamic writer.

The schema (including geometry type) is derived from:

  • input data
  • first feature
  • or a supplied schema definition

There is no fme_geometry_type value that maps cleanly to:

  • postgis_multisurface
  • postgis_multicurve

Maybe a workaround is a GeometryFilter leading into multiple FeatureWriters that has the geometry definition explcitly defined, rather than use first geometry

NOTE> in Form 2026.1 the spatial definition on a writer has changed… its now under the User parameters. Read up more here Introducing Spatial and Geometry Definition Tables in FME – FME Support Center


arthur_bazin
Contributor
Forum|alt.badge.img+19
  • Author
  • Contributor
  • June 9, 2026

Hi ​@j.botterill,

Thank you for your answer !

I’m currently using the workaround you propose but this is unelegant :-)

I was searching for some king of black magic were you put a magic formula in a specific fme_field and “voila”…

I will create an idea for that.

Thank’s


arthur_bazin
Contributor
Forum|alt.badge.img+19
  • Author
  • Contributor
  • June 9, 2026

Link to the idea :