com.esri.core.geometry.Geometry.queryEnvelope()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中com.esri.core.geometry.Geometry.queryEnvelope()方法的一些代码示例,展示了Geometry.queryEnvelope()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.queryEnvelope()方法的具体详情如下:
包路径:com.esri.core.geometry.Geometry
类名称:Geometry
方法名:queryEnvelope

Geometry.queryEnvelope介绍

[英]Returns the axis aligned bounding box of the geometry.
[中]返回几何体的轴对齐边界框。

代码示例

代码示例来源:origin: prestodb/presto

public static Envelope getEnvelope(OGCGeometry ogcGeometry)
{
  GeometryCursor cursor = ogcGeometry.getEsriGeometryCursor();
  Envelope overallEnvelope = new Envelope();
  while (true) {
    Geometry geometry = cursor.next();
    if (geometry == null) {
      return overallEnvelope;
    }
    Envelope envelope = new Envelope();
    geometry.queryEnvelope(envelope);
    overallEnvelope.merge(envelope);
  }
}

代码示例来源:origin: prestodb/presto

private static Envelope getEnvelope(OGCGeometry ogcGeometry)
{
  com.esri.core.geometry.Envelope env = new com.esri.core.geometry.Envelope();
  ogcGeometry.getEsriGeometry().queryEnvelope(env);
  return new Envelope(env.getXMin(), env.getXMax(), env.getYMin(), env.getYMax());
}

代码示例来源:origin: prestodb/presto

private static Envelope getEnvelope(OGCGeometry ogcGeometry, double radius)
{
  com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope();
  ogcGeometry.getEsriGeometry().queryEnvelope(envelope);
  return new Envelope(envelope.getXMin() - radius, envelope.getXMax() + radius, envelope.getYMin() - radius, envelope.getYMax() + radius);
}

代码示例来源:origin: apache/drill

public void eval() {
  com.esri.core.geometry.ogc.OGCGeometry geom1;
  geom1 = com.esri.core.geometry.ogc.OGCGeometry
    .fromBinary(geom1Param.buffer.nioBuffer(geom1Param.start, geom1Param.end - geom1Param.start));

  if (geom1.geometryType().equals("Point")) {
   out.value = ((com.esri.core.geometry.ogc.OGCPoint) geom1).Y();
  } else {
   com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope();
   geom1.getEsriGeometry().queryEnvelope(envelope);
   out.value = envelope.getYMin();
  }
 }
}

代码示例来源:origin: apache/drill

public void eval() {
  com.esri.core.geometry.ogc.OGCGeometry geom1;
  geom1 = com.esri.core.geometry.ogc.OGCGeometry
    .fromBinary(geom1Param.buffer.nioBuffer(geom1Param.start, geom1Param.end - geom1Param.start));

  if (geom1.geometryType().equals("Point")) {
   out.value = ((com.esri.core.geometry.ogc.OGCPoint) geom1).Y();
  } else {
   com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope();
   geom1.getEsriGeometry().queryEnvelope(envelope);
   out.value = envelope.getYMax();
  }
 }
}

代码示例来源:origin: apache/drill

public void eval() {
  com.esri.core.geometry.ogc.OGCGeometry geom1;
  geom1 = com.esri.core.geometry.ogc.OGCGeometry
    .fromBinary(geom1Param.buffer.nioBuffer(geom1Param.start, geom1Param.end - geom1Param.start));

  if (geom1.geometryType().equals("Point")) {
   out.value = ((com.esri.core.geometry.ogc.OGCPoint) geom1).X();
  } else {
   com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope();
   geom1.getEsriGeometry().queryEnvelope(envelope);
   out.value = envelope.getXMax();
  }
 }
}

代码示例来源:origin: apache/drill

public void eval() {
  com.esri.core.geometry.ogc.OGCGeometry geom1;
  geom1 = com.esri.core.geometry.ogc.OGCGeometry
    .fromBinary(geom1Param.buffer.nioBuffer(geom1Param.start, geom1Param.end - geom1Param.start));

  if (geom1.geometryType().equals("Point")) {
   out.value = ((com.esri.core.geometry.ogc.OGCPoint) geom1).X();
  } else {
   com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope();
   geom1.getEsriGeometry().queryEnvelope(envelope);
   out.value = envelope.getXMin();
  }
 }
}

代码示例来源:origin: prestodb/presto

private String getSpatialPartitioning(Rectangle extent, List<OGCGeometry> geometries, int partitionCount)
  {
    ImmutableList.Builder<Rectangle> rectangles = ImmutableList.builder();
    for (OGCGeometry geometry : geometries) {
      Envelope envelope = new Envelope();
      geometry.getEsriGeometry().queryEnvelope(envelope);
      rectangles.add(new Rectangle(envelope.getXMin(), envelope.getYMin(), envelope.getXMax(), envelope.getYMax()));
    }

    return KdbTreeUtils.toJson(buildKdbTree(roundToInt(geometries.size() * 1.0 / partitionCount, CEILING), extent, rectangles.build()));
  }
}

代码示例来源:origin: Qihoo360/Quicksql

