wiki:WorldMappingIssues

Version 4 (modified by warmerdam, 14 years ago) ( diff )

--

World Mapping Issues

There are various issues in doing world scale mapping with MapServer. Some related to crossing the anti-meridian (the dateline), and some related to conversion between lat/long and polar projections near the pole, and some related to attempts to map off the bounds of validity of some projections (ie. over the horizon). This topic is intended to act as a location to discuss some of the issues, include hints, and collect a set of use-cases that break but that we want to make work.

An older version of this discussion from around 2005 may also be of some interest, though in some respects the situation has changed.

Rendering Lines Over Dateline

When lines are read from a projected data source, and reprojected into geographic coordinates for rendering it is common the have lines drawn across the width of the map. For instance, if the world is rendered, Siberia line segments may stretch across the map from -180 to +180 since line segments that cross the dateline will suddenly go from near -180 to near +180. This is discussed in #15.

A solution has been put in place to attempt to do special processing when reprojecting vectors from projected coordinates to geographic coordinates (msProjectShape()). Basically, preference is given to rewrapping shapes so that they cross the dateline rather than warping to the other side of the world. In the case of a small linestring or polygon crossing the dateline it may end up with extents like -185 to -175 longitude rather than a bit of stuff between -175 and -180 and a bit of stuff between 175 and 180. This logic is found in msTestNeedWrap() and msProjectShapeLine() in mapproject.c.

In the case of world spanning polygons this logic can sometimes mis-fire resulting in features getting stretched over more than 360 degrees.

Some Related Tickets

  • #15 - dateline wrapping of drawn vectors
  • #25 - BBOX that crosses the dateline
  • #723 - Three reprojection bugs
  • #740 - WMS client requests with non-square pixels
  • #3111 - WMS Reprojection misses stuff near the dateline
Note: See TracWiki for help on using the wiki.