Skip to main content
Solved

Geometry recovery from SQLCreator Postgis


Hi,

When I precise some attributes into a PostGIS SQLCreator (including the geometry) in the SQL request “SELECT id, geom FROM test”, FME doesn’t recognize the geometry. Its is only seen as attribute, but not the geometry of the feature. It only finds the geometry with “SELECT * FROM test”. Do you know what can cause this error ?

Best answer by david_r

I just tried here using FME 2017 and it works. Are you sure that your geometry column has been registered properly in PostGIS? Check that your table appears when you execute this:

SELECT *
FROM public.geometry_columns

Alternatively, you can cast your geometry column as e.g. WKB:

select id, ST_AsBinary(geom) as geom
from test

After the SQLCreator, insert a GeometryReplacer on the attribute "geom" using geometry type "OGC well known binary". Choose to remove the attribute to save memory, you probably don't need it anymore.

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

2 replies

david_r
Celebrity
  • Best Answer
  • July 27, 2017

I just tried here using FME 2017 and it works. Are you sure that your geometry column has been registered properly in PostGIS? Check that your table appears when you execute this:

SELECT *
FROM public.geometry_columns

Alternatively, you can cast your geometry column as e.g. WKB:

select id, ST_AsBinary(geom) as geom
from test

After the SQLCreator, insert a GeometryReplacer on the attribute "geom" using geometry type "OGC well known binary". Choose to remove the attribute to save memory, you probably don't need it anymore.


  • Author
  • July 28, 2017

I work with FME(R) 2016.1.2.1 (20160929 - Build 16674 - WIN64) and my table appears correctly in public.geometry_columns with good attributes. More specifically it's when I add a join in the request that it loses the geometry : "SELECT test.geom FROM test INNER JOIN all ON test.id = all.id "


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