Fwd: Re: [GRASS-dev] VTK export for lat-long locations

Glynn Clements glynn at gclements.plus.com
Wed Mar 7 00:22:49 EST 2007


"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 at gclements.plus.com>




More information about the grass-dev mailing list