I have some tables in MS SQL Server (2012) with WKT string columns.
I want to export these data to a MapInfo tab file.
Currently I am using the following command:
ogr2ogr -f "MapInfo File" testsql.tab "MSSQL:Server=etc." -sql "select geography::STGeomFromText(FACE,4326),NAME from TABLE" -a_srs "EPSG:4326"
Where FACE is a string column containing WKT geometries.
This gives some problems, because the coordinates are switched. This is supposedly due to a change between SQL Server 2008 and 2012. Outputting it to WKB works better.
I was wondering if it is possible that ogr2ogr uses the WKT column directly without converting it to the MS SQL Spatial type first?
Best Answer
Have you tried accessing the database directly from MapInfo Professional or do you not have access to MapInfo Professional?
You could try:
I have shared the slides from a session on how to use SQL Server 2008 with MapInfo Pro. You can find the slides here: MI Pro and SQL Server 2008 or on Slideshare