/** * put longitude into the range [0, 360] deg * * @param lon lon to normalize * @return longitude into the range [0, 360] deg */ static public double lonNormal360(double lon) { return lonNormal(lon, 180.0); }
/** * put longitude into the range [-180, 180] deg * * @param lon lon to normalize * @return longitude in range [-180, 180] deg */ static public double range180(double lon) { return lonNormal(lon); }
/** * put longitude into the range [0, 360] deg * * @param lon lon to normalize * @return longitude into the range [0, 360] deg */ static public double lonNormal360(double lon) { return lonNormal(lon, 180.0); }
/** * Set the longitude, in degrees. It is normalized to +/-180. * * @param lon east longitude in degrees */ public void setLongitude(double lon) { this.lon = lonNormal(lon); }
/** * put longitude into the range [-180, 180] deg * * @param lon lon to normalize * @return longitude in range [-180, 180] deg */ static public double range180(double lon) { return lonNormal(lon); }
/** * Set the longitude, in degrees. It is normalized to +/-180. * * @param lon east longitude in degrees */ public void setLongitude(double lon) { this.lon = lonNormal(lon); }
/** * put longitude into the range [0, 360] deg * * @param lon lon to normalize * @return longitude into the range [0, 360] deg */ static public double lonNormal360(double lon) { return lonNormal(lon, 180.0); }
/** * put longitude into the range [0, 360] deg * * @param lon lon to normalize * @return longitude into the range [0, 360] deg */ static public double lonNormal360(double lon) { return lonNormal(lon, 180.0); }
/** * Set the longitude, in degrees. It is normalized to +/-180. * * @param lon east longitude in degrees */ public void setLongitude(double lon) { this.lon = lonNormal(lon); }
/** * put longitude into the range [-180, 180] deg * * @param lon lon to normalize * @return longitude in range [-180, 180] deg */ static public double range180(double lon) { return lonNormal(lon); }
"Unexpected latitude of origin: " + latOrigin); double lonNorthPole = LatLonPointImpl.lonNormal(lonOrigin + 180); double latNorthPole = 90 - latOrigin; ParameterValueGroup netcdfParameters = ogcParameters.clone();
@Override public ParameterValueGroup getOgcParameters( ParameterValueGroup netcdfParameters) { double lonNorthPole = (Double) netcdfParameters .parameter(NetCDFUtilities.CENTRAL_MERIDIAN) .getValue(); double latNorthPole = (Double) netcdfParameters .parameter(NetCDFUtilities.LATITUDE_OF_ORIGIN) .getValue(); // Rotated pole is ambiguous so we assume an origin in the northern // hemisphere if (latNorthPole >= 90 || latNorthPole <= 0) { throw new RuntimeException( "Unexpected north pole latitude: " + latNorthPole); } double lonOrigin = LatLonPointImpl.lonNormal(lonNorthPole + 180); double latOrigin = 90 - latNorthPole; ParameterValueGroup ogcParameters = netcdfParameters.clone(); ogcParameters .parameter(NetCDFUtilities.CENTRAL_MERIDIAN) .setValue(lonOrigin); ogcParameters .parameter(NetCDFUtilities.LATITUDE_OF_ORIGIN) .setValue(latOrigin); return ogcParameters; }
/** * Compute theta * * @param lon longitude * @return theta */ private double computeTheta(double lon) { double dlon = LatLonPointImpl.lonNormal(Math.toDegrees(lon) - lon0Degrees); return n * Math.toRadians(dlon); }
/** * Compute theta * * @param lon longitude * @return theta */ private double computeTheta(double lon) { double dlon = LatLonPointImpl.lonNormal(Math.toDegrees(lon) - lon0Degrees); return n * Math.toRadians(dlon); }
void runCenter(double center) { for (double lon=0.0; lon < 380.0; lon += 22.5) { if (debug1) showLatLonNormal( lon, center); double result = LatLonPointImpl.lonNormal( lon, center); assert( result >= center - 180.); assert( result <= center + 180.); assert( (result == lon) || (Math.abs( result-lon) == 360) || (Math.abs( result-lon) == 720)); } }
/** * Convert a LatLonPoint to projection coordinates * * @param latlon convert from these lat, lon coordinates * @param result the object to write to * @return the given result */ public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl result) { result.setLocation(LatLonPointImpl.lonNormal(latlon.getLongitude(), centerLon), latlon.getLatitude()); return result; }