Package org.geotools.referencing.operation.builder

Examples of org.geotools.referencing.operation.builder.MappedPosition


                    double d4 = Double.parseDouble(matcherPoint.group(4));
                   
                    DirectPosition p1 = new DirectPosition2D(null, d1, d2);
                    DirectPosition p2 = new DirectPosition2D(null, d3, d4);
                   
                    controlPoints.add(new MappedPosition(p2, p1));                   
                } else {
                    Matcher matcherCoordSys = patternCoordSys.matcher(str);
                    if (matcherCoordSys.find()) {
                        try {
                            int projectionType = Integer.parseInt(matcherCoordSys.group(1));
View Full Code Here


     *         difference between them is the same as for the nearest one
     *         MappedPosition. It is used for calculating destination quad.
     */
    protected MappedPosition generateCoordFromNearestOne(DirectPosition x,
        List <MappedPosition> vertices) {
        MappedPosition nearestOne = nearestMappedCoordinate(x, vertices);

        double dstX = x.getCoordinate()[0]
            + (nearestOne.getTarget().getCoordinate()[0]
            - nearestOne.getSource().getCoordinate()[0]);
        double dstY = x.getCoordinate()[1]
            + (nearestOne.getTarget().getCoordinate()[1]
            - nearestOne.getSource().getCoordinate()[1]);
        DirectPosition dst = new DirectPosition2D(nearestOne.getTarget()
                                                            .getCoordinateReferenceSystem(),
                dstX, dstY);

        return new MappedPosition(x, dst);
    }
View Full Code Here

    protected MappedPosition nearestMappedCoordinate(DirectPosition dp,
        List <MappedPosition> vertices) {
        DirectPosition2D x = new DirectPosition2D(dp);

        // Assert.isTrue(vectors.size() > 0);
        MappedPosition nearestOne = (MappedPosition) vertices.get(0);

        for (Iterator <MappedPosition> i = vertices.iterator(); i.hasNext();) {
            MappedPosition candidate = (MappedPosition) i.next();

            if (((DirectPosition2D) candidate.getSource()).distance(
                        x.toPoint2D()) < ((DirectPosition2D) nearestOne
                    .getSource()).distance(x.toPoint2D())) {
                nearestOne = candidate;
            }
        }
View Full Code Here

                                                       (new Float(line[1])).floatValue());
      DirectPosition sp = new DirectPosition2D(null,
                                             (new Float(line[2])).floatValue(),
                                             (new Float(line[3])).floatValue());
     
      MappedPosition mp = new MappedPosition(sp, tp);
      mps.add(mp);   
     
    }         
      
    return mps;
View Full Code Here

TOP

Related Classes of org.geotools.referencing.operation.builder.MappedPosition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.