When using SQL Executor or SQL Creator with a PostGIS reader on our Postgres datawarehouse I run into problems with spatial queries.
Example given this query:
select
table1.name
, table2.whatever
, table1.geometry
from table1
join table2 on ST_Intersects(table1.geometry, table2.geometry)
this works only if the two tables are of a different geometry type (e.g. Polygons and Points). If they are both Polygons, FME does not recognise the geometry anymore. The geometry field from the output features does have content but when connected to a GeometryFilter the type is 'Null'.
There is a workaround, when using a 'with' statement, like so:
with polygons as
( select * from table1 )
select
polygons.name
, table2.whatever
, polygons.geometry
from polygons
join table2 on ST_Intersects (polygons.geometry, table2.geometry
Then, FME does recognise the geometry and displays them correctly (geometry coming from 'polygons' and thus, from 'table1')
Is there anything I can check on our Postgres environment that might be causing this? Should my spatial query be different? or is this a bug in FME?
Using FME 2021.1.3.0 (20211002 - Build 21631 - WIN64)
Thanks in advance!