Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So if you try to do a transform like this

Proj4js.transform( new Proj4js.Proj( 'EPSG:4326' ), 
                   new Proj4js.Proj( 'EPSG:3857' ), 
                   new Proj4js.Point( -180, -90 ) );

You will get: { x: -Math.PI, y: -Math.PI / 2 }

So the issue is obvious, you can't reproject the corners of 4326 to 3857. However, Proj4js does not notify you in anyway that a math error is occurring.

Is there a general solution to these sort of reprojection problems?

So far, I'm thinking about checking for Point / ( Math.PI / 2 ) % 0 to see if division of PI is being returned then bringing the points closer to 0 so the transformation can be resolved.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.