GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 54
Registered: ‎09-23-2019
Accepted Solution

How to import ESRI SHP to MS SQL Server with native geometry columns

I'm using GM 2020 update 1 and MS SQL 2014 SP2. I want to upload a an ESRI SHP to this MSSQL using GM.

For this purpose, I've made a Meatadata tables for the DB using Database Utilities; and then GM Output to feature classes. This two operation were made using the SQL SERVER connection (not the SQL SERVER SPATIAL!).

The outcome is a table with no native geometry types but with 1 BINARY field (for the geometry) and 4 FLOAT fields (for the MBR I think...). This table can be read as a spatial layer using GM while by QGIS and M.App Enterprise is only recognised as alpha-numeric table with no geometry.

 

How can I import ESRI SHP to MSSQL with output table having native geometry fields?

 

imported ESRI SHP fields.png

Highlighted
Contributor
Posts: 54
Registered: ‎09-23-2019

Re: How to import ESRI SHP to MS SQL Server with native geometry columns

I've also tried to create a new point feature using GM. This also resulted with non-native geometry columns whic aren't recognised nor by MAE nor by QGIS.

new feature by GM.png

Highlighted
Technical Evangelist
Posts: 557
Registered: ‎09-11-2015

Re: How to import ESRI SHP to MS SQL Server with native geometry columns

Hi Eran,

 

"SQL Server Read-Only/Read-Write" is an old DB connector developed far before MS introduced the spatial objects within the SQL server. That's why it does not use the spatial module at all and the geometries are stored as a binary field in proprietary INGR format. The XLO etc. fields are actually helper fields to mimic spatial index.

 

If you want to use the spatial capabilities of MS SQL server, you need to use the "SQL Server Spatial Read-Write" connector.

 

Pavel

Highlighted
Contributor
Posts: 54
Registered: ‎09-23-2019

Re: How to import ESRI SHP to MS SQL Server with native geometry columns

Thank you Pavel Smiley Happy Just figured it out myself.

 

The problem was that I created metadata tables for the SQL SERVER connection type which prevented me of using the SQL SERVER SPATIAL connection type. I needed to delete these undesired tables and only after that, to create metadata tables using the SQL SERVER SPATIAL connection type.