[GRASS-dev] latlong problem

Glynn Clements glynn at gclements.plus.com
Fri Mar 9 01:57:00 EST 2007


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

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




More information about the grass-dev mailing list