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

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

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

Geometry.isEmpty介绍

[英]IsEmpty returns TRUE when the Geometry object does not contain geometric information beyond its original initialization state.
[中]当几何体对象不包含超出其原始初始化状态的几何信息时,IsEmpty返回TRUE。

代码示例

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

public static int getPointCount(OGCGeometry ogcGeometry)
{
  GeometryCursor cursor = ogcGeometry.getEsriGeometryCursor();
  int points = 0;
  while (true) {
    com.esri.core.geometry.Geometry geometry = cursor.next();
    if (geometry == null) {
      return points;
    }
    if (geometry.isEmpty()) {
      continue;
    }
    if (geometry instanceof Point) {
      points++;
    }
    else {
      points += ((MultiVertexGeometry) geometry).getPointCount();
    }
  }
}

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

if (geometry.isEmpty()) {
  return new OGCPoint(new Point(), null);

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

public boolean isEmpty() {
  return getEsriGeometry().isEmpty();
}

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

public boolean isEmpty() {
  return getEsriGeometry().isEmpty();
}

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

private GeometryCursor removeOverlapsHelper_(List<Geometry> geoms) {
  List<Geometry> result = new ArrayList<Geometry>();
  for (int i = 0; i < geoms.size(); ++i) {
    Geometry current = geoms.get(i);
    if (current.isEmpty())
      continue;
    
    for (int j = i + 1; j < geoms.size(); ++j) {
      Geometry subG = geoms.get(j);
      current = OperatorDifference.local().execute(current, subG, esriSR, null);
      if (current.isEmpty())
        break;
    }
    
    if (current.isEmpty())
      continue;
    
    result.add(current);
  }
  
  return new SimpleGeometryCursor(result);
}

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

double calculate(/* const */Geometry geometryA, /* const */
  Geometry geometryB) {
    if (geometryA.isEmpty() || geometryB.isEmpty())
      return NumberUtils.TheNaN;
    geometryA.queryEnvelope2D(m_env2DgeometryA);
    geometryB.queryEnvelope2D(m_env2DgeometryB);
    return executeBruteForce_(geometryA, geometryB);
  }
}

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

double calculate(/* const */Geometry geometryA, /* const */
  Geometry geometryB) {
    if (geometryA.isEmpty() || geometryB.isEmpty())
      return NumberUtils.TheNaN;
    geometryA.queryEnvelope2D(m_env2DgeometryA);
    geometryB.queryEnvelope2D(m_env2DgeometryB);
    return executeBruteForce_(geometryA, geometryB);
  }
}

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

static boolean canUseRasterizedGeometry(Geometry geom) {
  if (geom.isEmpty()
      || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon)) {
    return false;
  }
  return true;
}

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

/**
 * Checks whether the RasterizedGeometry2D accelerator can be used with the
 * given geometry.
 */
static boolean canUseAccelerator(Geometry geom) {
  if (geom.isEmpty()
      || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon))
    return false;
  return true;
}

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

/**
 * Checks whether the RasterizedGeometry2D accelerator can be used with the
 * given geometry.
 */
static boolean canUseAccelerator(Geometry geom) {
  if (geom.isEmpty()
      || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon))
    return false;
  return true;
}

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

static boolean canUseRasterizedGeometry(Geometry geom) {
  if (geom.isEmpty()
      || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon)) {
    return false;
  }
  return true;
}

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

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));
  }
  if (geoms.size() == 1) {
    return geoms.get(0);
  } else if (geoms.size() == 0)
    return createFromEsriGeometry(emptyGeom, sr);
  else
    return new OGCConcreteGeometryCollection(geoms, sr);
}

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

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));
  }
  if (geoms.size() == 1) {
    return geoms.get(0);
  } else if (geoms.size() == 0)
    return createFromEsriGeometry(emptyGeom, sr);
  else
    return new OGCConcreteGeometryCollection(geoms, sr);
}

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

static boolean canUseQuadTree(Geometry geom) {
  if (geom.isEmpty()
      || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon)) {
    return false;
  }
  if (((MultiVertexGeometry) geom).getPointCount() < 20) {
    return false;
  }
  return true;
}

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

static boolean canUseQuadTreeForPaths(Geometry geom) {
  if (geom.isEmpty() || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon))
    return false;
  if (((MultiVertexGeometry) geom).getPointCount() < 20)
    return false;
  return true;
}

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

static boolean canUseQuadTree(Geometry geom) {
  if (geom.isEmpty()
      || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon)) {
    return false;
  }
  if (((MultiVertexGeometry) geom).getPointCount() < 20) {
    return false;
  }
  return true;
}

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

static boolean canUseQuadTreeForPaths(Geometry geom) {
  if (geom.isEmpty() || !(geom.getType() == Geometry.Type.Polyline || geom.getType() == Geometry.Type.Polygon))
    return false;
  if (((MultiVertexGeometry) geom).getPointCount() < 20)
    return false;
  return true;
}

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

/**
 * Adds a geometry to the current bounding geometry using an incremental algorithm for dynamic insertion.
 * @param geometry The geometry to add to the bounding geometry.
 */
void addGeometry(Geometry geometry) {
  if (geometry.isEmpty())
    return;
  
  int type = geometry.getType().value();
  if (MultiVertexGeometry.isMultiVertex(type))
    addMultiVertexGeometry_((MultiVertexGeometry) geometry);
  else if (MultiPath.isSegment(type))
    addSegment_((Segment) geometry);
  else if (type == Geometry.GeometryType.Envelope)
    addEnvelope_((Envelope) geometry);
  else if (type == Geometry.GeometryType.Point)
    addPoint_((Point) geometry);
  else
    throw new IllegalArgumentException("invalid shape type");
}

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

Geometry normalizeIntersectionOutput(Geometry geom, int GT_1, int GT_2) {
  if (GT_1 == Geometry.GeometryType.Point
      || GT_2 == Geometry.GeometryType.Point) {
    assert (geom.getType().value() == Geometry.GeometryType.Point);
  }
  if (GT_1 == Geometry.GeometryType.MultiPoint) {
    if (geom.getType().value() == Geometry.GeometryType.Point) {
      MultiPoint mp = new MultiPoint(geom.getDescription());
      if (!geom.isEmpty())
        mp.add((Point) geom);
      return mp;
    }
  }
  return geom;
}

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

Geometry normalizeIntersectionOutput(Geometry geom, int GT_1, int GT_2) {
  if (GT_1 == Geometry.GeometryType.Point
      || GT_2 == Geometry.GeometryType.Point) {
    assert (geom.getType().value() == Geometry.GeometryType.Point);
  }
  if (GT_1 == Geometry.GeometryType.MultiPoint) {
    if (geom.getType().value() == Geometry.GeometryType.Point) {
      MultiPoint mp = new MultiPoint(geom.getDescription());
      if (!geom.isEmpty())
        mp.add((Point) geom);
      return mp;
    }
  }
  return geom;
}

相关文章