Skip to main content
Solved

FeatureWriter PostGIS writes generic geometry column


nielsgerrits
VIP
Forum|alt.badge.img+52

Heya FME specialists, another PostGIS question:

As a start I have a PointZ PostGIS table created with a PostGIS writer in workbench.

Next I have a very simple workbench to duplicate some PostGIS tables from the production server to my local server for offsite development / analyses:

0684Q00000ArDrUQAV.png

0684Q00000ArE7VQAV.png

I use a PostGIS FeatureReader with schema and generic because I want to dynamically create a clone of the table which is altered (data AND schema) in production without having to update readers and writers. This works wonderful!

The one problem I have is that the geometry column definition changes from PointZ to GeometryZ:

Original:

(  pkey serial NOT NULL,  the_geom geometry(PointZ,28992),  CONSTRAINT testpoint_pkey PRIMARY KEY (pkey))

Duplicate:

(  pkey integer NOT NULL,  the_geom geometry(GeometryZ,28992),  CONSTRAINT testpoint_pkey PRIMARY KEY (pkey))

I double checked to make sure the Create Generic Spatial Columns parameter is unchecked. Do I need to change another parameter or do I forget a crucial step? I attached workbenches in zip for reproduction.

FME Desktop 2016.1.1.0 (20160722 - Build 16609 - WIN32)

 

POSTGIS 2.1.2 (r12389)

---

Update what I tried:

In the FeatureWriter parameters, tab General, Geometry setting; From Schema Definition (original), First Feature Defines Geometry Type, postgis_point, postgis_none. The result is always a GeometryZ geometry column. Even with Dynamic Properties checked off.

Added the table as Workspace Resource combined with above settings. Still GeometryZ column.

This feels buggy to me but not a terrible problem for now as I can work around it.

---

Update filed support case:

Submitted 12-08-2016 - C118797.

Best answer by fmelizard

My apologies for not posting earlier. I did send an email to you @nielsgerrits as well. This is a known issue and we do have it logged in our system as needing to be addressed. We will post back to here once it has been fixed.

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

todd_davis
Supporter
Forum|alt.badge.img+20
This is only a guess, but I suspect it is because you have the featurewriter geometry set to "From Schema Definition" and that the fme geometry doesn't necessary align directly with postgis point geometry. You can set that geometry as "postgis_point" and I suspect it will do what you want.

 

 

If you do want to do it dynamically, then load the relevant PostGIS table as a "Reader as a Resource" and then choose that as your "Schema Sources" rather than "Schema from Schema Feature"

 

 


nielsgerrits
VIP
Forum|alt.badge.img+52
todd_davis wrote:
This is only a guess, but I suspect it is because you have the featurewriter geometry set to "From Schema Definition" and that the fme geometry doesn't necessary align directly with postgis point geometry. You can set that geometry as "postgis_point" and I suspect it will do what you want.

 

 

If you do want to do it dynamically, then load the relevant PostGIS table as a "Reader as a Resource" and then choose that as your "Schema Sources" rather than "Schema from Schema Feature"

 

 

Thanks for your input. I tried different values for the pulldown "Geometry" but the result is always GeometryZ no matter what. Learned something new with the "Reader as Resource" option, too bad this didn't work either. Will add this to the original question.

 


mark2atsafe
Safer
Forum|alt.badge.img+43
I've asked our developers to comment on this question. I'm not sure myself and I can't replicate the issue because I can't even set geometry type on my FME install! I'm a few builds behind so I will have to upgrade I guess.

 

 


nielsgerrits
VIP
Forum|alt.badge.img+52
mark2atsafe wrote:
I've asked our developers to comment on this question. I'm not sure myself and I can't replicate the issue because I can't even set geometry type on my FME install! I'm a few builds behind so I will have to upgrade I guess.

 

 

Do you have any updates about this issue Mark? The dynamic workbench works like a charm but the generic geometry column causes problems when exporting to shape...

 


fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • August 26, 2016

My apologies for not posting earlier. I did send an email to you @nielsgerrits as well. This is a known issue and we do have it logged in our system as needing to be addressed. We will post back to here once it has been fixed.


nielsgerrits
VIP
Forum|alt.badge.img+52
fmelizard wrote:

My apologies for not posting earlier. I did send an email to you @nielsgerrits as well. This is a known issue and we do have it logged in our system as needing to be addressed. We will post back to here once it has been fixed.

Thanks for the update. Somehow the mail is lost, happy to hear the issue is noticed!

 

 


damien
Forum|alt.badge.img
  • October 14, 2016

Hi,

I have exactly the same problem. I am using the version FME(R) 2016.0.1.0 (20160130 - Build 16174 - WIN64).

Do you know if this issue is fixed now ?

Thanks


nielsgerrits
VIP
Forum|alt.badge.img+52
damien wrote:

Hi,

I have exactly the same problem. I am using the version FME(R) 2016.0.1.0 (20160130 - Build 16174 - WIN64).

Do you know if this issue is fixed now ?

Thanks

I can still reproduce this in FME(R) 2016.1.2.0 (20160920 - Build 16673 - WIN64).

 

 


damien
Forum|alt.badge.img
  • October 18, 2016
nielsgerrits wrote:
I can still reproduce this in FME(R) 2016.1.2.0 (20160920 - Build 16673 - WIN64).

 

 

Ok thank you nielsgerrits.

 

 

I hope it will be fixed soon...

 

 


Forum|alt.badge.img

I have the same problem (I use FME 2017.1 Build 17532):

I want to write lots of feature types dynamically with the PostGIS writer but the writer only defines generic geometry types (geometry(Geometry,[SRID])) although in the Feature Type properties the parameter "Geometry" is set to "From Schema Definition". I need that the specific geometry types from the reader (Point, Line, Polygon...) are preserved.

1. Will the issue be fixed any time soon?

2. Is there a workaround so that the geometry types from the reader can be perserved? It seems that the parameter mentioned above can't be fed by a user parameter.

Thanks.


worjak
Contributor
Forum|alt.badge.img+3
  • Contributor
  • July 5, 2023

Is this filled as a bug? We have exact same behaviour. If we dynamically write all specific geometry types from one postgis db to another postgis db. They go from geometry(point) to geometry(geometry), geometry(linestring) to geometry(geometry), geometry(polygon) to geometry(geometry) and so on. We use FME(R) 2021.2.2.0 (20220106 - Build 21806 - WIN64)


nielsgerrits
VIP
Forum|alt.badge.img+52
worjak wrote:

Is this filled as a bug? We have exact same behaviour. If we dynamically write all specific geometry types from one postgis db to another postgis db. They go from geometry(point) to geometry(geometry), geometry(linestring) to geometry(geometry), geometry(polygon) to geometry(geometry) and so on. We use FME(R) 2021.2.2.0 (20220106 - Build 21806 - WIN64)

@danatsafe​ can you check if case C118797 still exists and what the status is?


DanAtSafe
Safer
Forum|alt.badge.img+16
nielsgerrits wrote:

@danatsafe​ can you check if case C118797 still exists and what the status is?

Hi @nielsgerrits​ C118797 is related to FMEENGINE-9157 "PostGIS Writer: Using Dynamic schema ignores Generic Geometry / Lowercase Attributes settings" which is expected to be fixed for FME 2023.1


nielsgerrits
VIP
Forum|alt.badge.img+52
nielsgerrits wrote:

@danatsafe​ can you check if case C118797 still exists and what the status is?

Thanks Dan!


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