Package chunmap.model.coord

Examples of chunmap.model.coord.CPoint


    Line l = sl.toLine();
    double a = Math.atan(l.getVerticalK());// 角度
    double dx = distance * Math.cos(a);
    double dy = distance * Math.sin(a);

    CPoint p1 = new Coordinate2D(sl.getStartPoint().getX() - dx, sl.getStartPoint()
        .getY()
        - dy);
    CPoint p2 = new Coordinate2D(sl.getStartPoint().getX() + dx, sl.getStartPoint()
        .getY()
        + dy);
    CPoint p3 = new Coordinate2D(sl.getEndPoint().getX() + dx, sl.getEndPoint()
        .getY()
        + dy);
    CPoint p4 = new Coordinate2D(sl.getEndPoint().getX() - dx, sl.getEndPoint()
        .getY()
        - dy);

    CoordSeqEditor ls = new CoordSeqEditor();
    ls.addPointToLast(p1);
View Full Code Here


    for (int i = 0, n = ls.size() - 1; i < n; i++) {
      LineSegment lseg = ls.getLineSegment(i);

      // 线的缓冲区
      Polygon lineBuffer = singleLineNoCapBuffer(lseg, distance);
      CPoint point = ls.getPoint(i + 1);

      // 结尾点的缓冲
      Polygon pointBuffer = pb.createBuffer(point, distance);

      pg = op.computeUnion(lineBuffer, pg).getGeometry(0);
View Full Code Here

      text = text.substring(tIndex);

      if (type.equalsIgnoreCase("BOX")) {
        String[] str = text.split(",");

        CPoint p1 = getPoint(str[0]);
        CPoint p2 = getPoint(str[1]);

        return new Envelope(p1, p2);
      } else
        throw new IllegalArgumentException("Unknow geometry");
View Full Code Here

    int xIndex = text.indexOf(' ');

    double x = Double.parseDouble(text.substring(0, xIndex));
    double y = Double.parseDouble(text.substring(xIndex));

    CPoint p = new Coordinate2D(x, y);
    return p;
  }
View Full Code Here

    text = text.trim();
    List<CPoint> points = new ArrayList<CPoint>();
    String[] str = text.split(",");

    for (String s : str) {
      CPoint p = getPoint(s);
      points.add(p);
    }
    return points;
  }
View Full Code Here

    Envelope env=geo.getEnvelop().transform(view.world2Screen());
    if(env.getWidth()+env.getHeight()<labelHide)return;
   
    AttributedString astring = new AttributedString(text);
    astring.addAttribute(TextAttribute.FOREGROUND, stringColor);
    CPoint p = env.getCenter();
    g.drawString(astring.getIterator(), (int) p.getX(), (int) p.getY());
  }
View Full Code Here

    }

    List<LineString> lineList = this.getLineList();
    for (LineString l : lineList) {

      CPoint p1 = l.firstPoint();
      CPoint p2 = l.lastPoint();
      breakLine(p1, lines);
      breakLine(p2, lines);
    }

    return lines;
View Full Code Here

  private void check(){
    if (size() < 4) {
      throw new IllegalArgumentException(
          "least three points(four pair coordinate)");
    }
    CPoint fp = super.firstPoint();
    CPoint lp = super.lastPoint();
    if (!(fp.equals(lp)))
      throw new IllegalArgumentException(
          "firstPoint mast same to lastPoint in a ring");
  }
View Full Code Here

  @Override
  protected boolean isSimple() {
    if (!super.isSimple())
      return false;

    CPoint fp = super.firstPoint();
    CPoint tp = super.lastPoint();
    for (int i = 1, n = size() - 1; i < n; i++) {
      CPoint p = getPoint(i);
      if (fp.equals(p) || tp.equals(p)) {
        return false;
      }
    }
    return true;
View Full Code Here

    GeoPoint p = new GeoPoint(1, 1);
    PointBuffer pb = new PointBuffer();
    geoms.add(pb.createBuffer(p.getCoordinate(), 5));
    geoms.add(p);

    CPoint p1 = new Coordinate2D(-5, -5);
    CPoint p2 = new Coordinate2D(-10, -10);
    LineSegment lseg = new LineSegment(p1, p2);
    LineBuffer lb = new LineBuffer();
    geoms.add(lb.singleLineNoCapBuffer(lseg, 5));
    geoms.add(lseg.toLineString());
  }
View Full Code Here

TOP

Related Classes of chunmap.model.coord.CPoint

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.