[GRASS-user] Appending a map to another

tommaso tommasodb at googlemail.com
Mon Dec 8 05:37:51 PST 2014


Hello, I'm trying to simply append a map to other map, without any sort of  
geometric operations as merge or intersects, just the original geometries  
with theirs original attributes.
I'm using grass 6.4 on ubuntu 14.04, sqlite driver
This is what I already tried:

# input maps are poly2 and poly3
# First, I change the categories of one of the maps (poly3) to avoid  
categories conflicts:
# see http://grass.osgeo.org/grass64/manuals/v.patch.html
v.category in=poly3 option=sum cat=10000 out=poly3_category --overwrite
g.remove vect=poly3
g.rename vect=poly3_category,poly3
# I update the cat column of the table as well (why this is not done  
automatically by v.category??)
v.db.update poly3 col=cat qcol="cat+10000"

# now the to maps are patched together
db.droptable -f table=polygons
v.patch -e input=poly2,poly3 output=polygons --overwrite

# export to result as geojson:
v.out.ogr in=polygons olayer=polygons format=GeoJSON  
dsn=/tmp/polygons.json type=area

The geometries of the result map polygons.json look good, but the  
attributes are messy: I can not distinguish which records come from poly2  
and which ones from poly3. Many records have only empty attributes. What  
I'm doing wrong?


More information about the grass-user mailing list