Skip to main content
Question

Geometry from SQL executor

  • June 5, 2019
  • 4 replies
  • 454 views

Hello,

I often use SQL creator and SQL executor to extract data of my dB.

My select-queries always include the oracle geometry (stored in a SHAPE column).

However, I noticed only in some cases the geometry is extracted in my workflow.

I have, to this day, not been able to understand in which cases this works and in which it doesn't (I then add a feature merger to re-append the geometry to the features).

Can someone explain this to me?

Thank you

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

david_r
Celebrity
  • 8392 replies
  • June 5, 2019

I don't know what the criteria is for FME to automatically recognize the geometry column, but my go-to workaround is to cast the geometry to WKB and unpack it manually in FME.

Example (for SDE in this case):

select attr1, attr2, sde.st_asbinary(shape) as wkb
from mytable

You can then join it to a GeometryReplacer set to parse the "wkb" column output as OGC Well-Known Binary.


steveatsafe
Safer
Forum|alt.badge.img+13
  • Safer
  • 422 replies
  • June 12, 2019

Hi @tsirkuselab, I was chatting with our Developer on this and it is a strange space... "some formats can do it, others need help, others not so much.". That's the state of this workflow. If you find yourself having some issues getting a geometry extracted in this way let us know the format you are working with. There may be away to solve it and there may not be.

Unfortunately there is an inconsistency across formats for this scenario.

To the readers of this post: I'm not sure how much folks use these transformers for this and I'd be curious to learn if you are.

So to anyone reading this... please let us know if this is a workflow you make use of. Maybe we can look at improving the experience by ensuring it is clear what formats are supported and what formats are not.

If you have examples, like David's above from your own workflows please share.


fbastian73
Contributor
Forum|alt.badge.img+12
  • Contributor
  • 20 replies
  • June 23, 2021

Hi @tsirkuselab, I was chatting with our Developer on this and it is a strange space... "some formats can do it, others need help, others not so much.". That's the state of this workflow. If you find yourself having some issues getting a geometry extracted in this way let us know the format you are working with. There may be away to solve it and there may not be.

Unfortunately there is an inconsistency across formats for this scenario.

To the readers of this post: I'm not sure how much folks use these transformers for this and I'd be curious to learn if you are.

So to anyone reading this... please let us know if this is a workflow you make use of. Maybe we can look at improving the experience by ensuring it is clear what formats are supported and what formats are not.

If you have examples, like David's above from your own workflows please share.

hi Steve,

I came across this today.

I am using FME 2019 version and connecting to MS sql server using sql creator to access the table with geometry and then linking to another table with no geometry. The geometry then is lost in transition.

Are there any developments since this post? or perhaps the newer versions have fixed this?

thanks in advance.

 


Forum|alt.badge.img+2
  • 1891 replies
  • June 24, 2021

@tsirkuselab​ I think in most cases the geometry will get picked up from the first table referenced in your SQL query. So if you're doing a join and the join table has you're geoemtry, then you'd have to CAST as @david_r​ suggests