Skip to main content
Solved

How to convert ESRI st_geometry to geometry

  • March 25, 2021
  • 3 replies
  • 526 views

I have been able to connect with FME directly to the PostgreSQL database that holds the ArcGIS Portal host feature services. The features are stored as tables with a "shape" field holding the geometry. However, I can't figure out how to convert that shape field, which is labelled "st_geometry" into actual geometry. FME writes it to the data inspector as a text, for example, 280000000100000001000400E193040010000000010000009587C3B5B486AD0380BFE7BF9590AC13.

 

Thanks for your help.

Best answer by Anonymous

@Jim O'Leary​ are you using the Esri Geodatabase (ArcSDE Geodb) reader to access the database? Or you could probably use the Esri ArcGIS Portal Feature Service reader. The PostgreSQL or PostGIS readers won't recognise the st_geometry and will probably just read them as a blob.

Actually I found that I could use an SQLExecutor and the sde.st_totext function to transform the shape field to WKT like this:

select name,address, sde.st_astext(shape) as mypoint

from hsu_ds6o9.fire_halls12_fire_halls

Then I use the GeometryReplacer to replace the OGC Well Known Text to geometry.

The point doesn't know where it is, but it is actually in Web Mercator so I use a CoordinateSystemSetter to tell it that it is in EPSG:3857. Then because I want it in UTM83 10, I use the CsmapReprojector to reproject it to EPSG:26910.

 

I think I tried the Esri Geodatabase reader without success. I don't think the ArcGIS Portal Feature Service reader would work because it is not a feature service where I access it, just a table in a PostgreSQL database.

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.

3 replies

Forum|alt.badge.img+2
  • 1891 replies
  • March 25, 2021

@Jim O'Leary​ are you using the Esri Geodatabase (ArcSDE Geodb) reader to access the database? Or you could probably use the Esri ArcGIS Portal Feature Service reader. The PostgreSQL or PostGIS readers won't recognise the st_geometry and will probably just read them as a blob.


  • 0 replies
  • Best Answer
  • March 25, 2021

@Jim O'Leary​ are you using the Esri Geodatabase (ArcSDE Geodb) reader to access the database? Or you could probably use the Esri ArcGIS Portal Feature Service reader. The PostgreSQL or PostGIS readers won't recognise the st_geometry and will probably just read them as a blob.

Actually I found that I could use an SQLExecutor and the sde.st_totext function to transform the shape field to WKT like this:

select name,address, sde.st_astext(shape) as mypoint

from hsu_ds6o9.fire_halls12_fire_halls

Then I use the GeometryReplacer to replace the OGC Well Known Text to geometry.

The point doesn't know where it is, but it is actually in Web Mercator so I use a CoordinateSystemSetter to tell it that it is in EPSG:3857. Then because I want it in UTM83 10, I use the CsmapReprojector to reproject it to EPSG:26910.

 

I think I tried the Esri Geodatabase reader without success. I don't think the ArcGIS Portal Feature Service reader would work because it is not a feature service where I access it, just a table in a PostgreSQL database.


david_r
Celebrity
  • 8392 replies
  • March 26, 2021

Actually I found that I could use an SQLExecutor and the sde.st_totext function to transform the shape field to WKT like this:

select name,address, sde.st_astext(shape) as mypoint

from hsu_ds6o9.fire_halls12_fire_halls

Then I use the GeometryReplacer to replace the OGC Well Known Text to geometry.

The point doesn't know where it is, but it is actually in Web Mercator so I use a CoordinateSystemSetter to tell it that it is in EPSG:3857. Then because I want it in UTM83 10, I use the CsmapReprojector to reproject it to EPSG:26910.

 

I think I tried the Esri Geodatabase reader without success. I don't think the ArcGIS Portal Feature Service reader would work because it is not a feature service where I access it, just a table in a PostgreSQL database.

This is the solution I would have suggested also. You could also consider using sde.ST_AsBinary() to convert to WKB, then set the GeometryReplacer to OGC Well-Known Binary. It is a bit more efficient than WKT.