I'm having trouble using the ogr2ogr tool on the command line. My data is stored in SQL as binary, type is mixed polygons and multipolygons. I am using the following command for conversion from SQL to shapefile:
ogr2ogr -f "ESRI Shapefile" "H:\PolandSQLQuery\test_shp\test3.shp" "ODBC:USERNAME/PW@SERVERNAME" -sql "SELECT TOP 1 ID, GEOMETRY::STGeomFromWKB([polygon].STAsBinary(),4326) FROM [eQUIP75CEEFloodCzechRepublic].[dbo].[CZ_Hist2002_3308238]" -overwrite -nlt POLYGON -a_srs "EPSG:4326"My error message is:
ERROR 6: Can't create fields of type Binary on shapefile layers.I have tried numerous things, such as STGeomFromText and .ToString() conversion et al. I am using GDAL 1.11.1 (2014/09/24) with the newest MS SQL driver.
Any ideas?
أكثر...
ogr2ogr -f "ESRI Shapefile" "H:\PolandSQLQuery\test_shp\test3.shp" "ODBC:USERNAME/PW@SERVERNAME" -sql "SELECT TOP 1 ID, GEOMETRY::STGeomFromWKB([polygon].STAsBinary(),4326) FROM [eQUIP75CEEFloodCzechRepublic].[dbo].[CZ_Hist2002_3308238]" -overwrite -nlt POLYGON -a_srs "EPSG:4326"My error message is:
ERROR 6: Can't create fields of type Binary on shapefile layers.I have tried numerous things, such as STGeomFromText and .ToString() conversion et al. I am using GDAL 1.11.1 (2014/09/24) with the newest MS SQL driver.
Any ideas?
أكثر...