本文整理了Java中org.apache.sis.util.Utilities.equalsApproximatively()
方法的一些代码示例,展示了Utilities.equalsApproximatively()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.equalsApproximatively()
方法的具体详情如下:
包路径:org.apache.sis.util.Utilities
类名称:Utilities
方法名:equalsApproximatively
[英]Compares the specified objects for equality, ignoring metadata and slight differences in numerical values. If this method returns true, then:
org.apache.sis.referencing.CRS#findOperation(crs1, crs2, null)
will return an operation close to identity.org.apache.sis.referencing.CRS#findOperation(crs1, crs2, null)
的调用将返回一个接近identity的操作。代码示例来源:origin: Geomatys/geotoolkit
return Utilities.equalsApproximatively(object1, object2);
代码示例来源:origin: apache/sis
final SingleCRS crsA = authoritative.next();
final SingleCRS crsG = given.next();
if (!Utilities.equalsApproximatively(crsA, crsG)) {
if (crsA instanceof GeneralDerivedCRS && crsG instanceof GeneralDerivedCRS) {
final Conversion cnvA = ((GeneralDerivedCRS) crsA).getConversionFromBase();
final Conversion cnvG = ((GeneralDerivedCRS) crsG).getConversionFromBase();
if (!Utilities.equalsApproximatively(cnvA, cnvG)) {
return Utilities.equalsApproximatively(cnvA.getMethod(), cnvG.getMethod()) ? CONVERSION : METHOD;
if (!Utilities.equalsApproximatively(crsA.getCoordinateSystem(), crsG.getCoordinateSystem())) {
return CS;
if (!Utilities.equalsApproximatively(datumA, datumG)) {
if ((datumA instanceof GeodeticDatum) && (datumG instanceof GeodeticDatum) &&
!Utilities.equalsApproximatively(((GeodeticDatum) datumA).getPrimeMeridian(),
((GeodeticDatum) datumG).getPrimeMeridian()))
代码示例来源:origin: org.apache.sis.core/sis-referencing
final SingleCRS crsA = authoritative.next();
final SingleCRS crsG = given.next();
if (!Utilities.equalsApproximatively(crsA, crsG)) {
if (crsA instanceof GeneralDerivedCRS && crsG instanceof GeneralDerivedCRS) {
final Conversion cnvA = ((GeneralDerivedCRS) crsA).getConversionFromBase();
final Conversion cnvG = ((GeneralDerivedCRS) crsG).getConversionFromBase();
if (!Utilities.equalsApproximatively(cnvA, cnvG)) {
return Utilities.equalsApproximatively(cnvA.getMethod(), cnvG.getMethod()) ? CONVERSION : METHOD;
if (!Utilities.equalsApproximatively(crsA.getCoordinateSystem(), crsG.getCoordinateSystem())) {
return CS;
if (!Utilities.equalsApproximatively(datumA, datumG)) {
if ((datumA instanceof GeodeticDatum) && (datumG instanceof GeodeticDatum) &&
!Utilities.equalsApproximatively(((GeodeticDatum) datumA).getPrimeMeridian(),
((GeodeticDatum) datumG).getPrimeMeridian()))
代码示例来源:origin: apache/sis
if (parameters != null) {
CoordinateReferenceSystem crs;
if (Utilities.equalsApproximatively(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
if (Utilities.equalsApproximatively(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
final MathTransformFactory mtFactory = factorySIS.getMathTransformFactory();
if (mtFactory instanceof DefaultMathTransformFactory) {
代码示例来源:origin: org.apache.sis.core/sis-referencing
if (Utilities.equalsApproximatively(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
if (Utilities.equalsApproximatively(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
final Map<String,Object> properties = new HashMap<String,Object>(derivedFrom(operation));
代码示例来源:origin: apache/sis
if (Utilities.equalsApproximatively(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
if (Utilities.equalsApproximatively(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
final Map<String,Object> properties = new HashMap<>(derivedFrom(operation));
代码示例来源:origin: org.apache.sis.core/sis-referencing
if (parameters != null) {
CoordinateReferenceSystem crs;
if (Utilities.equalsApproximatively(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
if (Utilities.equalsApproximatively(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
final MathTransformFactory mtFactory = factorySIS.getMathTransformFactory();
if (mtFactory instanceof DefaultMathTransformFactory) {
代码示例来源:origin: Geomatys/geotoolkit
private static UnaryOperator<Coordinate> getTransformer(final CoordinateReferenceSystem target) throws FactoryException {
if (org.apache.sis.util.Utilities.equalsApproximatively(target, CommonCRS.defaultGeographic())) {
return UnaryOperator.identity();
} else {
final CoordinateOperation op = CRS.findOperation(CommonCRS.defaultGeographic(), target, null);
final MathTransform geoToTarget = op.getMathTransform();
return c -> Utilities.transform(c, geoToTarget, false);
}
}
内容来源于网络,如有侵权,请联系作者删除!