Solved

I'm working with a geometry in wkt. I would like to convert to lat, long and elev using FME. I can do conversion using SQL using "select ST_AsText(geom)". I've tried the geometry extractor translator and it just gives errors. There is an example be

  • 13 January 2023
  • 5 replies
  • 23 views

Badge

Line:

01020000A0E610000005000000E040A17B843554C0C987F51E7593414000000000000000006CDB4900853554C0AFD3A0F17893414000000000000000002D2683FB813554C0D677B1BD8E93414000000000000000005A484B8E7F3554C025457646AB9341400000000000000000C4B449797B3554C01A0A32C8AC9341400000000000000000

 

Using SQL the wkt converts to these 5 points: 

 -80.83621111628918 35.15201174725332 0,

-80.83624274456605 35.15212841370464 0,

-80.83605850036174 35.1527936092895 0,

-80.83591039039439 35.15366440558345 0,

-80.83566124151099 35.15371038859685 0

 

Lat and long are also reversed in the output. I would like to do this conversion in FME for spatial analysis of the full data base.

 

Thank you,

Matt

 

icon

Best answer by geomancer 13 January 2023, 11:36

View original

5 replies

Userlevel 5
Badge +25

You can use the CoordinateSwapper to swap lat/lon, see http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/coordinateswapper.htm for an example.

Badge

But how do you read wkt in fme and write to lat, long, elev. ​ I have not been successful with this. I can only get it to work in sql.

Userlevel 4

My preference would be to cast the geometry column to WKB (if possible, it's more efficient than WKT) in SQL and then use the GeometryReplacer set to WKB in your FME workspace to rebuild the actual geometry. Finally, use e.g. the CoordinateExtractor to get the numerical values for each vertex.

Userlevel 4
Badge +36

Your input data turns out to be in HEX Encoded OGC Well Known Binary format.

HEX-Encoded_WKB

Badge

Your input data turns out to be in HEX Encoded OGC Well Known Binary format.

HEX-Encoded_WKB

Thank you! I'm back in business!

Reply