Skip to main content
Solved

SQL creator does not read geometry

  • January 28, 2020
  • 4 replies
  • 180 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.

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

4 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • 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
  • 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
Evangelist
  • 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
  • January 29, 2020
david_r wrote:

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


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