Skip to main content
Solved

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

  • October 16, 2023
  • 1 reply
  • 58 views

aron
Supporter
Forum|alt.badge.img+16
  • Supporter

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.

View original
Did this help you find an answer to your question?

1 reply

nielsgerrits
VIP
Forum|alt.badge.img+52
  • VIP
  • 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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings