[gdal-dev] Using ogr2ogr to import from FileGDB to MSSQL

Sacha Black sacha.black at gmail.com
Fri Aug 4 18:20:50 PDT 2017


Hello,

I have a problem using ogr2ogr (OSGeo4w w gdal 2.2.1-1) to import from
FileGDB (10.5) to MSSQL (2016).

My process:

I used SQL Server Mgmt Studio to create a blank table "new_layer_name", an
add a single geometry column named "ogr_geometry". I am the owner of this
table.

My ogr2ogr connection to MSSQL is a success, and after running my table is
populated with correct fields and attributes.

My problem:

In the end, my geometry column is containing only NULL values.

More details:

The ogr2ogr command I am using is:

ogr2ogr -overwrite -f MSSQLSpatial "MSSQL:server=xxx\xxx;driver
=SQL
Server;database=xxx;trusted_connection=yes;UID=xxx;PWD=xxxx;GEOM_TYPE=geometry;GEOMETRY_NAME=ogr_geometry;OVERWRITE=YES"
"xxx.gdb" -geomfield ogr_geometry -preserve_fid -nln new_layer_name -nlt
MULTIPOLYGON  -lco "G
EOM_TYPE=geometry" -lco "GEOM_NAME=ogr_geometry" -a_srs EPSG:4326
-skipfailures -progress

Any ideas for my mistake?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170804/21f6ad5c/attachment.html>


More information about the gdal-dev mailing list