Hi Benjamin,
-------- Original-Nachricht --------
Datum: Tue, 06 Mar 2007 17:50:41 +0100
Von: Benjamin Ducke <benjamin.ducke@ufg.uni-kiel.de>
An: GRASS devel <grass-dev@grass.itc.it>
CC:
Betreff: Re: Fwd: Re: [GRASS-dev] VTK export for lat-long locations
OK, so as Markus has pointed out, we have the necessary funcs in
lib/vector/Vlib/line.c.
Well, it uses the functions from lib/gis/distance.c and so should i.
And as you pointed out, the basic scaling information changes with every
raster row.
I assume that you export a GRASS raster map in some loop construct where
the outer loop goes through the rows in the GRASS map and the inner loop
goes through the columns?
Yes.
Then the code could be something like this:
intialize geodesic distance measures (?)
yes:
G_begin_distance_calculations();
for all rows in current map do
get width of one cell (region east resolution)
use Vect_line_geodesic_length() to get metric length cell
length = G_geodesic_distance (x1, y1, x2, y2);
for all columns in current row do
scale z using current metric length
output x,y,z to VTK file
I dont think this is a good idea. It is a nice and easy approach
indeed, but IMHO the length of the z height does not depend on
the length of a line on the surface.
So the z elevation is independend from the positon
on the surface (i know the earth is not a perfect sphere ... ),
in this case the row number.
The approach which i have in mind is to compute metric coordinates for
each point (center of the cell) without scaling the z elevation.
LL X,Y
_______ ____
| | / \
| | --> / \
| | / \
|_______| /__________\
But the problem which i have is: VTK does not know the meaning of
a world projection or a location like grass.
So i do not know how to transfrom the position on the earth
geoid in LL in a 3d space with x,y,z starting from 0,0,0.
So which of the point is 0,0,0 if converted from lat/lon?
The equator, the upper left cell, the lower right? I dont know.
I hope that i'm wrong and that there is a quite easy approach.
eg: scaling the elevation with a fixed value?
And my english is to bad,
to explain my problem in a meaningful sense.
Best regards
Soeren
btw.:
The next problem which i have is the transformation of LL volume data
into the x,y,z VTK format. In this case the size of one cell depends
on the row and on the height.
done
done
Did I overlook anything?
Sören Gebbert wrote:
> Hi Benjamin,
> -------- Original-Nachricht --------
> Datum: Tue, 06 Mar 2007 16:45:14 +0100
> Von: Benjamin Ducke <benjamin.ducke@ufg.uni-kiel.de>
> An:
> CC: grass-dev@grass.itc.it
> Betreff: Re: Fwd: Re: [GRASS-dev] VTK export for lat-long locations
>
>> Wow, that explains the result I got!
>> So I guess you need to know exactly how many meters a lat/long cell
>> dimension is in the current projection, so you can scale the Z axis
>> accordingly?
>
> Yes, thats the point. And i need to know where to start.
>
>> Does this vary between cells? Does GRASS have a function to calculate
>
> It changes with every raster row.
>
>> metric lengths between two points in a lat-long system? If so, I guess
>> you would need to take the the metric distance between corner points of
>> a lat-long cell and use the value for Z axis scaling?
>
> AFAIK these functions are implemented in grass (lib/gis/area* and
stuff).
>
> The point is, im not very familiar with this kind of coordinate
transformation, and even if i know the distance between each point,
> i dont know where to start with 0,0 in metric coordiantes.
>
> Maybe im a bit dumb?
>
> Best regards
> Soeren
>
>> Sören Gebbert wrote:
>>> -------- Original-Nachricht --------
>>> Datum: Tue, 06 Mar 2007 16:06:18 +0100
>>> Von: "Sören Gebbert" <soerengebbert@gmx.de>
>>> An: Benjamin Ducke <benjamin.ducke@ufg.uni-kiel.de>
>>> CC:
>>> Betreff: Re: [GRASS-dev] VTK export for lat-long locations
>>>
>>> Hi Benjamin,
>>> please dont use the vtk export modules with lat/lon projections.
>>> The vtk export modules in grass are not
>>> usable with lat/lon projections right now.
>>> I think i should put this info to the html docs.
>>>
>>> The lat/lon coordiantes are used to define the coordinates for each
>> point.
>>> VTK interpret these coordinates as planimetric and not as lat/lon.
>>> This is not that bad for x,y coordinates, but for the height (z
>> coordinate).
>>> Because if x and y lat/lon coordiantes are of type [54.001/34.002] and
>> the
>>> height varies from 0m - 500m you will get a senseless result.
>>>
>>> I still dont know exactly how to implement a meaningful
>>> lat/lon ->planimetric coordinate transformation to get rid
>>> fo this behaviour.
>>>
>>> Any suggestions are welcome.
>>>
>>> Best regards
>>> Soeren
>>>
>>>
>>> -------- Original-Nachricht --------
>>> Datum: Tue, 06 Mar 2007 15:57:17 +0100
>>> Von: Benjamin Ducke <benjamin.ducke@ufg.uni-kiel.de>
>>> An: GRASS devel <grass-dev@grass.itc.it>
>>> CC:
>>> Betreff: [GRASS-dev] VTK export for lat-long locations
>>>
>>>> Hi everyone,
>>>>
>>>> I just tested r.out.vtk in a lat-long location and all I got when I
>>>> loaded the VTK file in Paraview (2.6.0), was a single line of data
>>>> projecting through the origin of the coordinate system.
>>>>
>>>> Does anyone have any experiences with VTK/Paraview and lat-long data?
>>>>
>>>> Thanks,
>>>>
>>>> Benjamin
>>>>
>>>>
>>>> --
>>>> Benjamin Ducke, M.A.
>>>> Archäoinformatik
>>>> (Archaeoinformation Science)
>>>> Institut für Ur- und Frühgeschichte
>>>> (Inst. of Prehistoric and Historic Archaeology)
>>>> Christian-Albrechts-Universität zu Kiel
>>>> Johanna-Mestorf-Straße 2-6
>>>> D 24098 Kiel
>>>> Germany
>>>>
>>>> Tel.: ++49 (0)431 880-3378 / -3379
>>>> Fax : ++49 (0)431 880-7300
>>>> www.uni-kiel.de/ufg
>>>>
>>>> _______________________________________________
>>>> grass-dev mailing list
>>>> grass-dev@grass.itc.it
>>>> http://grass.itc.it/mailman/listinfo/grass-dev
>> --
>> Benjamin Ducke, M.A.
>> Archäoinformatik
>> (Archaeoinformation Science)
>> Institut für Ur- und Frühgeschichte
>> (Inst. of Prehistoric and Historic Archaeology)
>> Christian-Albrechts-Universität zu Kiel
>> Johanna-Mestorf-Straße 2-6
>> D 24098 Kiel
>> Germany
>>
>> Tel.: ++49 (0)431 880-3378 / -3379
>> Fax : ++49 (0)431 880-7300
>> www.uni-kiel.de/ufg
>>
>> _______________________________________________
>> grass-dev mailing list
>> grass-dev@grass.itc.it
>> http://grass.itc.it/mailman/listinfo/grass-dev
>
--
Benjamin Ducke, M.A.
Archäoinformatik
(Archaeoinformation Science)
Institut für Ur- und Frühgeschichte
(Inst. of Prehistoric and Historic Archaeology)
Christian-Albrechts-Universität zu Kiel
Johanna-Mestorf-Straße 2-6
D 24098 Kiel
Germany
Tel.: ++49 (0)431 880-3378 / -3379
Fax : ++49 (0)431 880-7300
www.uni-kiel.de/ufg
_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev
--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: www.gmx.net/de/go/mailfooter/topmail-out