Moved code from http://sourceforge.net/projects/jmapprojlib/