private static Envelope envelope(Geometry g) {
 final Envelope env = new Envelope();
 g.queryEnvelope(env);
 return env;
}

代码示例来源:origin: org.apache.calcite/calcite-core

private static Envelope envelope(Geometry g) {
 final Envelope env = new Envelope();
 g.queryEnvelope(env);
 return env;
}

代码示例来源:origin: apache/asterixdb

@Override
protected Object evaluateOGCGeometry(OGCGeometry geometry) throws HyracksDataException {
  Geometry esriGeom = geometry.getEsriGeometry();
  if (esriGeom != null) {
    Envelope env = new Envelope();
    esriGeom.queryEnvelope(env);
    return env.getYMin();
  } else {
    throw new UnsupportedOperationException(
        "The operation " + getIdentifier() + " is not supported for the type " + geometry.geometryType());
  }
}

代码示例来源:origin: apache/asterixdb

@Override
protected Object evaluateOGCGeometry(OGCGeometry geometry) throws HyracksDataException {
  Geometry esriGeom = geometry.getEsriGeometry();
  if (esriGeom != null) {
    Envelope env = new Envelope();
    esriGeom.queryEnvelope(env);
    return env.getYMax();
  } else {
    throw new UnsupportedOperationException(
        "The operation " + getIdentifier() + " is not supported for the type " + geometry.geometryType());
  }
}

代码示例来源:origin: apache/asterixdb

@Override
protected Object evaluateOGCGeometry(OGCGeometry geometry) throws HyracksDataException {
  Geometry esriGeom = geometry.getEsriGeometry();
  if (esriGeom != null) {
    Envelope env = new Envelope();
    esriGeom.queryEnvelope(env);
    return env.getXMax();
  } else {
    throw new UnsupportedOperationException(
        "The operation " + getIdentifier() + " is not supported for the type " + geometry.geometryType());
  }
}

代码示例来源:origin: Esri/geometry-api-java

public OGCGeometry envelope() {
  com.esri.core.geometry.Envelope env = new com.esri.core.geometry.Envelope();
  getEsriGeometry().queryEnvelope(env);
  com.esri.core.geometry.Polygon polygon = new com.esri.core.geometry.Polygon();
  polygon.addEnvelope(env, false);
  return new OGCPolygon(polygon, esriSR);
}

代码示例来源:origin: com.esri.geometry/esri-geometry-api

public OGCGeometry envelope() {
  com.esri.core.geometry.Envelope env = new com.esri.core.geometry.Envelope();
  getEsriGeometry().queryEnvelope(env);
  com.esri.core.geometry.Polygon polygon = new com.esri.core.geometry.Polygon();
  polygon.addEnvelope(env, false);
  return new OGCPolygon(polygon, esriSR);
}

代码示例来源:origin: prestosql/presto

private static Envelope getEnvelope(OGCGeometry ogcGeometry, double radius)
{
  com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope();
  ogcGeometry.getEsriGeometry().queryEnvelope(envelope);
  return new Envelope(envelope.getXMin() - radius, envelope.getXMax() + radius, envelope.getYMin() - radius, envelope.getYMax() + radius);
}

代码示例来源:origin: io.prestosql/presto-main

private static Envelope getEnvelope(OGCGeometry ogcGeometry)
{
  com.esri.core.geometry.Envelope env = new com.esri.core.geometry.Envelope();
  ogcGeometry.getEsriGeometry().queryEnvelope(env);
  return new Envelope(env.getXMin(), env.getXMax(), env.getYMin(), env.getYMax());
}

代码示例来源:origin: io.prestosql/presto-main

private static Envelope getEnvelope(OGCGeometry ogcGeometry, double radius)
{
  com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope();
  ogcGeometry.getEsriGeometry().queryEnvelope(envelope);
  return new Envelope(envelope.getXMin() - radius, envelope.getXMax() + radius, envelope.getYMin() - radius, envelope.getYMax() + radius);
}

代码示例来源:origin: prestosql/presto

private String getSpatialPartitioning(Rectangle extent, List<OGCGeometry> geometries, int partitionCount)
  {
    ImmutableList.Builder<Rectangle> rectangles = ImmutableList.builder();
    for (OGCGeometry geometry : geometries) {
      Envelope envelope = new Envelope();
      geometry.getEsriGeometry().queryEnvelope(envelope);
      rectangles.add(new Rectangle(envelope.getXMin(), envelope.getYMin(), envelope.getXMax(), envelope.getYMax()));
    }

    return KdbTreeUtils.toJson(buildKdbTree(roundToInt(geometries.size() * 1.0 / partitionCount, CEILING), extent, rectangles.build()));
  }
}

代码示例来源:origin: com.esri.geometry/esri-geometry-api

@Override
public OGCGeometry envelope() {
  GeometryCursor gc = getEsriGeometryCursor();
  Envelope env = new Envelope();
  for (Geometry g = gc.next(); g != null; g = gc.next()) {
    Envelope e = new Envelope();
    g.queryEnvelope(e);
    env.merge(e);
  }
  Polygon polygon = new Polygon();
  polygon.addEnvelope(env, false);
  return new OGCPolygon(polygon, esriSR);
}

相关文章