Skip to main content
Question

Why is the column GEOM not displayed when connecting to MSSQL database?


Forum|alt.badge.img

I am trying to access the GEOM column from a MSSQL 2012 Database using FME 2017. I have tried with the ADO, JDBC_Nonspatial und Spatial drivers. In table-view the column GEOM is never exposed. Do I have to manually expose the geometry column? If so, how?

4 replies

david_r
Celebrity
  • April 9, 2018

I just did a couple of tests and can confirm that the geometry column doesn't show in any of the readers. I suspect the "geometry" data type isn't supported as a regular column by FME.

However, you can use a SQLExecutor as a workaround:

select *, [geom].STAsText() as [geom_wkt]
from [my_user].[my_table]

This will include the WKT (OGC Well-Known Text) representation of the "geom" column in a new column called "geom_wkt", which will be visible in FME.


Forum|alt.badge.img+2

In FME 2018 I can get FME to recognize the GEOM column using the SQL Server Non-Spatial ADO reader, but only as binary. SQL Server JDBC non-spatial reader does not seem to recognize the GEOM column. So I think David's suggestion to use SQLExecutor and keep the geometry as WKT using STAsText() is the way to go.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • April 16, 2018

I agree with the SQL statement by @david_r, but I would use the SCLCreator transformer instead of a SQLExecutor.


david_r
Celebrity
  • April 17, 2018
erik_jan wrote:

I agree with the SQL statement by @david_r, but I would use the SCLCreator transformer instead of a SQLExecutor.

Good call, I agree.

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