Strange clipping on polar stereographic maps.

Frank Warmerdam warmerdam at POBOX.COM
Fri May 4 18:43:00 EDT 2007


On 5/4/07, Dave Weaver <dave.weaver at zen.co.uk> wrote:
> I'm experimenting with MapServer and have come across a problem I
> don't understand.
>
> I have a basic (vector) world map, overlaid with a (raster) satellite
> image. I'm accessing it using the WMS interface. When I display it in
> EPSG:4326 projection it looks fine, like this:
>
> http://server6.pictiger.com/img/39525/computer-games-and-screenshots/coverage-of-image.png
>
> However, if I change the projection to Polar Stereographic, I get some
> strange clipping issues.

Dave,

There are many tricky issues with polar areas (and datelines)
when reprojecting.  In mapserver if you ask for a region in
polar stereographic mapserver will reproject that rectangle
into geographic coordinates by sampling along the edges
of the rectangle and accumulating an extent in lat/long.

But if your view is centered on the pole, generally none of the
edges will be near the pole so the final "extent rect" will not extend
any closer to the pole in latitude than the closest edge.

This is certainly responsible for the vector drop out.

There are some caveats.

If *any* edge point fails to reproject then mapserver will actually
do internal sampling in the rectangle as well.  This would help
you enourmously, but there is nothing to cause any points to
fail unless you use polar extents so large they are bigger than the
world.

If you felt so inclined, you could hack msProjectRect() in
mapproject.c so that the line 'if( failure > 0 )" was "if( 1 )"
instead so that internal sampling would always be done.

There are also some related issues for rasters that I provide
some special "knobs" to tweak.  If your raster image isn't
too large you can set the following processing options to force
reprojection to always work from the complete full res image.

  PROCESSING "LOAD_FULL_RES_IMAGE=YES"
  PROCESSING "LOAD_WHOLE_IMAGE=YES"

They will have a significant performance impact if your
source image is large.

I hope this helps a bit.  World scale mapping is fraught with
peril, and we really need to develop a howto on some of the
issues and work arounds.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list