/** * Creates the inverse CoordinateOperation. */ @Override public CoordinateOperation inverse() throws NonInvertibleOperationException { return new LongitudeRotation(-rotationAngle); }
/** * Return a String representation of this Geographic/Geocentric converter. */ @Override public String toString() { return getName() + " ( " + rotationAngle * 180 / Math.PI + "\u00B0 )"; }
/** * Returns true if object is equals to * <code>this</code>. Tests equality between the rotationAngles used by the * transformation. * * @param o The object to compare this LongitudeRotation against */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof LongitudeRotation) { LongitudeRotation lr = (LongitudeRotation) o; return (getRotationAngle() == lr.getRotationAngle()); } return false; }
new Identifier(CoordinateOperationSequence.class, "Geographic Transformation from " + this.getShortName() + " to " + targetDatum.getShortName()), new LongitudeRotation(this.primeMeridian.getLongitudeFromGreenwichInRadians()), new LongitudeRotation(targetDatum.getPrimeMeridian().getLongitudeFromGreenwichInRadians()).inverse()); new Identifier(CoordinateOperationSequence.class, "Geographic Transformation from " + this.getShortName() + " to " + targetDatum.getShortName()), new LongitudeRotation(this.primeMeridian.getLongitudeFromGreenwichInRadians()), new Geographic2Geocentric(ellipsoid), coordOp, new Geocentric2Geographic(targetDatum.getEllipsoid()), new LongitudeRotation(targetDatum.getPrimeMeridian().getLongitudeFromGreenwichInRadians()).inverse());
crs.getDatum().addGeographicTransformation(GeodeticDatum.WGS84, new CoordinateOperationSequence(ntf_r93.getIdentifier(), LongitudeRotation.getLongitudeRotationFrom(crs.getDatum().getPrimeMeridian()), ntf_r93)); crs.getDatum().addGeographicTransformation(GeodeticDatum.RGF93, new CoordinateOperationSequence(ntf_r93.getIdentifier(), LongitudeRotation.getLongitudeRotationFrom(crs.getDatum().getPrimeMeridian()), ntf_r93)); LOGGER.info("Add NTv2 transformation from " + crs.getDatum() + " to RGF93 and WGS84"); } else { new CoordinateOperationSequence( gt.getIdentifier(), new LongitudeRotation(crs.getDatum().getPrimeMeridian().getLongitudeFromGreenwichInRadians()), gt)); LOGGER.info("Add NTv2 transformation from " + crs.getDatum() + " to " + datum);
/** * @return * @throws org.cts.op.NonInvertibleOperationException * @see GeodeticCRS#toGeographicCoordinateConverter() */ @Override public CoordinateOperation toGeographicCoordinateConverter() throws NonInvertibleOperationException { List<CoordinateOperation> ops = new ArrayList<CoordinateOperation>(); ops.add(new Geocentric2Geographic(getDatum().getEllipsoid())); if (!getDatum().getPrimeMeridian().equals(PrimeMeridian.GREENWICH)) { ops.add(LongitudeRotation.getLongitudeRotationTo(getDatum().getPrimeMeridian())); } return new CoordinateOperationSequence(new Identifier( CoordinateOperationSequence.class), ops); }
/** * @return * @throws org.cts.op.NonInvertibleOperationException * @see GeodeticCRS#fromGeographicCoordinateConverter() */ @Override public CoordinateOperation fromGeographicCoordinateConverter() throws NonInvertibleOperationException { List<CoordinateOperation> ops = new ArrayList<CoordinateOperation>(); if (!getDatum().getPrimeMeridian().equals(PrimeMeridian.GREENWICH)) { ops.add(LongitudeRotation.getLongitudeRotationFrom(getDatum().getPrimeMeridian())); } ops.add(new Geographic2Geocentric(getDatum().getEllipsoid())); return new CoordinateOperationSequence(new Identifier( CoordinateOperationSequence.class), ops); }
source.getCode() + " to " + target.getCode() + " through " + datumTransformation.getName()), source.toGeographicCoordinateConverter(), new LongitudeRotation(source.getDatum().getPrimeMeridian().getLongitudeFromGreenwichInRadians()), new Geographic2Geocentric(source.getDatum().getEllipsoid()), datumTransformation, new Geocentric2Geographic(target.getDatum().getEllipsoid()), new LongitudeRotation(target.getDatum().getPrimeMeridian().getLongitudeFromGreenwichInRadians()).inverse(), target.fromGeographicCoordinateConverter()); opList.add(newSequence);
/** * Creates a new LongitudeRotation from Greenwich to this PrimeMeridian. * * @param targetPM target prime meridian */ public static LongitudeRotation getLongitudeRotationTo(PrimeMeridian targetPM) { return new LongitudeRotation(-targetPM.getLongitudeFromGreenwichInRadians()); }
/** * Creates a new LongitudeRotation from this PrimeMeridian to Greenwich. * * @param targetPM target prime meridian */ public static LongitudeRotation getLongitudeRotationFrom(PrimeMeridian targetPM) { return new LongitudeRotation(targetPM.getLongitudeFromGreenwichInRadians()); }