[GRASS-dev] table only creation in v.in.ascii
Benjamin Ducke
benjamin.ducke at ufg.uni-kiel.de
Thu Jan 10 07:52:17 EST 2008
OK, I have it almost working except for one annoyance:
If the table already exists, then --o should allow the user to
overwrite it. Thus, I check for that flag and delete the old
table, if it exists, using:
db_delete_table ( connection.driverName, connection.databaseName,
new->answer );
But even so, the next call to
db_execute_immediate()
complains about the table still being there and creation of the
new table fails.
I suppose that db_delete_table() does not delete the table immediately?
What other function do I have to call to physically get rid of the
table immediately?
Thanks,
Benjamin
Moritz Lennert wrote:
> On 10/01/08 09:51, Benjamin Ducke wrote:
>> Dear all,
>>
>> following our discussion two days ago, I have started patching
>> v.in.ascii to support creating only an attribute table w/o
>> any vector objects/geometries.
>>
>> It seems the easiest way in terms of not modifying too much of
>> the original code is to be create a dummy vector map, creating
>> the table for it and then deleting only the geometries after import,
>> leaving the table intact.
>
> When I looked at it, I had the feeling that the easiest way would be to
> add a flag which, if set, leaves out the map creation part. This would
> mean (in in.c)
>
> - conditionalising lines 214-215 and all calls to Vect_delete and
> Vect_map_add_dblink and other functions using &Map as parameter on the
> flag not being set
> - not use Vect_default_field_info and Fi (lines 300ff), but directly use
> db_get_connection() and a table_name parameter given by the user (with
> default being the same name as the file ?).
>
>
>>
>> I have two questions about this:
>>
>> 1. Given that the user want to create a dbase table, where should
>> the resulting DBF file be placed? In the mapset's dbf directory?
>
> It should use the current db.connect settings (that's what
> db_get_connection() should give you), and so create any kind of table
> (dbf or others).
>
> Moritz
>
>
--
Benjamin Ducke, M.A.
Archäoinformatik
(Archaeoinformation Science)
Institut für Ur- und Frühgeschichte
(Inst. of Prehistoric and Historic Archaeology)
Christian-Albrechts-Universität zu Kiel
Johanna-Mestorf-Straße 2-6
D 24098 Kiel
Germany
Tel.: ++49 (0)431 880-3378 / -3379
Fax : ++49 (0)431 880-7300
www.uni-kiel.de/ufg
More information about the grass-dev
mailing list