[GRASS-user] Why does v.split convert 3D vector to 2D?

Markus Neteler neteler at osgeo.org
Sun Mar 7 14:10:28 EST 2010

On Sun, Mar 7, 2010 at 7:13 PM, Dwight Needels <needels at translucida.com> wrote:
> I have a 3D vector [test_3D] created using v.drape, confirmed as 3D with
> v.info. I used v.split to split the polyline at the vertices:
> v.split input=test_3D output=test_3D_split vertices=2
> The resulting vector [test_3D_split] is a 2D vector (i.e. it lost the z
> geometry data according to v.info, and v.to.db reports all slopes = 0).

This happens due to the fact that the new vector file (output) is opened
without the Z geometry:

cd v.split/
grep open * | grep new
main.c:    Vect_open_new(&Out, out_opt->answer, 0);

> Is this intended behavior?

Certainly not ideal. I don't know if changing to

  Vect_open_new(&Out, out_opt->answer, WITH_Z);

would be sufficient (of course recompile after that). If you could
provide a test case with the Spearfish or North Carolina test
datasets, I could try if you aren't able to compile GRASS yourself
to test above suggestion.


More information about the grass-user mailing list