Skip to main content
Solved

Linestring to geometry conversion


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

 

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

2 replies

takashi
Influencer
  • 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. 


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