Wrapping map extents

Frank Warmerdam warmerdam at POBOX.COM
Tue Apr 11 09:36:16 EDT 2006


Neil Saunders wrote:
> Hello all,
> 
> Could somebody offer some advice regarding mercator projections.. the
> problem I have is the projection of the globe. The far east of Russia
> and the far west of America both 'wrap around' to the other side of
> the globe, which is causing me problems in the way I'm trying to
> visualise things. Looking at Google Maps, they seem to have altered
> the east and west extents of the map to allow for these (and the
> Oceania islands). I was hoping I might achieve the same thing. Is
> there some way of altering the projection to do this? I've seen this
> on standard atlases before so I'm assuming its a fairly common thing
> but I can't find anything on the web about it in mapserver.
> 
> Thanks for reading and any help you have,

Neil,

There are quite a few factors that come into play.  What types of input
data (raster? vector?) are you using?  What projections is it in?

If you want a wrap around world with some areas represented twice on the
map image, and the source data is vector it just isn't going to work unless
the source data is already in mercator and already "doubled up".

The raster reprojector on the other hand can take a single world image and
apply it in multiple places because raster reprojection is mostly done
by back-projection.  That is, take a location on the map, reproject it to
the source projection and sample the raster.  So it is ok for multiple
parts of the output map to sample from the same input location.

I have attached a sample map in mercator with wrap around and vector and
raster layers (all in geographic).  Note that the raster layers wrap, but
the vector layers don't.  That map file looks like:

MAP
   NAME 'ORTH_TEST'
   IMAGETYPE JPEG
   EXTENT -30000000 -15000000 14000000 15000000
   SIZE 600 300

   PROJECTION
     "+proj=merc +datum=WGS84"
   END

   LAYER
     NAME "bm"
     TYPE RASTER
     STATUS DEFAULT
     DATA "/home/warmerda/public_html/world.tif"
     PROCESSING "LOAD_WHOLE_IMAGE=YES"
     PROJECTION
       "+proj=latlong +datum=WGS84"
     END
   END
   LAYER
     NAME "world"
     TYPE LINE
     STATUS DEFAULT
     DATA "world.shp"
     PROJECTION
       "+proj=latlong +datum=WGS84"
     END
     CLASS
       OUTLINECOLOR 255 0 0
       COLOR 0 255 0
     END
   END
END

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    | President OSGF, http://osgeo.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ZWorld.jpg
Type: image/jpeg
Size: 37558 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060411/68c42e2d/ZWorld.jpg


More information about the mapserver-users mailing list