Examples of geometryType()


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

  @Test
  public void testGeometryCollection() throws JSONException {
    OGCGeometry g = OGCGeometry
        .fromText("GEOMETRYCOLLECTION(POLYGON EMPTY, POINT(1 1), LINESTRING EMPTY, MULTIPOLYGON EMPTY, MULTILINESTRING EMPTY)");
    assertTrue(g.geometryType().equals("GeometryCollection"));
    OGCConcreteGeometryCollection gc = (OGCConcreteGeometryCollection) g;
    assertTrue(gc.numGeometries() == 5);
    assertTrue(gc.geometryN(0).geometryType().equals("Polygon"));
    assertTrue(gc.geometryN(1).geometryType().equals("Point"));
    assertTrue(gc.geometryN(2).geometryType().equals("LineString"));
View Full Code Here

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

    assertTrue(gc.geometryN(3).geometryType().equals("MultiPolygon"));
    assertTrue(gc.geometryN(4).geometryType().equals("MultiLineString"));

    g = OGCGeometry
        .fromText("GEOMETRYCOLLECTION(POLYGON EMPTY, POINT(1 1), GEOMETRYCOLLECTION EMPTY, LINESTRING EMPTY, GEOMETRYCOLLECTION(POLYGON EMPTY, POINT(1 1), LINESTRING EMPTY, MULTIPOLYGON EMPTY, MULTILINESTRING EMPTY, MULTIPOINT EMPTY), MULTIPOLYGON EMPTY, MULTILINESTRING EMPTY)");
    assertTrue(g.geometryType().equals("GeometryCollection"));
    gc = (OGCConcreteGeometryCollection) g;
    assertTrue(gc.numGeometries() == 7);
    assertTrue(gc.geometryN(0).geometryType().equals("Polygon"));
    assertTrue(gc.geometryN(1).geometryType().equals("Point"));
    assertTrue(gc.geometryN(2).geometryType().equals("GeometryCollection"));
View Full Code Here

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

    assertTrue(gc2.geometryN(5).geometryType().equals("MultiPoint"));

    ByteBuffer wkbBuffer = g.asBinary();
    g = OGCGeometry.fromBinary(wkbBuffer);

    assertTrue(g.geometryType().equals("GeometryCollection"));
    gc = (OGCConcreteGeometryCollection) g;
    assertTrue(gc.numGeometries() == 7);
    assertTrue(gc.geometryN(0).geometryType().equals("Polygon"));
    assertTrue(gc.geometryN(1).geometryType().equals("Point"));
    assertTrue(gc.geometryN(2).geometryType().equals("GeometryCollection"));
View Full Code Here

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

  @Test
  public void testFirstPointOfPolygon() {
    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))");
    assertTrue(g.geometryType().equals("Polygon"));
    OGCPolygon p = (OGCPolygon) g;
    assertTrue(p.numInteriorRing() == 1);
    OGCLineString ls = p.exteriorRing();
    OGCPoint p1 = ls.pointN(1);
    assertTrue(ls.pointN(1).equals(OGCGeometry.fromText("POINT(10 -10)")));
View Full Code Here

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

  @Test
  public void testFirstPointOfLineString() {
    OGCGeometry g = OGCGeometry
        .fromText("LINESTRING(-10 -10, 10 -10, 10 10, -10 10, -10 -10)");
    assertTrue(g.geometryType().equals("LineString"));
    OGCLineString p = (OGCLineString) g;
    assertTrue(p.numPoints() == 5);
    assertTrue(p.isClosed());
    assertTrue(p.pointN(1).equals(OGCGeometry.fromText("POINT(10 -10)")));
    String ms = g.convertToMulti().asText();
View Full Code Here

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

  @Test
  public void testPointInPolygon() {
    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))");
    assertTrue(g.geometryType().equals("Polygon"));
    assertTrue(!g.contains(OGCGeometry.fromText("POINT(0 0)")));
    assertTrue(g.contains(OGCGeometry.fromText("POINT(9 9)")));
    assertTrue(!g.contains(OGCGeometry.fromText("POINT(-20 1)")));
    assertTrue(g.disjoint(OGCGeometry.fromText("POINT(0 0)")));
    assertTrue(!g.disjoint(OGCGeometry.fromText("POINT(9 9)")));
View Full Code Here

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

  @Test
  public void testMultiPolygon() {
    {
      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)))");
      assertTrue(g.geometryType().equals("MultiPolygon")); // the type is
                                  // reduced
      assertTrue(!g.contains(OGCGeometry.fromText("POINT(0 0)")));
      assertTrue(g.contains(OGCGeometry.fromText("POINT(9 9)")));
      assertTrue(!g.contains(OGCGeometry.fromText("POINT(-20 1)")));
      assertTrue(g.disjoint(OGCGeometry.fromText("POINT(0 0)")));
View Full Code Here

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

    }
   
    {
      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
View Full Code Here

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

      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)")));
View Full Code Here

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

      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
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.