[GRASS-dev] 2D to 3D points

Michael Barton michael.barton at asu.edu
Mon Mar 3 12:06:27 EST 2008


On Mar 3, 2008, at 1:27 AM, Hamish wrote:

>>>> Benjamin Ducke wrote:
>>>>> How about a little wrapper script for v.transform that simplifies
>>>>> this action?
>
> Dylan:
>>> However, doesn't it make more sense to put that code (for
>>> points) into v.extrude ? Or, is v.extrude primarily for areas
>>> by design?
>
> Michael:
>> IMHO, v.type is a much better place to put this. v.type is already
>> designed to transform vector objects from one type of vector object
>> to another. Changing a vector object from a 2D point to a 3D point
>> seems to fit this concept well.
>
> As the functionality is already written into a C module, and v.type is
> not conspicuously missing the feature or obviously+naturally matching
> the task, IMO it is better to use a simple wrapper script with an
> obvious+natural name.
>
> I wonder if such a script could call another module for the reverse
> proceedure? (v.out.ascii directly piped back into v.in.ascii (without
> -z)?, or v.transform + db.in.ogr? or some new C code?)
>
> for the 2D -> 3D case the clearest way would be to pipe
> 'v.out.ascii.db | v.in.ascii -z' and then copy the table. But to do
> that properly v.out.ascii would need to finally to have the DB output
> code written. (probably pretty simple to do; the v.out.ascii.db script
> can be found in wiki addons)
>
>
>> (And while we're at it, v.type should
>> be changed to work like v.type.sh).
>
> the module command line interface can't change until GRASS 7.
> Hence we have v.type.sh, for once it's not due to long queues.
>
>
>> v.transform is really a georectifying module for vector objects. It's
>> a conceptual stretch to include transforming 2D to 3D points there--
>> though it does work.
>
> Hence using a wrapper function with a more intuitive name and only
> expose the relevant options.

Hamish,

In the past, this would be the easiest solution. However, I'm  
increasingly reluctant to create more Bash scripts for GRASS given the  
plans to move away from that platform and the problems with running  
scripts under Windows/MSys now.

Michael


More information about the grass-dev mailing list