Skip to main content
Solved

Write to 'Primary Key' and 'geometry_column' in a Dynamic PostgisWriter?

  • October 16, 2023
  • 1 reply
  • 84 views

aron
Enthusiast
Forum|alt.badge.img+16

I am using a SchemaScanner to prepare a dataset for dynamic writing to a PostGISWriter. How do I write to the columns for PrimaryKey and Geometry in an dynamic environment?

Best answer by nielsgerrits

If you configured the FeatureWriter to be dynamic, you can add attributes in the tab User Attributes. Add a row with Name = pkey, Type = serial and Index = PrimaryKey and it will add this to all tables.

 

The geometrytype is an issue. The mapping in the PostGIS writer is always to generic geometry type, no matter what input geometry. So it will become...

geom geometry(Geometry,28992)

...and not...

geom geometry(Point,28992)

...which you probably need.

 

If I needed this now, I would use the SchemaFeature from the SchemaScanner to create the table using a SQLExecutor before the data features enter the FeatureWriter.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

nielsgerrits
VIP
Forum|alt.badge.img+62
  • Best Answer
  • October 16, 2023

If you configured the FeatureWriter to be dynamic, you can add attributes in the tab User Attributes. Add a row with Name = pkey, Type = serial and Index = PrimaryKey and it will add this to all tables.

 

The geometrytype is an issue. The mapping in the PostGIS writer is always to generic geometry type, no matter what input geometry. So it will become...

geom geometry(Geometry,28992)

...and not...

geom geometry(Point,28992)

...which you probably need.

 

If I needed this now, I would use the SchemaFeature from the SchemaScanner to create the table using a SQLExecutor before the data features enter the FeatureWriter.