1

I am using GRASS 6.4.

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 don't want (for a bunch of reasons) to merge all layers into one and apply the transformation on the single file.

2 Answers 2

1

If you can do it for just one vector, then its easy to batch it.

For example, 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.

I assume you're using linux with bash.

0
1

I've managed to apply v.transform with an iteration like this:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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