/** * Returns the length of the semi-major axis of the ellipsoid. * The default implementation delegates to {@link Earth#getMajor()}. * * @return length of semi-major axis. * * @see Earth#getMajor() */ @Override public double getSemiMajorAxis() { return earth.getMajor(); }
public void initialize() { this.e = ellipsoid.getEccentricity(); this.es = ellipsoid.getEccentricitySquared(); this.spherical = (e == 0.0); this.one_es = 1.0 - es; this.totalScale = ellipsoid.getMajor() * .001; // scale factor for cartesion coords in km. if (spherical) { esp = scaleFactor; ml0 = .5 * esp; } else { en = MapMath.enfn(es); ml0 = MapMath.mlfn(projectionLatitude, Math.sin(projectionLatitude), Math.cos(projectionLatitude), en); esp = es / (1. - es); } }
public void initialize() { this.e = ellipsoid.getEccentricity(); this.es = ellipsoid.getEccentricitySquared(); this.spherical = (e == 0.0); this.one_es = 1.0-es; this.totalScale = ellipsoid.getMajor(); // scale factor for cartesion coords in km. if (spherical) { esp = scaleFactor; ml0 = .5 * esp; } else { en = MapMath.enfn(es); ml0 = MapMath.mlfn(projectionLatitude, Math.sin(projectionLatitude), Math.cos(projectionLatitude), en); esp = es / (1. - es); } }
public void initialize() { this.e = ellipsoid.getEccentricity(); this.es = ellipsoid.getEccentricitySquared(); this.spherical = (e == 0.0); this.one_es = 1.0 - es; this.totalScale = ellipsoid.getMajor() * .001; // scale factor for cartesion coords in km. if (spherical) { esp = scaleFactor; ml0 = .5 * esp; } else { en = MapMath.enfn(es); ml0 = MapMath.mlfn(projectionLatitude, Math.sin(projectionLatitude), Math.cos(projectionLatitude), en); esp = es / (1. - es); } }
public void initialize() { this.e = ellipsoid.getEccentricity(); this.es = ellipsoid.getEccentricitySquared(); this.spherical = (e == 0.0); this.one_es = 1.0 - es; this.totalScale = ellipsoid.getMajor() * .001; // scale factor for cartesion coords in km. if (spherical) { esp = scaleFactor; ml0 = .5 * esp; } else { en = MapMath.enfn(es); ml0 = MapMath.mlfn(projectionLatitude, Math.sin(projectionLatitude), Math.cos(projectionLatitude), en); esp = es / (1. - es); } }
@Override public boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2) { // TODO: check, taken from ucar.unidata.geoloc.projection.TransverseMercator // either point is infinite if (ProjectionPointImpl.isInfinite(pt1) || ProjectionPointImpl.isInfinite(pt2)) { return true; } double y1 = pt1.getY() - falseNorthing; double y2 = pt2.getY() - falseNorthing; // opposite signed long lines return (y1 * y2 < 0) && (Math.abs(y1 - y2) > 2 * ellipsoid.getMajor()); }
@Override public boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2) { // TODO: check, taken from ucar.unidata.geoloc.projection.TransverseMercator // either point is infinite if (ProjectionPointImpl.isInfinite(pt1) || ProjectionPointImpl.isInfinite(pt2)) { return true; } double y1 = pt1.getY() - falseNorthing; double y2 = pt2.getY() - falseNorthing; // opposite signed long lines return (y1 * y2 < 0) && (Math.abs(y1 - y2) > 2 * ellipsoid.getMajor()); }
@Override public boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2) { // TODO: check, taken from ucar.unidata.geoloc.projection.TransverseMercator // either point is infinite if (ProjectionPointImpl.isInfinite(pt1) || ProjectionPointImpl.isInfinite(pt2)) { return true; } double y1 = pt1.getY() - falseNorthing; double y2 = pt2.getY() - falseNorthing; // opposite signed long lines: LOOK ???? return (y1 * y2 < 0) && (Math.abs(y1 - y2) > 2 * ellipsoid.getMajor()); }
@Override public boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2) { // TODO: check, taken from ucar.unidata.geoloc.projection.TransverseMercator // either point is infinite if (ProjectionPointImpl.isInfinite(pt1) || ProjectionPointImpl.isInfinite(pt2)) { return true; } double y1 = pt1.getY() - falseNorthing; double y2 = pt2.getY() - falseNorthing; // opposite signed long lines return (y1 * y2 < 0) && (Math.abs(y1 - y2) > 2 * ellipsoid.getMajor()); }
public PolyconicProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth ellipsoid) { super("Polyconic", false); //Initialization this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.ellipsoid = ellipsoid; this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.es = this.ellipsoid.getEccentricitySquared(); this.totalScale = this.ellipsoid.getMajor() * .001; initialize(); //Adding parameters addParameter(CF.GRID_MAPPING_NAME, name); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, ellipsoid.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0 / ellipsoid.getFlattening()); }
public PolyconicProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth ellipsoid) { super("Polyconic", false); //Initialization this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.ellipsoid = ellipsoid; this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.es = this.ellipsoid.getEccentricitySquared(); this.totalScale = this.ellipsoid.getMajor() * .001; initialize(); //Adding parameters addParameter(CF.GRID_MAPPING_NAME, name); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, ellipsoid.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0 / ellipsoid.getFlattening()); }
public PolyconicProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth ellipsoid) { super("Polyconic", false); //Initialization this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.ellipsoid = ellipsoid; this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.es = this.ellipsoid.getEccentricitySquared(); this.totalScale = this.ellipsoid.getMajor() * .001; initialize(); //Adding parameters addParameter(CF.GRID_MAPPING_NAME, name); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, ellipsoid.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0 / ellipsoid.getFlattening()); }
public EquidistantAzimuthalProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth earth) { super("EquidistantAzimuthalProjection", false); this.lat0 = lat0; this.lon0 = lon0; this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.earth = earth; this.e = earth.getEccentricity(); this.es = earth.getEccentricitySquared(); this.one_es = 1 - es; this.totalScale = earth.getMajor() * .001; // scale factor for cartesion coords in km. addParameter(CF.GRID_MAPPING_NAME, CF.AZIMUTHAL_EQUIDISTANT); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, earth.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0/earth.getFlattening()); initialize(); }
public EquidistantAzimuthalProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth earth) { super("EquidistantAzimuthalProjection", false); this.lat0 = lat0; this.lon0 = lon0; this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.earth = earth; this.e = earth.getEccentricity(); this.es = earth.getEccentricitySquared(); this.one_es = 1 - es; this.totalScale = earth.getMajor() * .001; // scale factor for cartesion coords in km. addParameter(CF.GRID_MAPPING_NAME, CF.AZIMUTHAL_EQUIDISTANT); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, earth.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0 / earth.getFlattening()); initialize(); }
/** * Set up a projection suitable for State Plane Coordinates. * Best used with earth ellipsoid and false-easting/northing in km */ public TransverseMercatorProjection(Earth ellipsoid, double lon_0_deg, double lat_0_deg, double k, double falseEast, double falseNorth) { this.ellipsoid = ellipsoid; projectionLongitude = Math.toRadians(lon_0_deg); projectionLatitude = Math.toRadians(lat_0_deg); scaleFactor = k; falseEasting = falseEast; falseNorthing = falseNorth; initialize(); // parameters addParameter(ATTR_NAME, "transverse_mercator"); addParameter("longitude_of_central_meridian", lon_0_deg); addParameter("latitude_of_projection_origin", lat_0_deg); addParameter("scale_factor_at_central_meridian", scaleFactor); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter("false_easting", falseEasting); addParameter("false_northing", falseNorthing); addParameter("units", "km"); } addParameter("semi_major_axis", ellipsoid.getMajor()); addParameter("inverse_flattening", 1.0/ellipsoid.getFlattening()); //System.err.println(paramsToString()); }
/** * Set up a projection suitable for State Plane Coordinates. * Best used with earth ellipsoid and false-easting/northing in km */ public TransverseMercatorProjection(Earth ellipsoid, double lon_0_deg, double lat_0_deg, double k, double falseEast, double falseNorth) { super("TransverseMercatorProjection", false); this.ellipsoid = ellipsoid; projectionLongitude = Math.toRadians(lon_0_deg); projectionLatitude = Math.toRadians(lat_0_deg); scaleFactor = k; falseEasting = falseEast; falseNorthing = falseNorth; initialize(); // parameters addParameter(CF.GRID_MAPPING_NAME, CF.TRANSVERSE_MERCATOR); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon_0_deg); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat_0_deg); addParameter(CF.SCALE_FACTOR_AT_CENTRAL_MERIDIAN, scaleFactor); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, ellipsoid.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0 / ellipsoid.getFlattening()); //System.err.println(paramsToString()); }
private void addAlbersEqualAreaEllipseTags(AlbersEqualAreaEllipse proj) { geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GTModelTypeGeoKey, GeoKey.TagValue.ModelType_Projected)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GTRasterTypeGeoKey, GeoKey.TagValue.RasterType_Area)); // define the "geographic Coordinate System" geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeographicTypeGeoKey, GeoKey.TagValue.GeographicType_WGS_84)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogLinearUnitsGeoKey, GeoKey.TagValue.ProjLinearUnits_METER)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogSemiMajorAxisGeoKey, proj.getEarth().getMajor())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogSemiMinorAxisGeoKey, proj.getEarth().getMinor())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogAngularUnitsGeoKey, GeoKey.TagValue.GeogAngularUnits_DEGREE)); // define the "coordinate transformation" geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjectedCSTypeGeoKey, GeoKey.TagValue.ProjectedCSType_UserDefined)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.PCSCitationGeoKey, "Albers Conial Equal Area")); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjectionGeoKey, GeoKey.TagValue.ProjectedCSType_UserDefined)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjLinearUnitsGeoKey, GeoKey.TagValue.ProjLinearUnits_METER)); //geotiff.addGeoKey( new GeoKey( GeoKey.Tag.ProjLinearUnitsSizeGeoKey, 1.0)); // units of km // the specifics for mercator geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjCoordTransGeoKey, GeoKey.TagValue.ProjCoordTrans_AlbersEqualAreaEllipse)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjNatOriginLatGeoKey, proj.getOriginLat())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjNatOriginLongGeoKey, proj.getOriginLon())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjStdParallel1GeoKey, proj.getParallelOne())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjStdParallel2GeoKey, proj.getParallelTwo())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjFalseEastingGeoKey, 0.0)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjFalseNorthingGeoKey, 0.0)); }
private void addAlbersEqualAreaEllipseTags(AlbersEqualAreaEllipse proj) { geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GTModelTypeGeoKey, GeoKey.TagValue.ModelType_Projected)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GTRasterTypeGeoKey, GeoKey.TagValue.RasterType_Area)); // define the "geographic Coordinate System" geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeographicTypeGeoKey, GeoKey.TagValue.GeographicType_WGS_84)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogLinearUnitsGeoKey, GeoKey.TagValue.ProjLinearUnits_METER)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogSemiMajorAxisGeoKey, proj.getEarth().getMajor())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogSemiMinorAxisGeoKey, proj.getEarth().getMinor())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogAngularUnitsGeoKey, GeoKey.TagValue.GeogAngularUnits_DEGREE)); // define the "coordinate transformation" geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjectedCSTypeGeoKey, GeoKey.TagValue.ProjectedCSType_UserDefined)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.PCSCitationGeoKey, "Albers Conial Equal Area")); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjectionGeoKey, GeoKey.TagValue.ProjectedCSType_UserDefined)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjLinearUnitsGeoKey, GeoKey.TagValue.ProjLinearUnits_METER)); //geotiff.addGeoKey( new GeoKey( GeoKey.Tag.ProjLinearUnitsSizeGeoKey, 1.0)); // units of km // the specifics for mercator geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjCoordTransGeoKey, GeoKey.TagValue.ProjCoordTrans_AlbersEqualAreaEllipse)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjNatOriginLatGeoKey, proj.getOriginLat())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjNatOriginLongGeoKey, proj.getOriginLon())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjStdParallel1GeoKey, proj.getParallelOne())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjStdParallel2GeoKey, proj.getParallelTwo())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjFalseEastingGeoKey, 0.0)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjFalseNorthingGeoKey, 0.0)); }
private void addAlbersEqualAreaEllipseTags(AlbersEqualAreaEllipse proj) { geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GTModelTypeGeoKey, GeoKey.TagValue.ModelType_Projected)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GTRasterTypeGeoKey, GeoKey.TagValue.RasterType_Area)); // define the "geographic Coordinate System" geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeographicTypeGeoKey, GeoKey.TagValue.GeographicType_WGS_84)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogLinearUnitsGeoKey, GeoKey.TagValue.ProjLinearUnits_METER)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogSemiMajorAxisGeoKey, proj.getEarth().getMajor())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogSemiMinorAxisGeoKey, proj.getEarth().getMinor())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.GeogAngularUnitsGeoKey, GeoKey.TagValue.GeogAngularUnits_DEGREE)); // define the "coordinate transformation" geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjectedCSTypeGeoKey, GeoKey.TagValue.ProjectedCSType_UserDefined)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.PCSCitationGeoKey, "Albers Conial Equal Area")); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjectionGeoKey, GeoKey.TagValue.ProjectedCSType_UserDefined)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjLinearUnitsGeoKey, GeoKey.TagValue.ProjLinearUnits_METER)); //geotiff.addGeoKey( new GeoKey( GeoKey.Tag.ProjLinearUnitsSizeGeoKey, 1.0)); // units of km // the specifics for mercator geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjCoordTransGeoKey, GeoKey.TagValue.ProjCoordTrans_AlbersEqualAreaEllipse)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjNatOriginLatGeoKey, proj.getOriginLat())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjNatOriginLongGeoKey, proj.getOriginLon())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjStdParallel1GeoKey, proj.getParallelOne())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjStdParallel2GeoKey, proj.getParallelTwo())); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjFalseEastingGeoKey, 0.0)); geotiff.addGeoKey(new GeoKey(GeoKey.Tag.ProjFalseNorthingGeoKey, 0.0)); }