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

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

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

Geometry.queryEnvelope2D介绍

[英]Returns tight bbox of the Geometry in X, Y plane.
[中]返回X,Y平面中几何体的紧bbox。

代码示例

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

/**
 * Returns the conservative bbox of the Geometry in X, Y plane. This is a
 * faster method than QueryEnvelope2D. However, the bbox could be larger
 * than the tight box.
 * @param env
 *            The envelope to return the result in.
 */
public void queryLooseEnvelope2D(Envelope2D env) {
  queryEnvelope2D(env);
}

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

/**
 * Returns the conservative bbox of the Geometry in X, Y plane. This is a
 * faster method than QueryEnvelope2D. However, the bbox could be larger
 * than the tight box.
 * @param env
 *            The envelope to return the result in.
 */
public void queryLooseEnvelope2D(Envelope2D env) {
  queryEnvelope2D(env);
}

代码示例来源: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: Esri/geometry-api-java

static double calculateToleranceFromGeometry(SpatialReference sr,
    Geometry geometry, boolean bConservative) {
  Envelope2D env2D = new Envelope2D();
  geometry.queryEnvelope2D(env2D);
  return calculateToleranceFromGeometry(sr, env2D, bConservative);
}

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

static double calculateToleranceFromGeometry(SpatialReference sr,
    Geometry geometry, boolean bConservative) {
  Envelope2D env2D = new Envelope2D();
  geometry.queryEnvelope2D(env2D);
  return calculateToleranceFromGeometry(sr, env2D, bConservative);
}

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

private boolean isDegenerateGeometry_(Geometry geom) {
  Envelope2D env = new Envelope2D();
  geom.queryEnvelope2D(env);
  if (Math.max(env.getWidth(), env.getHeight()) < m_densify_dist * 0.5)
    return true;
  return false;
}

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

private boolean isDegenerateGeometry_(Geometry geom) {
  Envelope2D env = new Envelope2D();
  geom.queryEnvelope2D(env);
  if (Math.max(env.getWidth(), env.getHeight()) < m_densify_dist * 0.5)
    return true;
  return false;
}

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

/**
 * If the given object is an ESRI geometry and its envelope is non-empty, returns
 * that envelope as an Apache SIS implementation. Otherwise returns {@code null}.
 *
 * @param  geometry  the geometry from which to get the envelope, or {@code null}.
 * @return the envelope of the given object, or {@code null} if the object is not
 *         a recognized geometry or its envelope is empty.
 */
@Override
final GeneralEnvelope tryGetEnvelope(final Object geometry) {
  if (geometry instanceof Geometry) {
    final Envelope2D bounds = new Envelope2D();
    ((Geometry) geometry).queryEnvelope2D(bounds);
    if (!bounds.isEmpty()) {                                     // Test if there is NaN values.
      final GeneralEnvelope env = new GeneralEnvelope(2);
      env.setRange(0, bounds.xmin, bounds.xmax);
      env.setRange(1, bounds.ymin, bounds.ymax);
      return env;
    }
  }
  return null;
}

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

/**
 * If the given object is an ESRI geometry and its envelope is non-empty, returns
 * that envelope as an Apache SIS implementation. Otherwise returns {@code null}.
 *
 * @param  geometry  the geometry from which to get the envelope, or {@code null}.
 * @return the envelope of the given object, or {@code null} if the object is not
 *         a recognized geometry or its envelope is empty.
 */
@Override
final GeneralEnvelope tryGetEnvelope(final Object geometry) {
  if (geometry instanceof Geometry) {
    final Envelope2D bounds = new Envelope2D();
    ((Geometry) geometry).queryEnvelope2D(bounds);
    if (!bounds.isEmpty()) {                                     // Test if there is NaN values.
      final GeneralEnvelope env = new GeneralEnvelope(2);
      env.setRange(0, bounds.xmin, bounds.xmax);
      env.setRange(1, bounds.ymin, bounds.ymax);
      return env;
    }
  }
  return null;
}

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

Geometry intersect(Geometry input_geom) {
  Geometry dst_geom = tryNativeImplementation_(input_geom);
  if (dst_geom != null)
    return dst_geom;
  Envelope2D commonExtent = InternalUtils.getMergedExtent(
      m_geomIntersector, input_geom);
  // return Topological_operations::intersection(input_geom,
  // m_geomIntersector, m_spatial_reference, m_progress_tracker);
  // Preprocess geometries to be clipped to the extent of intersection to
  // get rid of extra segments.
  double t = InternalUtils.calculateToleranceFromGeometry(m_spatial_reference, commonExtent, true);
  Envelope2D env = new Envelope2D();
  m_geomIntersector.queryEnvelope2D(env);
  Envelope2D env1 = new Envelope2D();
  input_geom.queryEnvelope2D(env1);
  env.inflate(2.0 * t, 2.0 * t);
  env.intersect(env1);
  assert (!env.isEmpty());
  env.inflate(100 * t, 100 * t);
  double tol = 0;
  Geometry clippedIntersector = Clipper.clip(m_geomIntersector, env, tol,
      0.0);
  Geometry clippedInputGeom = Clipper.clip(input_geom, env, tol, 0.0);
  // perform the clip
  return TopologicalOperations.intersection(clippedInputGeom,
      clippedIntersector, m_spatial_reference, m_progress_tracker);
}

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

