[GRASS-user] loop import+merge

Dr. Manfred Redslob redslob at gdf-hannover.de
Tue Dec 14 08:32:39 EST 2010

Am Dienstag, den 14.12.2010, 13:32 +0100 schrieb Patrick_schirmer:
> Hi,
> Still trying to create an import and merging of various files via a 
> python-loop, as direct import is too heavy. I was searching on how to 
> add a flag"-o" in python some days ago.  Found out that it will work 
> with 'flags="o"' if I put it directly behind the command, but am still 
> not able to combine two flags (-o and --o).
> Even though, it seems that the loop I tried with "v.patch" will not work 
> at all if input and output has the same filename. I would therefor have 
> to create a dummy-file that will have to be a copied at the end of each 
> iteration.

Hi Patrick,

> Kind of:
> v.patch in=iterationresult,previousfinal out=temp
> v.copy in=temp out=previousfinal --overwrite

it must be

g.copy vect=temp,previousfinal

I guess g.copy don't know the -o flag.

Therefor you have _first_ remove the map:

g.remove vect=previousfinal
or you have to choose another mapname.


> Is there a command doing this "v.copy --overwrite"? Or does anyone have 
> any other ideas on how to solve this task. It really is essential that I 
> find any solution to this.
> Thanks for your help,
> Patrick
> ############script of loop###############
> i=0
> while i<150:
>          i=i+1
>          i=str(i)
>          grass.run_command(
>              'v.in.ogr', flags="o", dsn="PG:dbname=schirpat",
>              layer="sc.av_liegensch", output="GR_av_liegensch_poly"+i,
>              type="boundary,centroid", where="bfs="+i)
>          grass.run_command(
>              'v.patch',flags="-o", 
> input="GR_av_liegensch_poly"+i+",GR_av_liegensch_poly", 
> output="GR_av_liegensch_poly")
> _______________________________________________
> 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