proj4js/proj4js — pull request #122 by mbloch (2014-08-20 15:09:51+00:00)
Title: Prevent 180 and -180 degrees lon from wrapping

The adjust_lon() function in proj4js swaps 180 to -180 and 180 to -180, causing this to happen (screengrab from QGIS):

![world_mercator](http://www.mapshaper.org/images/proj4js_mercator.png)

Althought -180 and 180 degrees describe the same meridian, it seems common for datasets to use -180 for vertices that should be projected to the left-hand side of a world map and 180 for vertices that should go on the right.

The adjlon() function in Proj.4 doesn't swap the sign of longitudes at 180 and -180. The function also slightly boosts the value of PI in its wrap test ([link](http://trac.osgeo.org/proj/browser/trunk/proj/src/adjlon.c)). That might be to handle floating point rounding errors caused by inverse projection -- so a point at 180.00000000001 degrees doesn't get wrapped to -179.9999999999.

This pull request matches the behavior of Proj.4