Examples of OGCMultiPolygon


Examples of com.esri.core.geometry.ogc.OGCMultiPolygon

    {
      OGCGeometry g = OGCGeometry
          .fromText("MULTIPOLYGON(((-10 -10, 10 -10, 10 10, -10 10, -10 -10), (-5 -5, -5 5, 5 5, 5 -5, -5 -5)), ((90 90, 110 90, 110 110, 90 110, 90 90), (95 95, 95 105, 105 105, 105 95, 95 95)))");
      assertTrue(g.geometryType().equals("MultiPolygon")); // the type is
     
      OGCMultiPolygon mp = (OGCMultiPolygon)g;
      assertTrue(mp.numGeometries() == 2);
      OGCGeometry p1 = mp.geometryN(0);
      assertTrue(p1.geometryType().equals("Polygon")); // the type is
      assertTrue(p1.contains(OGCGeometry.fromText("POINT(9 9)")));
      assertTrue(!p1.contains(OGCGeometry.fromText("POINT(109 109)")));
      OGCGeometry p2 = mp.geometryN(1);
      assertTrue(p2.geometryType().equals("Polygon")); // the type is
      assertTrue(!p2.contains(OGCGeometry.fromText("POINT(9 9)")));
      assertTrue(p2.contains(OGCGeometry.fromText("POINT(109 109)")));
    }
  }
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCMultiPolygon

        assertTrue(!res);
        assertTrue(!g.isSimpleRelaxed());
        OGCGeometry simpleG = g.makeSimple();
        assertTrue(simpleG.geometryType().equals("MultiPolygon"));
        assertTrue(simpleG.isSimple());
        OGCMultiPolygon mp = (OGCMultiPolygon)simpleG;
        assertTrue(mp.numGeometries() == 2);
        OGCPolygon g1 = (OGCPolygon)mp.geometryN(0);
        OGCPolygon g2 = (OGCPolygon)mp.geometryN(1);
        assertTrue((g1.numInteriorRing() == 0 && g1.numInteriorRing() == 2) ||
            (g1.numInteriorRing() == 2 && g2.numInteriorRing() == 0));
       
        OGCGeometry oldOutput = OGCGeometry.fromJson("{\"rings\":[[[-3,-3],[-3,4],[6,4],[6,-3],[-3,-3]],[[0,0],[2,0],[4,0],[4,2],[3,3],[2,2],[1,3],[0,2],[2,2],[0,0]],[[2,0],[2,2],[4,2],[2,0]]],\"spatialReference\":{\"wkid\":4326}}");
        assertTrue(oldOutput.isSimpleRelaxed());
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCMultiPolygon

    //MultiPolygon Area #36
    String wkt = "MULTIPOLYGON (((1001200 2432900, 1001420 2432691, 1001250 2432388, 1001498 2432325, 1001100 2432100, 1001500 2431900, 1002044 2431764, 1002059 2432120, 1002182 2432003, 1002400 2432300, 1002650 2432150, 1002610 2432323, 1002772 2432434, 1002410 2432821, 1002700 2433000, 1001824 2432866, 1001600 2433150, 1001200 2432900)), ((1000393 2433983, 1000914 2434018, 1000933 2433817, 1000568 2433834, 1000580 2433584, 1000700 2433750, 1000800 2433650, 1000700 2433450, 1000600 2433550, 1000200 2433350, 1000100 2433900, 1000393 2433983)), ((1001200 2432900, 1000878 2432891, 1000900 2433300, 1001659 2433509, 1001600 2433150, 1001200 2432900)), ((1002450 2431650, 1002300 2431650, 1002300 2431900, 1002500 2432100, 1002600 2431800, 1002450 2431800, 1002450 2431650)), ((999750 2433550, 999850 2433600, 999900 2433350, 999780 2433433, 999750 2433550)), ((1002950 2432050, 1003005 2431932, 1002850 2432250, 1002928 2432210, 1002950 2432050)), ((1002600 2431750, 1002642 2431882, 1002750 2431900, 1002750 2431750, 1002600 2431750)), ((1002950 2431750, 1003050 2431650, 1002968 2431609, 1002950 2431750)))";
    {
      OGCGeometry ogcg = OGCGeometry.fromText(wkt);
      assertTrue(ogcg.geometryType().equals("MultiPolygon"));
      OGCMultiPolygon mp = (OGCMultiPolygon)ogcg;
      double a = mp.area();
      assertTrue(Math.abs(mp.area() - 2037634.5) < a*1e-14);
    }

    {
      OGCGeometry ogcg = OGCGeometry.fromText(wkt);
      assertTrue(ogcg.geometryType().equals("MultiPolygon"));
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.