Wrapping map extents

Neil Saunders n.j.saunders at GMAIL.COM
Tue Apr 11 18:19:44 EDT 2006


Hi Frank,

Thanks for that, I think I'm clearer what we can/can't achieve now.
This is disappointing, as I thought I was so close! What I had tried
was simply changing the lon_0 value of the projection so that, for
example, Alaska will sit in the center of the mercator projection.
This solution would I thought be fine, but I had a problem where the
shape filling was getting more than a little confused (Attached). Is
this a symptom of what you were talking about? I was projecting
latlong data from postgis to mercator (+proj=merc +ellps=WGS84
+datum=WGS84 +lon_0=90 in this example). Is there no hack that can be
applied to fix this?

I've also tried an approach of rendering regions using an orthographic
projection, but am now having problem with that also. I can center on
a particular point, but calculating the extents to display isn't
obvious, is there a way to do this? (e.g. I want to show the whole of
alaska, with it centered and filling the whole display).

What am I doing wrong? Many thanks for your help; Cartography is
somewhat new discipline for me - I'm sure it will click soon!

Kind regards,

Neil.

On 4/11/06, Frank Warmerdam <warmerdam at pobox.com> wrote:
> 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: shiftedmerc.gif
Type: image/gif
Size: 29578 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060411/e78d9d2c/shiftedmerc.gif


More information about the mapserver-users mailing list