Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have 64 vector layers, all of them must be warped using the v.transform module; the pointsfile is the same for all vectors.

How can I apply the transformation recursively to all layers?

I'm not bind to use GRASS, but I don't want (for a bunch of reasons) to merge all layers into one and apply the transformation on the single file.

Thank you guys

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Can you do it for just one vector? If you can its easy to batch it.

eg if this works for you:

v.transform input=in_vector_1 output=out_vector_1 xshift=11 yshift=12

then you can run this to one-shot them all:

for i in $(seq 1 74); do
    echo Transforming in_vector_$i
    v.transform input=in_vector_$i output=out_vector_$i xshift=11 yshift=12
    echo Done!
done

the trick is to name your data in a way you can iterate between them easily.

Be creative, adjust your scipt at your needs! (also I assume you're using linux with bash)

share|improve this answer
    
and in the (horrible :|) case someone (me, for example...) is working under win7...? Can you sugest me a solution? –  seba Sep 27 '12 at 10:02

I've managed to apply v.transform with an iteration like this, thank you

for map in `g.mlist type=vect pattern=map_*`; do
        v.transform in=$map out=${map}_georef pointsfile=points_georef --o
done
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.