[GRASS-dev] VTK export for lat-long locations

-------- 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

--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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?
Does this vary between cells? Does GRASS have a function to calculate
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?

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

Benjamin Ducke wrote on 03/06/2007 04:45 PM:

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?
Does this vary between cells? Does GRASS have a function to calculate
metric lengths between two points in a lat-long system?

In v.to.db we solved that problem some months ago. The function is
Vect_line_geodesic_length() which is found in lib/vector/Vlib/line.c

markus

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?

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
      

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. :confused:

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

--
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out

OK, so as Markus has pointed out, we have the necessary funcs in
lib/vector/Vlib/line.c.
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?
Then the code could be something like this:

intialize geodesic distance measures (?)

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

  for all columns in current row do
    scale z using current metric length
    output x,y,z to VTK file
  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. :confused:

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

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 ... :wink: ),
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. :confused:

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. :confused:
>
> 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

Sören Gebbert wrote:

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 ... :wink: ),
in this case the row number.

the units of z are map dependent and not knowable by the system.

for NVIZ + lat/lon, in the past I have used r.mapcalc to make a new
map, [I've got a feeling this is no longer needed??]

e.g. for a lat/lon map with z in meters:

r.mapcalc "scaled_map = (map / 1850.0*60)"

so x,y,z are all in degrees.

I would not bother with reprojecting lat/lon into square cells, the user
can to that with r.proj if they want. Just note that the output is in
Plate Carrée like GRASS renders for 2D.

see also 'r.shaded.relief units='.

Hamish

Am Dienstag, 6. März 2007 23:48 schrieb Hamish:

Sören Gebbert wrote:
> 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 ... :wink: ),
> in this case the row number.

the units of z are map dependent and not knowable by the system.

for NVIZ + lat/lon, in the past I have used r.mapcalc to make a new
map, [I've got a feeling this is no longer needed??]

e.g. for a lat/lon map with z in meters:

r.mapcalc "scaled_map = (map / 1850.0*60)"

so x,y,z are all in degrees.

In this case
r.out.vtk input=ll_map output=ll_map.vtk elevscale=0.000009009
will do the job. :slight_smile:

I would not bother with reprojecting lat/lon into square cells, the user
can to that with r.proj if they want. Just note that the output is in
Plate Carrée like GRASS renders for 2D.

Ok, thanks.

Soeren

see also 'r.shaded.relief units='.

Hamish

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

Soeren Gebbert wrote:

> the units of z are map dependent and not knowable by the system.
>
> for NVIZ + lat/lon, in the past I have used r.mapcalc to make a new
> map, [I've got a feeling this is no longer needed??]
>
> e.g. for a lat/lon map with z in meters:
>
> r.mapcalc "scaled_map = (map / 1850.0*60)"
>
> so x,y,z are all in degrees.

In this case
r.out.vtk input=ll_map output=ll_map.vtk elevscale=0.000009009
will do the job. :slight_smile:

sorry, minor typo above, there is 1852m to the nautical mile, not 1850.

elevscale=0.000009

and for feet: ( 1/(6076.1[2]*60) )

elevscale=0.000002742

Hamish

"Sören Gebbert" wrote:

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.

In increasing order of complexity and accuracy:

1. Convert the lat/lon coordinates to radians then multiply by the
radius of the earth (in whatever units the z values use).

E.g. if the Z values are in metres, using the radius of 6378137m for
the WGS ellipsoid gives a scale factor of pi/180*6378137 ~ 111320

[I've noticed Hamish' comment, which essentially suggests the inverse,
i.e. scale the Z values by 1/111320 = 9e-6, so that everything is in
degrees.]

For a whole-earth map, this should be adequate; you will still get
horizontal stretching as you move towards the poles, but no more so
than is inherent with lat/lon.

2. As above, but scale the y coordinates by 111320 and the x
coordinates by 111320*cos(lat), where lat is the mean latitude of your
region. The main issue here is that, if the range of latitudes is
significant, the choice of centre for the x scaling will make a
difference to the shape of the projected data.

3. Pick an "appropriate" geographic projection and transform the
coordinates into that projection. The choice of projection needs to be
done manually, based upon the size, shape and location of your region,
and the relative importance of various properties (equidistant,
equal-area, conformal, etc).

--
Glynn Clements <glynn@gclements.plus.com>

Am Mittwoch, 7. März 2007 06:22 schrieb Glynn Clements:

"Sören Gebbert" wrote:
> 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.

In increasing order of complexity and accuracy:

1. Convert the lat/lon coordinates to radians then multiply by the
radius of the earth (in whatever units the z values use).

E.g. if the Z values are in metres, using the radius of 6378137m for
the WGS ellipsoid gives a scale factor of pi/180*6378137 ~ 111320

[I've noticed Hamish' comment, which essentially suggests the inverse,
i.e. scale the Z values by 1/111320 = 9e-6, so that everything is in
degrees.]

For a whole-earth map, this should be adequate; you will still get
horizontal stretching as you move towards the poles, but no more so
than is inherent with lat/lon.

2. As above, but scale the y coordinates by 111320 and the x
coordinates by 111320*cos(lat), where lat is the mean latitude of your
region. The main issue here is that, if the range of latitudes is
significant, the choice of centre for the x scaling will make a
difference to the shape of the projected data.

3. Pick an "appropriate" geographic projection and transform the
coordinates into that projection. The choice of projection needs to be
done manually, based upon the size, shape and location of your region,
and the relative importance of various properties (equidistant,
equal-area, conformal, etc).

Many thanks for this suggestions.
I think i will implement the first and second approach.
The third approach sounds to complex to be implemented
in the vtk export modules. Maybe it will be easier for the user to reproject
his data in a metric projection.

Best regards
Soeren

Hi,

Glynn Clements wrote:

"Sören Gebbert" wrote:

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.

In increasing order of complexity and accuracy:

1. Convert the lat/lon coordinates to radians then multiply by the
radius of the earth (in whatever units the z values use).

E.g. if the Z values are in metres, using the radius of 6378137m for
the WGS ellipsoid gives a scale factor of pi/180*6378137 ~ 111320

[I've noticed Hamish' comment, which essentially suggests the inverse,
i.e. scale the Z values by 1/111320 = 9e-6, so that everything is in
degrees.]

For a whole-earth map, this should be adequate; you will still get
horizontal stretching as you move towards the poles, but no more so
than is inherent with lat/lon.

I have implemented this approach in
r.out.vtk, r3.out.vtk and v.out.vtk.
The code is available in CVS.

Soeren

2. As above, but scale the y coordinates by 111320 and the x
coordinates by 111320*cos(lat), where lat is the mean latitude of your
region. The main issue here is that, if the range of latitudes is
significant, the choice of centre for the x scaling will make a
difference to the shape of the projected data.

3. Pick an "appropriate" geographic projection and transform the
coordinates into that projection. The choice of projection needs to be
done manually, based upon the size, shape and location of your region,
and the relative importance of various properties (equidistant,
equal-area, conformal, etc).