Skip to main content
Solved

Geom column in spatial databases


Forum|alt.badge.img

Hello,

I noticed while migrating some Shapefiles to MSSQL Spatial that there's a Geom column which is added. In which format it is encoded ? And does it countain all the spatial data required informations to restore and draw all the stored features ?

thank you

Best answer by david_r

If you look at the table definition in e.g. MS SQL Server Management Studio, you'll most proabably see that the column is of type "geometry", which is the native data type for geometry objects in SQL Server.

More info here:

https://docs.microsoft.com/en-us/sql/t-sql/spatial-geometry/spatial-types-geometry-transact-sql?view=sql-server-2017

If you're using an ArcGIS Geodatabase extension on top of SQL Server, things gets more complicated, see the bottom two paragraphs here:

https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-sql-server/sqlserver-spatial-types-and-arcgis.htm

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

4 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • May 24, 2018

The GEOM column is the default name for the geometry (point, line, area etc) that is stored in a spatial table.

The format it is stored in depends on the spatial database.

You can specify an alternative name for the column in the writer parameters.


david_r
Celebrity
  • Best Answer
  • May 24, 2018

If you look at the table definition in e.g. MS SQL Server Management Studio, you'll most proabably see that the column is of type "geometry", which is the native data type for geometry objects in SQL Server.

More info here:

https://docs.microsoft.com/en-us/sql/t-sql/spatial-geometry/spatial-types-geometry-transact-sql?view=sql-server-2017

If you're using an ArcGIS Geodatabase extension on top of SQL Server, things gets more complicated, see the bottom two paragraphs here:

https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-sql-server/sqlserver-spatial-types-and-arcgis.htm


Forum|alt.badge.img
david_r wrote:

If you look at the table definition in e.g. MS SQL Server Management Studio, you'll most proabably see that the column is of type "geometry", which is the native data type for geometry objects in SQL Server.

More info here:

https://docs.microsoft.com/en-us/sql/t-sql/spatial-geometry/spatial-types-geometry-transact-sql?view=sql-server-2017

If you're using an ArcGIS Geodatabase extension on top of SQL Server, things gets more complicated, see the bottom two paragraphs here:

https://pro.arcgis.com/en/pro-app/help/data/geodatabases/manage-sql-server/sqlserver-spatial-types-and-arcgis.htm

Thank you for the answer

 

Is it encoded in WKB in case of MSSQL ?

 

 


david_r
Celebrity
  • May 24, 2018
lianaolianov wrote:
Thank you for the answer

 

Is it encoded in WKB  in case of MSSQL ?

 

 

The geometry is encoded in a format native to SQL Server, as far as I know.

 

But you can cast the geom column to OGC WKB if you need, e.g.

 

select geom.STAsBinary() from my_table
See also: https://docs.microsoft.com/en-us/sql/t-sql/spatial-geometry/stasbinary-geometry-data-type?view=sql-server-2017

Reply


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