Examples of OGCLineString


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

          LogUtils.Log_InternalError(LOG, "ST_ExteriorRing: " + x);
          return null;
        }
      }
      try {
        OGCLineString extRing = (OGCLineString)(extMethod.invoke(ogcGeometry));
        return GeometryUtils.geometryToEsriShapeBytesWritable(extRing);
      } catch (Exception e) {
        LogUtils.Log_InternalError(LOG, "ST_ExteriorRing: " + e);
        return null;
      }
View Full Code Here

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

    }

    int idx = index.get() - 1// 1-based UI, 0-based engine
    if (GeometryUtils.getType(geomref) == GeometryUtils.OGCType.ST_POLYGON) {
      try {
        OGCLineString hole = ((OGCPolygon)(ogcGeometry)).interiorRingN(idx);
        return GeometryUtils.geometryToEsriShapeBytesWritable(hole);
      } catch (Exception e) {
        LogUtils.Log_InternalError(LOG, "ST_InteriorRingN: " + e);
        return null;
      }
View Full Code Here

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

    try {

      switch(GeometryUtils.getType(geomref)) {
      case ST_LINESTRING:
        OGCLineString lns = (OGCLineString)ogcGeometry;
        resultBoolean.set(lns.isClosed() && lns.isSimple());
        return resultBoolean;
      default// ST_IsRing gives ERROR on Point, Polygon, or MultiLineString - on Postgres
        LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
        return null;
      }
View Full Code Here

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

          LogUtils.Log_InternalError(LOG, "ST_ExteriorRing: " + x);
          return null;
        }
      }
      try {
        OGCLineString extRing = (OGCLineString)(extMethod.invoke(ogcGeometry));
        return GeometryUtils.geometryToEsriShapeBytesWritable(extRing);
      } catch (Exception e) {
        LogUtils.Log_InternalError(LOG, "ST_ExteriorRing: " + e);
        return null;
      }
View Full Code Here

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

    }

    int idx = index.get() - 1// 1-based UI, 0-based engine
    if (GeometryUtils.getType(geomref) == GeometryUtils.OGCType.ST_POLYGON) {
      try {
        OGCLineString hole = ((OGCPolygon)(ogcGeometry)).interiorRingN(idx);
        return GeometryUtils.geometryToEsriShapeBytesWritable(hole);
      } catch (Exception e) {
        LogUtils.Log_InternalError(LOG, "ST_InteriorRingN: " + e);
        return null;
      }
View Full Code Here

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

    try {

      switch(GeometryUtils.getType(geomref)) {
      case ST_LINESTRING:
        OGCLineString lns = (OGCLineString)ogcGeometry;
        resultBoolean.set(lns.isClosed() && lns.isSimple());
        return resultBoolean;
      default// ST_IsRing gives ERROR on Point, Polygon, or MultiLineString - on Postgres
        LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
        return null;
      }
View Full Code Here

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

        Polyline p = new Polyline();
        p.startPath(100.0, 0.0);
        p.lineTo(101.0, 0.0);
        p.lineTo(101.0, 1.0);
        p.lineTo(100.0, 1.0);
        OGCLineString ogcLineString = new OGCLineString(p, 0, null);
        String result = ogcLineString.asGeoJson();
        assertEquals("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0]]}", result);
    }
View Full Code Here

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

    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();
    // assertTrue(ls.pointN(1).equals(OGCGeometry.fromText("POINT(10 -10)")));
    boolean b = ls
        .equals(OGCGeometry
            .fromText("LINESTRING(-10 -10, 10 -10, 10 10, -10 10, -10 -10)"));
    assertTrue(b);
    OGCLineString lsi = p.interiorRingN(0);
    b = lsi.equals(OGCGeometry
        .fromText("LINESTRING(-5 -5, -5 5, 5 5, 5 -5, -5 -5)"));
    assertTrue(b);
    assertTrue(!lsi.equals(ls));
    OGCMultiCurve boundary = p.boundary();
    String s = boundary.asText();
    assertTrue(s.equals("MULTILINESTRING ((-10 -10, 10 -10, 10 10, -10 10, -10 -10), (-5 -5, -5 5, 5 5, 5 -5, -5 -5))"));
  }
View Full Code Here

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

    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)")));
    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

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

  @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();
    assertTrue(ms.equals("MULTILINESTRING ((-10 -10, 10 -10, 10 10, -10 10, -10 -10))"));
  }
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.