Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

 
discard

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

Browse other questions tagged or ask your own question.