Geometry intersect(Geometry input_geom) {
  Geometry dst_geom = tryNativeImplementation_(input_geom);
  if (dst_geom != null)
    return dst_geom;
  Envelope2D commonExtent = InternalUtils.getMergedExtent(
      m_geomIntersector, input_geom);
  // return Topological_operations::intersection(input_geom,
  // m_geomIntersector, m_spatial_reference, m_progress_tracker);
  // Preprocess geometries to be clipped to the extent of intersection to
  // get rid of extra segments.
  double t = InternalUtils.calculateToleranceFromGeometry(m_spatial_reference, commonExtent, true);
  Envelope2D env = new Envelope2D();
  m_geomIntersector.queryEnvelope2D(env);
  Envelope2D env1 = new Envelope2D();
  input_geom.queryEnvelope2D(env1);
  env.inflate(2.0 * t, 2.0 * t);
  env.intersect(env1);
  assert (!env.isEmpty());
  env.inflate(100 * t, 100 * t);
  double tol = 0;
  Geometry clippedIntersector = Clipper.clip(m_geomIntersector, env, tol,
      0.0);
  Geometry clippedInputGeom = Clipper.clip(input_geom, env, tol, 0.0);
  // perform the clip
  return TopologicalOperations.intersection(clippedInputGeom,
      clippedIntersector, m_spatial_reference, m_progress_tracker);
}

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

m_geomIntersector.queryEnvelope2D(env);
env.inflate(2 * t, 2 * t);
Envelope2D env1 = new Envelope2D();
input_geom.queryEnvelope2D(env1);
env.intersect(env1);
assert (!env.isEmpty());

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

m_geomIntersector.queryEnvelope2D(env);
env.inflate(2 * t, 2 * t);
Envelope2D env1 = new Envelope2D();
input_geom.queryEnvelope2D(env1);
env.intersect(env1);
assert (!env.isEmpty());

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

private Geometry bufferPolyline_() {
  if (isDegenerateGeometry_(m_geometry)) {
    Point point = new Point();
    ((MultiVertexGeometry) m_geometry).getPointByVal(0, point);
    Envelope2D env2D = new Envelope2D();
    m_geometry.queryEnvelope2D(env2D);
    point.setXY(env2D.getCenter());
    return bufferPoint_(point);
  }
  assert (m_distance > 0);
  Polyline poly = (Polyline)m_geometry; m_geometry = null;
  GeometryCursor glueing_cursor = new GlueingCursorForPolyline(poly);//glues paths together if they connect at one point
  poly = null;
  GeometryCursor generalized_paths = OperatorGeneralize.local().execute(glueing_cursor, m_densify_dist * 0.25, false, m_progress_tracker);
  GeometryCursor simple_paths = OperatorSimplifyOGC.local().execute(generalized_paths, null, true, m_progress_tracker);//make a planar graph.
  generalized_paths = null;
  GeometryCursor path_buffering_cursor = new GeometryCursorForPolyline(this, simple_paths, m_bfilter); simple_paths = null;
  GeometryCursor union_cursor = OperatorUnion.local().execute(path_buffering_cursor, m_spatialReference, m_progress_tracker);//(int)Operator_union::Options::enum_disable_edge_dissolver
  Geometry result = union_cursor.next();
  return result;
}

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

private Geometry bufferPolyline_() {
  if (isDegenerateGeometry_(m_geometry)) {
    Point point = new Point();
    ((MultiVertexGeometry) m_geometry).getPointByVal(0, point);
    Envelope2D env2D = new Envelope2D();
    m_geometry.queryEnvelope2D(env2D);
    point.setXY(env2D.getCenter());
    return bufferPoint_(point);
  }
  assert (m_distance > 0);
  Polyline poly = (Polyline)m_geometry; m_geometry = null;
  GeometryCursor glueing_cursor = new GlueingCursorForPolyline(poly);//glues paths together if they connect at one point
  poly = null;
  GeometryCursor generalized_paths = OperatorGeneralize.local().execute(glueing_cursor, m_densify_dist * 0.25, false, m_progress_tracker);
  GeometryCursor simple_paths = OperatorSimplifyOGC.local().execute(generalized_paths, null, true, m_progress_tracker);//make a planar graph.
  generalized_paths = null;
  GeometryCursor path_buffering_cursor = new GeometryCursorForPolyline(this, simple_paths, m_bfilter); simple_paths = null;
  GeometryCursor union_cursor = OperatorUnion.local().execute(path_buffering_cursor, m_spatialReference, m_progress_tracker);//(int)Operator_union::Options::enum_disable_edge_dissolver
  Geometry result = union_cursor.next();
  return result;
}

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

((MultiVertexGeometry) m_geometry).getPointByVal(0, point);
Envelope2D env2D = new Envelope2D();
m_geometry.queryEnvelope2D(env2D);
point.setXY(env2D.getCenter());
return bufferPoint_(point);

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

((MultiVertexGeometry) m_geometry).getPointByVal(0, point);
Envelope2D env2D = new Envelope2D();
m_geometry.queryEnvelope2D(env2D);
point.setXY(env2D.getCenter());
return bufferPoint_(point);

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

Envelope envelope = (Envelope) (geometry);
Envelope2D env = new Envelope2D();
geometry.queryEnvelope2D(env);

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

Envelope envelope = (Envelope) (geometry);
Envelope2D env = new Envelope2D();
geometry.queryEnvelope2D(env);

相关文章