[GRASS-user] Import sqlite table using db.in.ogr

Markus Metz markus.metz.giswork at gmail.com
Thu Aug 4 00:46:40 PDT 2016


On Wed, Aug 3, 2016 at 11:04 PM, Johannes Radinger
<johannesradinger at gmail.com> wrote:
> Hi all,
>
> the database is the original sqlite database the ships with the the NC
> grass7 location (nc_spm_08_grass7). I want to import a single table (e.g
> 'streams') from that NC grass7 database (source, sqlite) into my new
> location (target) using db.in.ogr. As far as I understand, for the module
> db.in.ogr the database scheme of the target location should not be of
> relevance?! Interestingly, the database scheme (either sqlite, dbf etc) of
> the source db/table is not explicitly specified in db.in.ogr?!

OGR recognizes the driver automatically.

>
> Have you tried to import e.g. the 'streams' table of the PERMANENT mapset of
> any NC grass7 sample location from within any other location?
>
> Here the example from the manual:
>
> db.in.ogr input=/path/to/sqlite.db db_table=census_raleigh
> output=census_raleigh

this example can not work because input is replaced by db_table if
db_table is given. It seems that db.in.ogr works only with dbf and
only if input is the full path to the dbf file, db_table must not be
set. The fix would be easy: delete lines 74, 75 from db.in.ogr.py.

HTH,

Markus M

>
>
> /Johannes
>
> On Wed, Aug 3, 2016 at 5:51 PM, Markus Neteler <neteler at osgeo.org> wrote:
>>
>> On Wed, Aug 3, 2016 at 5:42 PM, Moritz Lennert
>> <mlennert at club.worldonline.be> wrote:
>> ...
>> > Well, it's my set for GRASS7, but I guess somewhen way back in time I
>> > must
>> > have taken the GRASS6 version and run v.build.all in it to use it in
>> > GRASS7... ;-)
>>
>> (Yeah, but you also need to run
>> db.connect -d
>>  and
>> v.db.reconnect.all -cd
>>
>> see
>>
>> https://grasswiki.osgeo.org/wiki/Convert_all_GRASS_6_vector_maps_to_GRASS_7
>> )
>>
>> Anyway, let's wait for Johannes' answer.
>>
>> Markus
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list