Examples of GeoPoint


Examples of chunmap.model.geom.GeoPoint

  }

  @Test
  public void testContain3() {
    CPoint p = new Coordinate2D(10, 16);
    Envelope envelop1 = new GeoPoint(p).getEnvelop();
    boolean b1 = envelop1.contain(p);
    assertTrue(b1);
  }
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

  @Test
  public void testGetIM() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1 2,3 1,4 0,3 -2,0 0,1 2)");
    LineString ls = (LineString) g;
    GeoPoint p1 = new GeoPoint(1, 0);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, ls).getIM();

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
  }
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

  @Test
  public void testGetIM2() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1 2,3 1,4 0,3 -2,0 0,1 2)");
    LineString ls = (LineString) g;
    GeoPoint p1 = new GeoPoint(0, 0);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, ls).getIM();

    assertFalse(rt.match(IntersectionMatrix.DisjointPattern));
  }
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

  @Test
  public void testMultiPoint2LineString() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1.0 2.0,2.0 2.0,3.0 2.0,4.0 2.0)");
    LineString ls = (LineString) g;
    GeoPoint p1 = new GeoPoint(1.0, 1.0);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, ls).getIM();

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
  }
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

        double x = e.getX();
        double y = e.getY();

        map.getGraphics().drawOval((int)x, (int)y, 5, 5);
       
        GeoPoint p = new GeoPoint(map.getView().x2World(x),map.getView().y2World(y));
        finish(p);
    }
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

    g2 = l2;
  }

  @Override
  protected int inner2innerDim(Geometry g1, Geometry g2) {
    GeoPoint p1 = (GeoPoint) g1;
    LineString l2 = (LineString) g2;

    // 在边界上
    if (im.get(Inner, Border) != EmptyDim)
      return EmptyDim;

    // 在内部
    if (l2.onLineString(p1.getCoordinate()))
      return PointDim;

    return EmptyDim;
  }
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

    switch (type) {
    case ShapefileType.Null:
      return null;

    case ShapefileType.Point:
      geometry = new GeoPoint(helper.readPoint(shaperf));
      break;

    case ShapefileType.Multipoint:
      geometry = helper.readMultiPoint(shaperf);
      break;
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

    Envelope elp;
    if (type == ShapefileType.Null)
      return new Envelope();
    else if (type == ShapefileType.Point || type == ShapefileType.PointM
        || type == ShapefileType.PointZ) {
      elp = new GeoPoint(helper.readPoint(shaperf)).getEnvelop();
    } else {
      elp = helper.readEnvelop(shaperf);
    }

    return elp;
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

   *
   * @param g
   */
  public void add(Geometry g) {
    if (g instanceof GeoPoint) {
      GeoPoint p = (GeoPoint) g;
      if (!points.contains(p)) {
        putPoint(p);
      }
    } else if (g instanceof LineString) {
      LineString line = (LineString) g;
View Full Code Here

Examples of chunmap.model.geom.GeoPoint

  }

  private void putLine(LineString line) {

    // 移除重叠的点
    GeoPoint tp = null;
    for (GeoPoint p : points) {
      if (line.onLineString(p.getCoordinate())) {
        tp = p;
        break;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.