[OSRS-PROJ] Orthographic Projections and MapServer

Norman Vine nhv at cape.com
Thu Aug 21 14:09:56 EDT 2003


Bart Adriaanse writes:
>
> Frank Warmerdam writes:
> >
> > I thought I should summarize my findings on the problems that Tom H ran into
> > using an orthographic projection for a world image in MapServer.   While the
> > bugs are essentially in MapServer, there is a more general question for
> > projections folks so bear with me.

> > In tracking through, the problem is that MapServer wasn't checking error
> > results from pj_transform() properly.  Some points in the polygons were not
> > reprojecting because they were over the horizon but MapServer was not
> > checking whether msProjectPoint() was successful in msProjectLine(), and
> > msProjectShape() was not checking if msProjectLine() was successful. So
> > msDrawShape() proceeded to drawing polygons that were not successfully
> > reprojected to orthographic meters resulting in some or all points being
> > essentially at 0,0 (the center of the map).

> > As you can see some polygons (such as the continental United States) that
> > go over the horizon are completely dropped even though much of the polygon
> > would be visible.
> >
> > So now the more general question for projection folks.  Does anyone have
> > a suggestion for how to plot polygons that partially go over the horizon?
> > What I want is a way to figure out what part of a polygon would be visible
> > and plot that.

The only sure method I know of is to clip the polygon to the great circle that 
is the 'rim' of the projection prior to submitting it to the draw routine and 
perhaps also the proj forward projection.
 
> One solution would be to somehow detect the points which are beyond the
> horizon and project those to lie on the horizon instead, this would
> potentially render some polygon border lines at the horizon which shouldn't
> really be there, but it seems like a good compromise.
> 
> However, even befor thinking about how to reproject them to the horizon, i
> had problems detecting which points were beyond the horizon to begin with,

For the spherical orthographic case, which at the scale where the Earth's 'rim' 
is visible is the most sensible, if a point is more then 90* from the center of 
the projection: it is beyond the horizon.  This is probably easiest to do in the 
direction cosine form < X,Y,Z unit vectors instead of Lat Lon > of the point

HTH

Norman

----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.



More information about the Proj mailing list