@ Override public LatLonPoint projToLatLon ( ProjectionPoint world , LatLonPointImpl result ) { double fromX = world . getX ( ) - falseEasting ; double fromY = world . getY ( ) - falseNorthing ; double toLat_r = fromY / earthRadius ; double toLon_r ; if ( Misc . nearlyEquals ( Math . abs ( toLat_r ) , PI_OVER_2 , 1e-10 ) ) { toLat_r = toLat_r < 0 ? - PI_OVER_2 : + PI_OVER_2 ; toLon_r = Math . toRadians ( centMeridian ) ; // if lat == +- pi/2, set lon = centMeridian (Snyder 248) } else if ( Math . abs ( toLat_r ) < PI_OVER_2 ) { toLon_r = Math . toRadians ( centMeridian ) + fromX / ( earthRadius * Math . cos ( toLat_r ) ) ; } else { return INVALID ; // Projection point is off the map. } if ( Misc . nearlyEquals ( Math . abs ( toLon_r ) , PI , 1e-10 ) ) { toLon_r = toLon_r < 0 ? - PI : + PI ; } else if ( Math . abs ( toLon_r ) > PI ) { return INVALID ; // Projection point is off the map. } result . setLatitude ( Math . toDegrees ( toLat_r ) ) ; result . setLongitude ( Math . toDegrees ( toLon_r ) ) ; return result ; }
Convert projection coordinates to a LatLonPoint