Package com.esri.core.geometry

Examples of com.esri.core.geometry.Point


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


      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
        LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
View Full Code Here

      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }

    Geometry esriGeom = ogcGeometry.getEsriGeometry();
    Point pn = null;
    int idx = index.get();
    idx = (idx == 0) ? 0 : idx-1// consistency with SDE ST_Geometry
    switch(esriGeom.getType()) {
    case Line:
    case Polyline:
View Full Code Here

        return new OGCMultiLineString((Polyline) geom, sr);
    }
    if (t == Geometry.Type.MultiPoint) {
      if (!multiType && ((MultiPoint) geom).getPointCount() <= 1) {
        if (geom.isEmpty())
          return new OGCPoint(new Point(), sr);
        else
          return new OGCPoint(((MultiPoint) geom).getPoint(0), sr);
      } else
        return new OGCMultiPoint((MultiPoint) geom, sr);
    }
View Full Code Here

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

    if (x == null || y == null) {
      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }
    try {
      Point stPt = new Point(x.get(), y.get());
      if (z != null)
        stPt.setZ(z.get());
      if (m != null)
        stPt.setM(m.get());
      return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(stPt, null));
    } catch (Exception e) {
        LogUtils.Log_InternalError(LOG, "ST_Point: " + e);
        return null;
    }
View Full Code Here

        return new OGCMultiLineString((Polyline) geom, sr);
    }
    if (t == Geometry.Type.MultiPoint) {
      if (!multiType && ((MultiPoint) geom).getPointCount() <= 1) {
        if (geom.isEmpty())
          return new OGCPoint(new Point(), sr);
        else
          return new OGCPoint(((MultiPoint) geom).getPoint(0), sr);
      } else
        return new OGCMultiPoint((MultiPoint) geom, sr);
    }
View Full Code Here

    final double latMid = (latMax + latMin) / 2// idea: latitude of half area (ctry or envp?)
    latExtent = latMax-latMin;
    lonMin = envelope.getXMin() - .005// -.005 to catch nearby outliers (approx. 500m)
    lonMax = envelope.getXMax() + .005// +.005 to catch nearby outliers
    final double lonOneDeg = lonMin + 1// arbitrary longitude for establishing lenOneDegBaseline
    Point fromPt = new Point(lonMin, latMid),
      toPt = new Point(lonOneDeg, latMid);
    // geodesicDistanceOnWGS84 is an approximation as we are using a different GCS, but expect it
    // to be a good approximation as we are using proportions only, not positions, with it.
    final double lenOneDegBaseline = GeometryEngine.geodesicDistanceOnWGS84(fromPt, toPt);
    // GeometryEngine.distance "Calculates the 2D planar distance between two geometries."
    //angle// final double lenOneDegBaseline = GeometryEngine.distance(fromPt, toPt, spatialReference);
    arcLon = gridSide / lenOneDegBaseline;  // longitude arc of grid cell
    final double latOneDeg = latMid + 1;
    toPt.setXY(lonMin, latOneDeg);
    final double htOneDeg = GeometryEngine.geodesicDistanceOnWGS84(fromPt, toPt);

    int enough = (int)(Math.ceil(.000001 + (lonMax-lonMin)*lenOneDegBaseline/gridSide)) *
      (int)(Math.ceil(.000001 + latExtent*htOneDeg/gridSide));
    grid = new ArrayList<double[]>(enough);
    double xlon, ylat;
    // If using quadtree, could filter out cells that do not overlap country polygon
    for (ylat = latMin, yCount = 0;  ylat < latMax;  yCount++) {
      fromPt.setXY(lonMin, ylat);
      toPt.setXY(lonMin+arcLon, ylat);
      double xlen = GeometryEngine.geodesicDistanceOnWGS84(fromPt, toPt);
      double height = cellArea/xlen;  // meters
      double arcLat = height / htOneDeg;
      for (xlon = lonMin, xCount = 0;  xlon < lonMax;  xlon += arcLon, xCount++) {
        double[] tmp = {xlon, ylat, xlon+arcLon, ylat+arcLat};
View Full Code Here

    //       assume clean data.  This is especially true with big data processing
    float latitude = Float.parseFloat(values[latitudeIndex]);
    float longitude = Float.parseFloat(values[longitudeIndex]);
   
    // Create our Point directly from longitude and latitude
    Point point = new Point(longitude, latitude);
   
    // Each map only processes one earthquake record at a time, so we start out with our count
    // as 1.  Aggregation will occur in the combine/reduce stages
    IntWritable one = new IntWritable(1);
   
View Full Code Here

        return new OGCMultiLineString((Polyline) geom, sr);
    }
    if (t == Geometry.Type.MultiPoint) {
      if (!multiType && ((MultiPoint) geom).getPointCount() <= 1) {
        if (geom.isEmpty())
          return new OGCPoint(new Point(), sr);
        else
          return new OGCPoint(((MultiPoint) geom).getPoint(0), sr);
      } else
        return new OGCMultiPoint((MultiPoint) geom, sr);
    }
View Full Code Here

TOP

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

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.