コード例 #1
0
 public void testAtomic() throws Exception {
   Polygon g = (Polygon) read("POLYGON ((1 9, 9 9, 9 1, 1 1, 1 9))");
   GeometryCollectionIterator i = new GeometryCollectionIterator(g);
   assertTrue(i.hasNext());
   assertTrue(i.next() instanceof Polygon);
   assertTrue(!i.hasNext());
 }
コード例 #2
0
 public void testGeometryCollection() throws Exception {
   GeometryCollection g =
       (GeometryCollection) read("GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (POINT (10 10)))");
   GeometryCollectionIterator i = new GeometryCollectionIterator(g);
   assertTrue(i.hasNext());
   assertTrue(i.next() instanceof GeometryCollection);
   assertTrue(i.hasNext());
   assertTrue(i.next() instanceof GeometryCollection);
   assertTrue(i.hasNext());
   assertTrue(i.next() instanceof Point);
   assertTrue(!i.hasNext());
 }