Package chunmap.model.coord

Examples of chunmap.model.coord.CoordinateSeq


    // 合并相连的线
    LineString tl = null;
    CoordSeqEditor newLine = new CoordSeqEditor(line.getPoints());
    for (LineString ls : lines) {
      CoordinateSeq l=ls.getPoints();
      if (newLine.canJoin(l)) {
        newLine.join(l);
        tl = ls;
        break;
      }
View Full Code Here


        return new MultiGeometry<Geometry>(gs);
    }

    public Polygon createPolygon(CoordinateSeq shell, CoordinateSeq[] holes)
    {
        CoordinateSeq nshell = shell.transform(precision.getTransform());

        if (holes != null && holes.length > 0)
        {
            List<Ring> nholes = new ArrayList<Ring>();
            int i = 0;
View Full Code Here

    }
   
    public MultiLineString createMultiLineString(List<CoordinateSeq> seqList){
      List<LineString> lss = new ArrayList<LineString>();
      for(CoordinateSeq cq:seqList){
        CoordinateSeq nca = cq.transform(precision.getTransform());
        lss.add(new LineString(nca));
      }
      return new MultiLineString(lss);
    }
View Full Code Here

      return new MultiLineString(lss);
    }

    public LineString createLineString(double[] x, double[] y)
    {
        CoordinateSeq ca = new CoordinateArray(x, y);
        CoordinateSeq nca = ca.transform(precision.getTransform());
        return new LineString(nca);
    }
View Full Code Here

        if (ml.size() == 0)
        {
            throw new IllegalArgumentException("IllegalArgument exist");
        }
        int i = (ml.size() == 1) ? 0 : 1;
        CoordinateSeq tl = ml.get(i);
        List<CoordinateSeq> ml2 = splitLine(tl, end);
        return ml2.get(0);
    }
View Full Code Here

        return ml2.get(0);
    }

    public static List<CoordinateSeq> splitLine(CoordinateSeq points, CPoint p)
    {
        CoordinateSeq lineString = (CoordinateSeq)points.clone();
        if (!LineAlgorithm.onLineString(points, p))
        {
            return new ArrayList<CoordinateSeq>();
        }
        if (onBorder(lineString, p))
        {
            List<CoordinateSeq> lines = new ArrayList<CoordinateSeq>();
            lines.add(points);
            return lines;
        }
        // 分裂
        List<CPoint> points1 = new ArrayList<CPoint>();
        List<CPoint> points2 = new ArrayList<CPoint>();
        for (int i = 0, n = points.size() - 1; i < n; i++)
        {
            LineSegment lseg = new LineSegment(points.getCoordinate(i), points.getCoordinate(i+1));
            if (lseg.onLineSegment(p))
            {
                List<CPoint> tpoints = subList(points, 0, i + 1);
                points1.addAll(tpoints);
                points1.add(p);

                if (!lseg.onBorder(p))
                {
                    points2.add(p);
                }
                List<CPoint> tpoints2 = subList(points, i + 1, n + 1);
                points2.addAll(tpoints2);
                break;
            }
        }
        // 构造多线
        CoordinateSeq l1 = new CoordinateArray(points1.toArray(new CPoint[0]));
        CoordinateSeq l2 = new CoordinateArray(points2.toArray(new CPoint[0]));
        List<CoordinateSeq> lines2 = new ArrayList<CoordinateSeq>();
        lines2.add(l1);
        lines2.add(l2);
        return lines2;
        //return null;
View Full Code Here

TOP

Related Classes of chunmap.model.coord.CoordinateSeq

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.