public double getSemiMinorAxis() { return getReferencedObject().getSemiMinorAxis(); }
/** * @return the semiMinorAxis (a) of the ellipsoid of the datum. */ public final double getSemiMinorAxis( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getEllipsoid().getSemiMinorAxis(); }
|| Math.abs( sourceEl.getSemiMinorAxis() - gsf.getFromSemiMinor() ) > 0.001 ) { LOG.warn( "The given source CRS' ellipsoid (" + sourceEl.getCode().getOriginal() + ") does not match the 'from' ellipsoid (" + fromEllips + ")defined in the gridfile: " + gridURL ); || Math.abs( targetEl.getSemiMinorAxis() - gsf.getToSemiMinor() ) > 0.001 ) { LOG.warn( "The given target CRS' ellipsoid (" + targetEl.getCode().getOriginal() + ") does not match the 'to' ellipsoid (" + toEllips + ") defined in the gridfile: " + gridURL );
/** * @param sourceCRS * @param targetCRS * @param id * @param gsf * the loaded gridshift file */ public NTv2Transformation( ICRS sourceCRS, ICRS targetCRS, CRSResource id, GridShiftFile gsf ) { this( sourceCRS, targetCRS, id ); this.gsf = gsf; String fromEllips = gsf.getFromEllipsoid(); String toEllips = gsf.getToEllipsoid(); IEllipsoid sourceEl = sourceCRS.getGeodeticDatum().getEllipsoid(); IEllipsoid targetEl = targetCRS.getGeodeticDatum().getEllipsoid(); // rb: patched the gridshift file for access to the axis if ( Math.abs( sourceEl.getSemiMajorAxis() - gsf.getFromSemiMajor() ) > 0.001 || Math.abs( sourceEl.getSemiMinorAxis() - gsf.getFromSemiMinor() ) > 0.001 ) { LOG.warn( "The given source CRS' ellipsoid (" + sourceEl.getCode().getOriginal() + ") does not match the 'from' ellipsoid (" + fromEllips + ")defined in the gridfile: " + gridURL ); } if ( Math.abs( targetEl.getSemiMajorAxis() - gsf.getToSemiMajor() ) > 0.001 || Math.abs( targetEl.getSemiMinorAxis() - gsf.getToSemiMinor() ) > 0.001 ) { LOG.warn( "The given target CRS' ellipsoid (" + targetEl.getCode().getOriginal() + ") does not match the 'to' ellipsoid (" + toEllips + ") defined in the gridfile: " + gridURL ); } isIdentity = ( Math.abs( gsf.getFromSemiMajor() - gsf.getToSemiMajor() ) < 0.001 ) && ( Math.abs( gsf.getFromSemiMinor() - gsf.getToSemiMinor() ) < 0.001 ); }
double a = ellips.getSemiMajorAxis(); double f = ellips.getInverseFlattening(); double b = ellips.getSemiMinorAxis(); double ea = rs.getDouble( count++ ); double ef = rs.getDouble( count++ );
private void calcParams() { if ( getSourceCRS().getType() == CRSType.COMPOUND ) { this.hasHeight = true; defaultHeightValue = ( (ICompoundCRS) getSourceCRS() ).getDefaultHeight(); } else if ( getTargetCRS().getType() == CRSType.COMPOUND ) { this.hasHeight = true; defaultHeightValue = ( (ICompoundCRS) getTargetCRS() ).getDefaultHeight(); } else { this.hasHeight = false; defaultHeightValue = 0; } IEllipsoid ellipsoid = getSourceCRS().getGeodeticDatum().getEllipsoid(); semiMajorAxis = Unit.METRE.convert( ellipsoid.getSemiMajorAxis(), ellipsoid.getUnits() ); semiMinorAxis = Unit.METRE.convert( ellipsoid.getSemiMinorAxis(), ellipsoid.getUnits() ); squaredSemiMajorAxis = semiMajorAxis * semiMajorAxis; squaredSemiMinorAxis = semiMinorAxis * semiMinorAxis; squaredEccentricity = ellipsoid.getSquaredEccentricity(); // e2 = ( a2 - b2 ) / a2; ep2 = ( squaredSemiMajorAxis - squaredSemiMinorAxis ) / squaredSemiMinorAxis; }