Need help with uploading shapefile with srid 102008 to SQL server 2012. I ran the ogr2ogr script in the ogr shell and it uploaded the shapefile within seconds but when I try using python subprocess to call ogr, I get an empty
spatial_ref_sys and geometry column table added to SQL server 2012 database. I should add that I have read write access to the database .
Here's my script-
import os import sys import subprocess # Set OGR2OGR environment gdal = r'C:\Program Files (x86)\GDAL' gdalData = r'C:\Program Files (x86)\GDAL\gdal-data' os.environ['PATH'] = gdal + ';' + os.environ['PATH'] os.environ['GDAL_DATA'] = gdalData indriver = "MSSQL:server=<server>;database=<database>;trusted_connection=yes" ogr2ogr = r'C:\Program Files (x86)\GDAL\ogr2ogr.exe' cmd = '-f MSSQLSpatial' proj_cmd = '-a_srs' proj = "EPSG:102008" reName_cmd = '-nln' reName = 'NewName' shp = path = r'H:\NA\20151226_LNAD83.shp' translateFile_tx =' '.join([ogr2ogr, cmd, indriver, shp]) subprocess.call(translateFile_tx) print 'Done'