Examples of IntersectionMatrix


Examples of chunmap.model.relate.IntersectionMatrix

      return false;
    }

    for (Ring r : a2.getHoles()) {
      ComputeIm l2r = new LineString_LinearRing(l1, r);
      IntersectionMatrix tim = l2r.getIM();
      if (tim.get(Inner, Inner) != EmptyDim) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

Examples of chunmap.model.relate.IntersectionMatrix

  protected int inner2innerDim(Geometry g1, Geometry g2) {
    Polygon a1 = (Polygon) g1;
    Polygon a2 = (Polygon) g2;
    ComputeIm r2r = new LinearRing_LinearRing(a1.getShell(), a2
        .getShell());
    IntersectionMatrix tim = r2r.getIM();
    if (tim.get(Inner, Inner) != EmptyDim) {
      if (!inHoles(a1.getShell(), a2) && !inHoles(a2.getShell(), a1))
        return AreaDim;
    }
    return EmptyDim;
  }
View Full Code Here

Examples of chunmap.model.relate.IntersectionMatrix

    Polygon a1 = (Polygon) g1;
    Polygon a2 = (Polygon) g2;
    ComputeIm r2r = new LinearRing_LinearRing(a1.getShell(), a2
        .getShell());
    IntersectionMatrix tim = r2r.getIM();

    if (tim.get(Inner, Outer) != EmptyDim)
      return false;

    for (Ring r2 : a2.getHoles()) {
      ComputeIm r2r2 = new LinearRing_LinearRing(a1.getShell(), r2);
      IntersectionMatrix tim2 = r2r2.getIM();
      if (tim2.get(Inner, Inner) != EmptyDim)
        if (inHoles(r2, a1))
          return false;
    }

    return true;
View Full Code Here

Examples of chunmap.model.relate.IntersectionMatrix

  protected int inner2innerDim(Geometry g1, Geometry g2) {
    Polygon a1 = (Polygon) g1;
    Polygon a2 = (Polygon) g2;
    ComputeIm r2r = new LinearRing_LinearRing(a1.getShell(), a2
        .getShell());
    IntersectionMatrix tim = r2r.getIM();
    if (tim.get(Inner, Inner) != EmptyDim) {
      if (!inHoles(a1.getShell(), a2) && !inHoles(a2.getShell(), a1))
        return AreaDim;
    }
    return EmptyDim;
  }
View Full Code Here

Examples of chunmap.model.relate.IntersectionMatrix

    Polygon a1 = (Polygon) g1;
    Polygon a2 = (Polygon) g2;
    ComputeIm r2r = new LinearRing_LinearRing(a1.getShell(), a2
        .getShell());
    IntersectionMatrix tim = r2r.getIM();

    if (tim.get(Inner, Outer) != EmptyDim)
      return false;

    for (Ring r2 : a2.getHoles()) {
      ComputeIm r2r2 = new LinearRing_LinearRing(a1.getShell(), r2);
      IntersectionMatrix tim2 = r2r2.getIM();
      if (tim2.get(Inner, Inner) != EmptyDim)
        if (inHoles(r2, a1))
          return false;
    }

    return true;
View Full Code Here

Examples of chunmap.model.relate.IntersectionMatrix

  public void testComputeIM() {
    GeoPoint p1 = new GeoPoint(1, 2);
    GeoPoint p2 = new GeoPoint(1, 0);

    ComputeIm r = new Point_Point(p1, p2);
    IntersectionMatrix rt = r.getIM();

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

Examples of chunmap.model.relate.IntersectionMatrix

  public void testComputeIM2() {
    GeoPoint p1 = new GeoPoint(1, 2);
    GeoPoint p2 = new GeoPoint(1, 2);

    ComputeIm r = new Point_Point(p1, p2);
    IntersectionMatrix rt = r.getIM();

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

Examples of chunmap.model.relate.IntersectionMatrix

  @Test
  public void testComputeIM3() {
    GeoPoint p1 = new GeoPoint(1, 2);
    GeoPoint p2 = new GeoPoint(1, 0);

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

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

Examples of com.vividsolutions.jts.geom.IntersectionMatrix

    jtsGeo = shiftPoly(jtsGeo, 180);
    assertEquals(161+20,jtsGeo.getBoundingBox().getWidth(), 0.001);
  }

  private void assertJtsConsistentRelate(Shape shape) {
    IntersectionMatrix expectedM = POLY_SHAPE.getGeom().relate(((JtsSpatialContext) ctx).getGeometryFrom(shape));
    SpatialRelation expectedSR = JtsGeometry.intersectionMatrixToSpatialRelation(expectedM);
    //JTS considers a point on a boundary INTERSECTS, not CONTAINS
    if (expectedSR == SpatialRelation.INTERSECTS && shape instanceof Point)
      expectedSR = SpatialRelation.CONTAINS;
    assertRelation(null, expectedSR, POLY_SHAPE, shape);
View Full Code Here

Examples of com.vividsolutions.jts.geom.IntersectionMatrix

    tickCrossLabel.setIcon(clearIcon);
  }

  public void runTests() {
    if (testCase.getGeometry(0) != null && testCase.getGeometry(1) != null) {
      IntersectionMatrix im = testCase.getIM();
      IntersectionMatrix imBA = new IntersectionMatrix(im);
      //IntersectionMatrix expectedIm = new IntersectionMatrix(expectedImTextField.getText());
      imBA.transpose();
      setRelateLabel(relateII, im.get(Location.INTERIOR, Location.INTERIOR));
      setRelateLabel(relateIB, im.get(Location.INTERIOR, Location.BOUNDARY));
      setRelateLabel(relateIE, im.get(Location.INTERIOR, Location.EXTERIOR));
      setRelateLabel(relateBI, im.get(Location.BOUNDARY, Location.INTERIOR));
      setRelateLabel(relateBB, im.get(Location.BOUNDARY, Location.BOUNDARY));
      setRelateLabel(relateBE, im.get(Location.BOUNDARY, Location.EXTERIOR));
      setRelateLabel(relateEI, im.get(Location.EXTERIOR, Location.INTERIOR));
      setRelateLabel(relateEB, im.get(Location.EXTERIOR, Location.BOUNDARY));
      setRelateLabel(relateEE, im.get(Location.EXTERIOR, Location.EXTERIOR));
      //tickCrossLabel.setIcon(im.matches(expectedIm.toString()) ? tickIcon : crossIcon);
      txtAB.setText(im.toString());
      txtBA.setText(imBA.toString());

      setPredicate(equalsAB, im.isEquals(testCase.getGeometry(0).getDimension(),
          testCase.getGeometry(1).getDimension()));
      setPredicate(disjointAB, im.isDisjoint());
      setPredicate(intersectsAB, im.isIntersects());
      setPredicate(touchesAB, im.isTouches(testCase.getGeometry(0).getDimension(),
          testCase.getGeometry(1).getDimension()));
      setPredicate(crossesAB, im.isCrosses(testCase.getGeometry(0).getDimension(),
          testCase.getGeometry(1).getDimension()));
      setPredicate(withinAB, im.isWithin());
      setPredicate(containsAB, im.isContains());
      setPredicate(overlapsAB, im.isOverlaps(testCase.getGeometry(0).getDimension(),
          testCase.getGeometry(1).getDimension()));
      setPredicate(coversAB, im.isCovers());
      setPredicate(coveredByAB, im.isCoveredBy());


      setPredicate(equalsBA, imBA.isEquals(testCase.getGeometry(1).getDimension(),
          testCase.getGeometry(0).getDimension()));
      setPredicate(disjointBA, imBA.isDisjoint());
      setPredicate(intersectsBA, imBA.isIntersects());
      setPredicate(touchesBA, imBA.isTouches(testCase.getGeometry(1).getDimension(),
          testCase.getGeometry(0).getDimension()));
      setPredicate(crossesBA, imBA.isCrosses(testCase.getGeometry(1).getDimension(),
          testCase.getGeometry(0).getDimension()));
      setPredicate(withinBA, imBA.isWithin());
      setPredicate(containsBA, imBA.isContains());
      setPredicate(overlapsBA, imBA.isOverlaps(testCase.getGeometry(1).getDimension(),
          testCase.getGeometry(0).getDimension()));
      setPredicate(coversBA, imBA.isCovers());
      setPredicate(coveredByBA, imBA.isCoveredBy());
    }
  }
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.