Skip to main content

I am running a query similar to below, but FME does not recognise the geometry, at least it does not show geometry in the inspector, only tabular data with my geom column with binary as string?

 

I have also cased the geometry to EWKT and WKT, but I cannot find how I can make FME create geometry from either WKT or EWKT so I can continue with my workflow?

select ST_Union(Geometri_SPA) as geom from x
where ....
UNION
select ST_Union(Geometri_SPA) as geom from x
where....
UNION
select ST_Union(Geometri_SPA) as geom from x
where....

What format are you using in the SQLCreator.

For a geometry to be returned it needs to be a spatially enabled format, like Oracle Spatial Objects or Microsoft SQL Server Spatial.

If you case the geometry to be WKT, you can use the GeometryReplacer transformer to convert the WKT to a geometry.

Hope this helps.


Sorry forgot to say the source is postGIS with a geometry type column. I did use the GeometryReplacer in the end, that worked. But worked only for WKT not EWKT.


I would recommend to not use WKT and rather go for WKB (well-known binary). There is less data to transmit and it seems to have better support for more complex geometry types. It's probably also somewhat faster.

You can use the PostGIS function ST_AsBinary() to cast the geometries as WKB:

https://postgis.net/docs/ST_AsBinary.html

In FME, use the GeometryReplacer set to OGC Well-Known Binary to parse the geometry.


I would recommend to not use WKT and rather go for WKB (well-known binary). There is less data to transmit and it seems to have better support for more complex geometry types. It's probably also somewhat faster.

You can use the PostGIS function ST_AsBinary() to cast the geometries as WKB:

https://postgis.net/docs/ST_AsBinary.html

In FME, use the GeometryReplacer set to OGC Well-Known Binary to parse the geometry.

Thanks for the tips! I will try that instead. In this partiuclar case the data content i quite limited, but I will definately have use for it for larger dataset.


Reply