Package com.esri.core.geometry

Examples of com.esri.core.geometry.MultiPath


    case Point:
    case MultiPoint:
      resultDouble.set(0.);
      break;
    default:
      MultiPath lines = (MultiPath)(esriGeom);
      int nPath = lines.getPathCount();
      double length = 0.;
      for (int ix = 0; ix < nPath; ix++) {
        int curPt = lines.getPathStart(ix);
        int pastPt = lines.getPathEnd(ix);
        Point fromPt = lines.getPoint(curPt);
        Point toPt = null;
        for (int vx = curPt+1; vx < pastPt; vx++) {
          toPt = lines.getPoint(vx);
          length += GeometryEngine.geodesicDistanceOnWGS84(fromPt, toPt);
          fromPt = toPt;
        }
      }
      resultDouble.set(length);
View Full Code Here


    try {

      switch(GeometryUtils.getType(geomref)) {
      case ST_LINESTRING:
      case ST_MULTILINESTRING:
        MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
        int nPaths = lines.getPathCount();
        boolean rslt = true;
        for (int ix = 0; rslt && ix < nPaths; ix++) {
          Point p0 = lines.getPoint(lines.getPathStart(ix));
          Point pf = lines.getPoint(lines.getPathEnd(ix)-1);
          rslt = rslt && pf.equals(p0)// no tolerance - OGC
        }
        resultBoolean.set(rslt);
        return resultBoolean;
      default// ST_IsClosed gives ERROR on Point or Polygon, on Postgres/Oracle
View Full Code Here

    int idx = index.get();
    idx = (idx == 0) ? 0 : idx-1// consistency with SDE ST_Geometry
    switch(esriGeom.getType()) {
    case Line:
    case Polyline:
      MultiPath lines = (MultiPath)(esriGeom);
      try {
        pn = lines.getPoint(idx);
      } catch (Exception e) {
        LogUtils.Log_InvalidIndex(LOG, idx+1, 1, lines.getPointCount());
        return null;
      }
      break;
    case MultiPoint:
      MultiPoint mp = (MultiPoint)(esriGeom);
View Full Code Here

    case Point:
    case MultiPoint:
      resultDouble.set(0.);
      break;
    default:
      MultiPath lines = (MultiPath)(esriGeom);
      int nPath = lines.getPathCount();
      double length = 0.;
      for (int ix = 0; ix < nPath; ix++) {
        int curPt = lines.getPathStart(ix);
        int pastPt = lines.getPathEnd(ix);
        Point fromPt = lines.getPoint(curPt);
        Point toPt = null;
        for (int vx = curPt+1; vx < pastPt; vx++) {
          toPt = lines.getPoint(vx);
          length += GeometryEngine.geodesicDistanceOnWGS84(fromPt, toPt);
          fromPt = toPt;
        }
      }
      resultDouble.set(length);
View Full Code Here

import com.esri.core.geometry.MultiPath;

public abstract class OGCMultiCurve extends OGCGeometryCollection {
  public int numGeometries() {
    MultiPath mp = (MultiPath) getEsriGeometry();
    return mp.getPathCount();
  }
View Full Code Here

    MultiPath mp = (MultiPath) getEsriGeometry();
    return mp.getPathCount();
  }

  public boolean isClosed() {
    MultiPath mp = (MultiPath) getEsriGeometry();
    for (int i = 0, n = mp.getPathCount(); i < n; i++) {
      if (!mp.isClosedPathInXYPlane(i))
        return false;
    }

    return true;
  }
View Full Code Here

    try {

      switch(GeometryUtils.getType(geomref)) {
      case ST_LINESTRING:
      case ST_MULTILINESTRING:
        MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
        int nPaths = lines.getPathCount();
        boolean rslt = true;
        for (int ix = 0; rslt && ix < nPaths; ix++) {
          Point p0 = lines.getPoint(lines.getPathStart(ix));
          Point pf = lines.getPoint(lines.getPathEnd(ix)-1);
          rslt = rslt && pf.equals(p0)// no tolerance - OGC
        }
        resultBoolean.set(rslt);
        return resultBoolean;
      default// ST_IsClosed gives ERROR on Point or Polygon, on Postgres/Oracle
View Full Code Here

      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }

    if (GeometryUtils.getType(geomref) == GeometryUtils.OGCType.ST_LINESTRING) {
      MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
      int wkid = GeometryUtils.getWKID(geomref);
      SpatialReference spatialReference = null;
      if (wkid != GeometryUtils.WKID_UNKNOWN) {
        spatialReference = SpatialReference.create(wkid);
      }
      return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(0),
                                                   spatialReference));
    } else {
      LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
      return null;
    }
View Full Code Here

    int idx = index.get();
    idx = (idx == 0) ? 0 : idx-1// consistency with SDE ST_Geometry
    switch(esriGeom.getType()) {
    case Line:
    case Polyline:
      MultiPath lines = (MultiPath)(esriGeom);
      try {
        pn = lines.getPoint(idx);
      } catch (Exception e) {
        LogUtils.Log_InvalidIndex(LOG, idx+1, 1, lines.getPointCount());
        return null;
      }
      break;
    case MultiPoint:
      MultiPoint mp = (MultiPoint)(esriGeom);
View Full Code Here

      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }

    if (GeometryUtils.getType(geomref) == GeometryUtils.OGCType.ST_LINESTRING) {
      MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
      int wkid = GeometryUtils.getWKID(geomref);
      SpatialReference spatialReference = null;
      if (wkid != GeometryUtils.WKID_UNKNOWN) {
        spatialReference = SpatialReference.create(wkid);
      }
      return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(lines.getPointCount()-1),
                                                   spatialReference));
    } else {
      LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
      return null;
    }
View Full Code Here

TOP

Related Classes of com.esri.core.geometry.MultiPath

Copyright © 2018 www.massapicom. 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.