Skip to main content
Solved

Linestring to geometry conversion

  • May 22, 2025
  • 2 replies
  • 48 views

fpakzat
Contributor
Forum|alt.badge.img+3

I need to transfer a PG table that has a geometry (line) field in below format, to another PG table on another database using FME. 

I know it’s already in the workable final format. 

If I just run queries as below and save results directly to the target database using DBeaver, it works fine.  

          geomfromewkt(comm_path_line_geo)::geometry as sp_geometry

 

But somehow it’s not working on FME to transfer from one to the other. I tried SQLExecutor alone and also with GeometryReplacer.

I tried queries inside SQLExecutor this way:

select geomfromewkt(comm_path_line_geo)::geometry as geometry from my_table

 

and this way:

select comm_path_line_geo::text from my_table  and then to process with GeometryReplacer

 

and also this way:
select comm_path_line_geo as sp_geometry         with this, the FME transformer would convert automatically convert it to binary geometry format but it’s not usable at the end tool. 

 

They all didn’t work. Can someone please help? I know this shouldn’t be that difficult because it's already there.  Thank you. 

 

Best answer by takashi

Hi ​@fpakzat ,

I think this query would work with SQLExecutor.

select geomfromewkt(comm_path_line_geo)::geometry as geometry from my_table

Make sure that these parameters setting in the transformer.

  • Format: PostGIS
  • Combine Geometry: Result Geometry Only

 

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.

2 replies

takashi
Celebrity
  • Best Answer
  • May 22, 2025

Hi ​@fpakzat ,

I think this query would work with SQLExecutor.

select geomfromewkt(comm_path_line_geo)::geometry as geometry from my_table

Make sure that these parameters setting in the transformer.

  • Format: PostGIS
  • Combine Geometry: Result Geometry Only

 


fpakzat
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • May 23, 2025

Hi ​@takashi , 

 

The solution worked fine this time especially the “Result Geometry Only” option.  Thanks a lot.