[Qgis-user] Esri file geodatabase into spatiallite to be edited

Donovan Cameron sault.don at gmail.com
Wed Dec 9 15:41:09 PST 2015


Hey Lene,

And if you wanna get command line crazy, ogr2ogr, a utility from GDAL 
can do the conversion in one step but like Randal said, subtypes and 
domains are lost (these can be converted to tables from ArcGIS if 
available and joined later in QGIS).

ogr2ogr --config OGR_SQLITE_SYNCHRONOUS OFF \
--config OGR_SQLITE_CACHE 1024 \
-progress \
-gt 65536 \
-a_srs "EPSG:123456" \
-f SQLite output.sqlite input.gdb \
-dsco SPATIALITE=YES \
-lco FORMAT=SPATIALITE \
-nlt PROMOTE_TO_MULTI \
-dim 2

OK. So some notes on the above command!

You will want to change the -a_srs to an EPSG the FileGDB data is 
actually in (this "assigns" the projection, and doesn't actually 
re-project/transform the data). Sometimes its usually safe to even 
exclude this all together but you have to check the data in the output 
spatialite database, after it's been imported to see if the projection 
was assigned properly - so I include it from the get to so I don't have 
to re-upload if there are errors.

The -nlt option can be changed to the actual geometry type of the data 
(ie, POINT vs MULTIPOINT). Currently it just imports all geospatial data 
as a multi-type feature because RDBMS have strict checks for geometry - 
the lazy mans way.

You can also remove the -dim option if you have some 3D geometries, 
otherwise I use it when geometries have no Z-Value.


Any questions, let me know.




Donovan

On 09/12/15 11:52 AM, Randal Hale wrote:
> You could open the File Based Geodatabase with the openfileGDB driver 
> and save one of the feature classes to a Spatialite database. You can 
> use the DB Manager to import the rest of the layers. It seems to work 
> pretty well.
>
> If the FileBasedGeodatabase has relations/subtypes/domains etc those 
> won't be pulled over.
>
> I wouldn't be surprised if there was a one line gdal command to move 
> it all at once.
>
> Anyway, my .02 cents worth. Good Luck!
>
> Randy
>
>
>
> On 12/09/2015 01:20 PM, Lene Fischer wrote:
>> Hi,
>> I got a question today from a user in Iceland:
>>
>> is it possible to import esri file geodatabase into spatiallite to be 
>> edited?
>>
>> I know nothing about this - does any of you cleaver people :-)
>>
>> Regards
>> Lene Fischer
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>

-- 
Kind regards,

Donovan




More information about the Qgis-user mailing list