[GRASS-dev] latlong problem

Martin Landa landa.martin at gmail.com
Fri Mar 9 07:49:21 EST 2007


Hi Glynn,

2007/3/9, Glynn Clements <glynn at gclements.plus.com>:

> More precisely: the euclidify() function traverses the list of
> longitude values; if a value differs from the previous one by more
> than ±180°, it has the appropriate multiple of 360° added to it to
> bring it into range, so that all line segments span no more than 180°.
>
> If the gap between the first and last values exceeds 180°, the
> (presumed) polygon cannot be mapped to the Euclidean plane.
>
> One way to look at is: if you adjust the first point to fall within
> ±180° of the final point, you then have to adjust the second point to
> fall within ±180° of the first point, and so on, resulting in an
> infinite loop.
>
> Another way to look at it is that there is no way to cut the
> cylindrical lat/lon surface so that it forms a plane without breaking
> the polygon's boundary.
>
> > The testing location is here if you are interested
> >
> > http://gama.fsv.cvut.cz/~landa/.../grass/latlong.tar.gz
>
> I note that the largest polygon for Antarctica contains a "fix-up"
> segment between the vertices:
>
>  179.9999     -89.9999
>  -179.9999    -89.9999
>
> If I suppress the "shortest path" maxim for segments where |lat|>89.9°
> (which will typically be fix-up for the pole), the polygon is
> considered closed.
>
> I also needed to coerce the initial values into the range
> -180°<lon<180° (rather than 0°<lon<360°) to avoid leaving a blank
> triangle. Essentially, the radii which (along with the -89.9999th
> paralell) formed the cut were both being placed at the left-hand edge.
>
> With those two changes, Antarctica rendered correctly. Hopefully,
> that's likely to be good enough for most practical purposes.

Great!, with render=c seems to work.

Thanks...

Martin

-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *




More information about the grass-dev mailing list