Skip to main content
Solved

Geometry recovery from SQLCreator Postgis

  • July 27, 2017
  • 2 replies
  • 34 views

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.

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.

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 "