[GRASS-dev] latlong problem

Martin Landa landa.martin at gmail.com
Fri Mar 9 03:07:18 EST 2007


Glynn,

2007/3/9, Glynn Clements <glynn at gclements.plus.com>:
>
> Martin Landa wrote:
>
> > there is a significant problem in LatLong location. Try the following:
> >
> > g.region n=80 s=-80 w=-170 e=170 res=1;
> > v.in.region out=reg;
> > g.region n=90 s=-90 w=-180 e=180 res=1;
> > d.erase;d.vect reg
> > [1] should be [2]
> >
> > I prepared a simple patch to fix this bug.
> >
> > I am not sure whether it is OK. Anyway testing "(east1 - east2) > 180"
> > does not make sense to me... or am I wrong?
>
> I've committed a change to v.in.region to add additional vertices if a
> lat/lon region is wider than 179°, so such regions shouldn't get
> turned inside-out by code which uses the "shortest route" maxim.
>
> Also, I've modified D_polygon_clip (used by "d.vect render=c") to
> handle longitude wrap. It doesn't handle polygons which contain a
> pole, but the other rendering methods don't handle that either (in
> fact, I doubt that many things *do* handle that case). OTOH, it should
> handle polygons which make multiple "orbits" (e.g. an "apple peel"
> spiral).

g.region n=90 s=-90 w=-180 e=180;
v.in.region out=reg

works well, thanks!

Trying to display world map, the problem with Antarctica still
remains, now it is not filled. Maybe "buggy" boundaries. Not sure.
Just for comment, when I enable (east1 - east2) > 360, the area is
filled correctly.

In summary,

render=g -> Antarctica filled wrongly
render=r -> OK (don't d.zoom -p)
render=d -> as render=r
render=c -> now not filled

The testing location is here if you are interested

http://gama.fsv.cvut.cz/~landa/.../grass/latlong.tar.gz

Martin

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


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




More information about the grass-dev mailing list