Package com.esri.core.geometry.ogc

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()


    OGCGeometry g = OGCGeometry
        .fromText("POLYGON((-10 -10, 10 -10, 10 10, -10 10, -10 -10), (-5 -5, -5 5, 5 5, 5 -5, -5 -5))");
    OGCGeometry g2 = OGCGeometry
        .fromText("POLYGON((90 90, 110 90, 110 110, 90 110, 90 90))");
    OGCGeometry u = g.union(g2);
    assertTrue(u.geometryType().equals("MultiPolygon"));
    assertTrue(!u.contains(OGCGeometry.fromText("POINT(0 0)")));
    assertTrue(u.contains(OGCGeometry.fromText("POINT(9 9)")));
    assertTrue(!u.contains(OGCGeometry.fromText("POINT(-20 1)")));
    assertTrue(u.disjoint(OGCGeometry.fromText("POINT(0 0)")));
    assertTrue(!u.disjoint(OGCGeometry.fromText("POINT(9 9)")));
View Full Code Here


        assertTrue(res);
        assertTrue(g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        String res_str = og.asText();
        assertTrue(og.geometryType().equals("Polygon"));
        assertTrue(((OGCPolygon)og).numInteriorRing() == 0);
        assertTrue(og.isSimple());
      }

      {// exterior ring is self-tangent
View Full Code Here

        assertTrue(g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        res = og.isSimple();
        assertTrue(res);
        assertTrue(og.geometryType().equals("MultiPolygon"));
        assertTrue(((OGCGeometryCollection)og).numGeometries() == 2);
      }

      {// ring orientation (hole is cw)
        String s = "{\"rings\":[[[-100, -100], [-100, 100], [100, 100], [100, -100], [-100, -100]], [[0, 0], [5, 5], [10, 0], [0, 0]]]}";
View Full Code Here

        assertTrue(!g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        res = og.isSimple();
        assertTrue(res);
        assertTrue(og.geometryType().equals("Polygon"));
        assertTrue(((OGCPolygon)og).numInteriorRing() == 1);
      }

      {// ring order
        String s = "{\"rings\":[[[0, 0], [10, 0], [5, 5], [0, 0]], [[-100, -100], [-100, 100], [100, 100], [100, -100], [-100, -100]]]}";
View Full Code Here

        assertTrue(g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        res = og.isSimple();
        assertTrue(res);
        assertTrue(og.geometryType().equals("Polygon"));
      }

      {
        // hole is self tangent
        String s = "{\"rings\":[[[-100, -100], [-100, 100], [100, 100], [100, -100], [-100, -100]], [[0, 0], [5, 5], [10, 0], [10, 10], [5, 5], [0, 10], [0, 0]]]}";
View Full Code Here

        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        String res_str = og.asText();
        res = og.isSimple();
        assertTrue(res);
        assertTrue(og.geometryType().equals("Polygon"));
        assertTrue(((OGCPolygon)og).numInteriorRing() == 2);
      }
      {
        // two holes touch
        String s = "{\"rings\":[[[-100, -100], [-100, 100], [100, 100], [100, -100], [-100, -100]], [[0, 0], [10, 0], [5, 5], [0, 0]], [[10, 10], [0, 10], [5, 5], [10, 10]]]}";
View Full Code Here

        boolean res = g.isSimple();
        assertTrue(res);
        assertTrue(g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        assertTrue(og.geometryType().equals("Polygon"));
        assertTrue(((OGCPolygon)og).numInteriorRing() == 2);
      }
      {
        // two holes touch, bad orientation
        String s = "{\"rings\":[[[-100, -100], [-100, 100], [100, 100], [100, -100], [-100, -100]], [[0, 0], [5, 5], [10, 0], [0, 0]], [[10, 10], [0, 10], [5, 5], [10, 10]]]}";
View Full Code Here

        boolean res = g.isSimple();
        assertTrue(!res);
        assertTrue(!g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        assertTrue(og.geometryType().equals("Polygon"));
        assertTrue(((OGCPolygon)og).numInteriorRing() == 2);
      }

      {
        // hole touches exterior in two spots
View Full Code Here

        boolean res = g.isSimple();
        assertTrue(!res);
        assertTrue(g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        assertTrue(og.geometryType().equals("MultiPolygon"));
        assertTrue(((OGCMultiPolygon)og).numGeometries() == 2);
        assertTrue(((OGCPolygon)((OGCMultiPolygon)og).geometryN(0)).numInteriorRing() == 0);
        assertTrue(((OGCPolygon)((OGCMultiPolygon)og).geometryN(1)).numInteriorRing() == 0);
      }
View Full Code Here

        boolean res = g.isSimple();
        assertTrue(res);
        assertTrue(g.isSimpleRelaxed());
        Geometry resg = OperatorSimplifyOGC.local().execute(g.getEsriGeometry(), null, true, null);
        OGCGeometry og = OGCGeometry.createFromEsriGeometry(resg, null);
        assertTrue(og.geometryType().equals("Polygon"));
        assertTrue(((OGCPolygon)og).numInteriorRing() == 1);
      }

      {
        // exterior has inversion (non simple for OGC)
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.