Skip to main content
Solved

SQL creator does not read geometry

  • January 28, 2020
  • 4 replies
  • 263 views

so_much_more
Supporter
Forum|alt.badge.img+6

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....

Best answer by erik_jan

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.

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.

4 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • Best Answer
  • January 28, 2020

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.


so_much_more
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 46 replies
  • January 29, 2020

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.


david_r
Celebrity
  • 8392 replies
  • January 29, 2020

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.


so_much_more
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 46 replies
  • January 29, 2020

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.