Package com.esri.core.geometry

Examples of com.esri.core.geometry.Geometry


        if (token == JsonToken.START_OBJECT) {
          if (parser.getCurrentName() == "geometry") {
            if (geometryColumn > -1) {
              // create geometry and insert into geometry field
              Geometry geometry =  GeometryEngine.jsonToGeometry(parser).getGeometry();
              row.set(geometryColumn, GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(geometry, null)));
            } else {
              // no geometry in select field set, don't even bother parsing
              parser.skipChildren();
            }
View Full Code Here


          if (geomResult.length != 1){
            return null;
          }
         
          Geometry merged = geomResult[0];
         
      // we have to infer the type of the differenced geometry because we don't know
      // if it's going to end up as a single or multi-part geometry
      OGCType inferredType = GeometryUtils.getInferredOGCType(merged);
     
View Full Code Here

    if (ogcGeometry == null){
      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }

    Geometry esriGeom = ogcGeometry.getEsriGeometry();
    int wkid = GeometryUtils.getWKID(geomref);
    return new Text(GeometryEngine.geometryToJson(wkid, esriGeom));
  }
View Full Code Here

    if (ogcGeometry == null){
      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }

    Geometry esriGeom = ogcGeometry.getEsriGeometry();
    switch(esriGeom.getType()) {
    case Point:
    case MultiPoint:
      resultDouble.set(0.);
      break;
    default:
View Full Code Here

  public BytesWritable evaluate(Text wkwrap, int wkid) throws UDFArgumentException {

    String wkt = wkwrap.toString();

    try {
      Geometry geomObj = GeometryEngine.geometryFromWkt(wkt,
                                0,
                                Geometry.Type.Unknown);
      SpatialReference spatialReference = null// Idea: OGCGeometry.setSpatialReference after .fromText
      if (wkid != GeometryUtils.WKID_UNKNOWN) {
        spatialReference = SpatialReference.create(wkid);
View Full Code Here

    if (ogcGeom1 == null || ogcGeom2 == null){
      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }

    Geometry geometry1 = ogcGeom1.getEsriGeometry();
    Geometry geometry2 = ogcGeom2.getEsriGeometry();
    Envelope env1 = new Envelope(), env2 = new Envelope();
    geometry1.queryEnvelope(env1);
    geometry2.queryEnvelope(env2);

    resultBoolean.set(env1.isIntersecting(env2));
    return resultBoolean;
  }
View Full Code Here

    if (ogcGeometry == null){
      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:
      MultiPath lines = (MultiPath)(esriGeom);
      try {
        pn = lines.getPoint(idx);
View Full Code Here

     
      geomsToUnion[i] = ogcGeometry.getEsriGeometry();
    }
   
    try {
      Geometry unioned = GeometryEngine.union(geomsToUnion, spatialRef);

      // we have to infer the type of the differenced geometry because we don't know
      // if it's going to end up as a single or multi-part geometry
      OGCType inferredType = GeometryUtils.getInferredOGCType(unioned);
     
View Full Code Here

      }
    }

    ArrayList<Geometry> result = new ArrayList<Geometry>(3);
    if (dstMultiPoint != null) {
      Geometry resMP = OperatorSimplifyOGC.local().execute(dstMultiPoint,
          esriSR, true, null);
      result.add(resMP);
    }

    if (dstPolylines.size() > 0) {
      if (dstPolylines.size() == 1) {
        Geometry resMP = OperatorSimplifyOGC.local().execute(
            dstPolylines.get(0), esriSR, true, null);
        result.add(resMP);
      } else {
        GeometryCursor res = OperatorUnion.local().execute(
            new SimpleGeometryCursor(dstPolylines), esriSR, null);
        Geometry resPolyline = res.next();
        Geometry resMP = OperatorSimplifyOGC.local().execute(
            resPolyline, esriSR, true, null);
        result.add(resMP);
      }
    }

    if (dstPolygons.size() > 0) {
      if (dstPolygons.size() == 1) {
        Geometry resMP = OperatorSimplifyOGC.local().execute(
            dstPolygons.get(0), esriSR, true, null);
        result.add(resMP);
      } else {
        GeometryCursor res = OperatorUnion.local().execute(
            new SimpleGeometryCursor(dstPolygons), esriSR, null);
        Geometry resPolygon = res.next();
        Geometry resMP = OperatorSimplifyOGC.local().execute(
            resPolygon, esriSR, true, null);
        result.add(resMP);
      }
    }
View Full Code Here

  }

  public static OGCGeometry createFromEsriCursor(GeometryCursor gc,
      SpatialReference sr, boolean skipEmpty) {
    ArrayList<OGCGeometry> geoms = new ArrayList<OGCGeometry>(10);
    Geometry emptyGeom = null;
    for (Geometry g = gc.next(); g != null; g = gc.next()) {
      emptyGeom = g;
      if (!skipEmpty || !g.isEmpty())
        geoms.add(createFromEsriGeometry(g, sr));
    }
View Full Code Here

TOP

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

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.