Examples of OGCPoint


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

    }

    @Test
    public void testOGCPoint() {
        Point p = new Point(10.0, 20.0);
        OGCGeometry ogcPoint = new OGCPoint(p, null);
        String result = ogcPoint.asGeoJson();
        assertEquals("{\"type\":\"Point\",\"coordinates\":[10.0,20.0]}", result);
    }
View Full Code Here

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

  @Test
  public void testPoint() {
    OGCGeometry g = OGCGeometry.fromText("POINT(1 2)");
    assertTrue(g.geometryType().equals("Point"));
    OGCPoint p = (OGCPoint) g;
    assertTrue(p.X() == 1);
    assertTrue(p.Y() == 2);
    assertTrue(g.equals(OGCGeometry.fromText("POINT(1 2)")));
    assertTrue(!g.equals(OGCGeometry.fromText("POINT(1 3)")));
    OGCGeometry buf = g.buffer(10);
    assertTrue(buf.geometryType().equals("Polygon"));
    OGCPolygon poly = (OGCPolygon) buf.envelope();
View Full Code Here

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

        .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)")));
    OGCPoint p2 = ls.pointN(3);
    assertTrue(ls.pointN(3).equals(OGCGeometry.fromText("POINT(-10 10)")));
    OGCPoint p0 = ls.pointN(0);
    assertTrue(ls.pointN(0).equals(OGCGeometry.fromText("POINT(-10 -10)")));
    String ms = g.convertToMulti().asText();
    assertTrue(ms.equals("MULTIPOLYGON (((-10 -10, 10 -10, 10 10, -10 10, -10 -10), (-5 -5, -5 5, 5 5, 5 -5, -5 -5)))"));

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