[GRASS-dev] table only creation in v.in.ascii
Moritz Lennert
mlennert at club.worldonline.be
Thu Jan 10 04:17:32 EST 2008
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
More information about the grass-dev
mailing list