CPD Results

The following document contains the results of PMD's CPD 4.3.

Duplications

File Line
org/deegree/cs/transformations/ntv2/NTv2Transformation.java 147
org/deegree/cs/transformations/ntv2/NTv2Transformation.java 180
        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 );
    }
File Line
org/deegree/cs/persistence/deegree/d3/parsers/ProjectionParser.java 236
org/deegree/cs/persistence/deegree/d3/parsers/TransformationParser.java 270
                                                           scaleFactor, reader );
        } catch ( ClassNotFoundException e ) {
            LOG.error( e.getMessage(), e );
        } catch ( SecurityException e ) {
            LOG.error( e.getMessage(), e );
        } catch ( NoSuchMethodException e ) {
            LOG.error( e.getMessage(), e );
        } catch ( IllegalArgumentException e ) {
            LOG.error( e.getMessage(), e );
        } catch ( InstantiationException e ) {
            LOG.error( e.getMessage(), e );
        } catch ( IllegalAccessException e ) {
            LOG.error( e.getMessage(), e );
        } catch ( InvocationTargetException e ) {
            LOG.error( e.getMessage(), e );
        }
        if ( result == null ) {
            LOG.debug( "Loading of user defined projection class: " + className + " was not successful" );
File Line
org/deegree/cs/transformations/TransformationFactory.java 497
org/deegree/cs/transformations/TransformationFactory.java 530
org/deegree/cs/transformations/TransformationFactory.java 563
    private Transformation createFromGeocentric( IGeocentricCRS sourceCRS, ICRS targetCRS )
                            throws TransformationException {

        targetCRS = resolve( targetCRS );
        Transformation result = null;
        CRSType type = targetCRS.getType();
        switch ( type ) {
        case COMPOUND:
            ICompoundCRS target = (ICompoundCRS) targetCRS;
            ICompoundCRS sTmp = new CompoundCRS(
                                                 target.getHeightAxis(),
                                                 sourceCRS,
                                                 target.getDefaultHeight(),
                                                 new CRSIdentifiable(
                                                                      new CRSCodeType[] { CRSCodeType.valueOf( sourceCRS.getCode()
                                                                                                               + "_compound" ) } ) );
            result = createTransformation( sTmp, target );
            break;
        case GEOCENTRIC:
            result = createTransformation( sourceCRS, (IGeocentricCRS) targetCRS );
            break;
        case GEOGRAPHIC:
            result = createTransformation( sourceCRS, (IGeographicCRS) targetCRS );
            break;
        case PROJECTED:
            result = createTransformation( sourceCRS, (IProjectedCRS) targetCRS );
            break;
        case VERTICAL:
            break;
        }
        return result;
    }

    private Transformation createFromProjected( IProjectedCRS sourceCRS, ICRS targetCRS )
File Line
org/deegree/cs/configuration/wkt/WKTParser.java 686
org/deegree/cs/configuration/wkt/WKTParser.java 764
        Axis axis3 = new Axis( "Z", Axis.AO_NORTH );
        CRSCodeType code = CRSCodeType.getUndefined();
        while ( true ) {
            tokenizer.nextToken();
            switch ( tokenizer.ttype ) {
            case '"':
                name = tokenizer.sval;
                break;
            case StreamTokenizer.TT_WORD:
                if ( tokenizer.sval.equalsIgnoreCase( "DATUM" ) ) {
                    tokenizer.pushBack();
                    datum = parseGeodeticDatum();
                } else if ( tokenizer.sval.equalsIgnoreCase( "PRIMEM" ) ) {
                    tokenizer.pushBack();
                    pm = parsePrimeMeridian();
                } else if ( tokenizer.sval.equalsIgnoreCase( "UNIT" ) ) {
                    tokenizer.pushBack();
                    unit = parseUnit();
                } else if ( tokenizer.sval.equalsIgnoreCase( "AXIS" ) ) {
                    tokenizer.pushBack();
                    axis1 = parseAxis();
                    passOverChar( ',' );
                    axis2 = parseAxis();