[GRASSLIST:5709] Re: Creating DTM from shapefiles

Moritz Lennert mlennert at club.worldonline.be
Thu Feb 10 07:18:03 EST 2005


On Thu, February 10, 2005 13:05, Māris Nartišs said:
> Hi,
>
> Seems, that joining two vector data sets (shapefiles) in Grass is
> "mission impossible".
>
>> What happens if you append 2 files with attribute tables that have different
>> formats?
> Actualy for me, lamer, they look like same:
>
> v.db.connect map=augstump driver=dbf
> database=/home/maris/Test_in_grass/testlocation/testmapset/dbf/
> key=cat layer=1 -c
> INTEGER|CAT
> DOUBLE PRECISION|AUGST
>
> v.db.connect map=izol_p driver=dbf
> database=/home/maris/Test_in_grass/testlocation/testmapset/dbf/
> key=cat layer=1 -c
> INTEGER|CAT
> DOUBLE PRECISION|AUGST
>
>
> And v.append error:
>
> v.append vect1=augstump vect2=izol_p vmerged=augstump_izol_p
> vtype=point vlayer=1
> Exporting 74 points/lines...
> 74 features written
> Exporting 172640 points/lines...
> 172640 features written
> Datum 'unknown' not recognised by GRASS and no parameters found. Datum
> transformation will not be possible using this projection information.
> Over-riding projection check.
> Proceeding with import...
> Layer: augstump_izol_p
> DBMI-DBF driver error:
> Column 'CAT' already exists (duplicate name)

It seems to try to create a table containing all columns from the original two
tables. Try renaming the columns of one of the tables to CAT2 and AUGST2 and
see what happens.


> Cannot create table.
> Error in db_execute_immediate()
> Cannot create table: create table augstump_izol_p (cat integer, CAT
> integer, AUGST double precision)
>
> _______________________________________
> I know what I want, but duno how to get it.
> My idea: 2 vect. data sets with 2 dbs. Take first of them, get max cat
> num. Take second one and increase cat by first max cat num. Append
> second to first w/o problems (ie. cat 2 >> 1), cuz cat nums not
> owerlap. Wola. One data set containing data from both input sets.
> Is it possible in Grass? Or I need to start to study ArcInfo?


If the above suggestion works, you could then use simple SQL to populate one
CAT column with unique cat nums.

Moritz





More information about the grass-user mailing list