Hi there,
Creating many workbenches over the years, and this is very rarely a problem.
But it is very rarely a problem because FME automagically selects the postgres writer writes the data using the correct geometry type, not because I have been able to specify.
However, here i have a workbench reading in spreadsheet data using a [vertex creator] on the X/Y columns, but when I write the data out to postgis/postgres i find that it arrives there in linestring format. At least, QGIS then sees the layers as linestring!
What is super wierd, is that this workbench has been reused for several years, each year with the postgis writer being modified to create a new table for the years data. All previous years it has created point data, this year it has decided on polygon. This happens when i modify the workbench in FME 2022.1.3, or in the current FME 2024.2.3.
So, obviously this is unsatisfactory, and I want to be able to tell FME to create that postgres.postgis table with the geometry type of point/linestring/poly/multi-x/etc.
Why is this impossible to do so?
It feels like it ought to be a function in the postgis writer, but it is not there.
This documentation indicates it might be a functions of the database connection:
PostGIS Writer Parameters
“Create Generic Geometry Columns
This setting applies at generation time, not at translation time. The default setting of "no" indicates that you want to create geometrically constrained geometry columns on the destination tables. For example, a POINT geometry table would be restricted only to points. Now you have the option to create generic or non-constrained geometry column types.
Effectively this means you can insert multiple geometry types into one table. Specifically the geometry column is created to have the generic type GEOMETRY and there are no constraints placed on the geometry types allowed.”
However, I cannot find a “Create Generic Geometry Columns” parameter anywhere in the database connection here.
Questions:
- Why does FME mostly get it right, but sometimes wrong?
- Why isn’t selecting a geometry type an easily accessible parameter?
- Where am I going wrong, and how do I rectify matters?
Kind regards. M