com.vividsolutions.jts.geom.Geometry.getEnvelope()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(179)

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

Geometry.getEnvelope介绍

[英]Gets a Geometry representing the envelope (bounding box) of this Geometry.

If this Geometry is:

  • empty, returns an empty Point.
  • a point, returns a Point.
  • a line parallel to an axis, a two-vertex LineString
  • otherwise, returns a Polygon whose vertices are (minx miny, maxx miny, maxx maxy, minx maxy, minx miny).
    [中]获取表示此Geometry的封套(边界框)的几何体。
    如果该Geometry为:
    *empty,返回一个空Point
    *一个点,返回一个Point
    *平行于轴的线,两个顶点LineString
    *否则,返回一个Polygon,其顶点为(minx miny、max miny、max maxy、minx maxy、minx miny)。

代码示例

代码示例来源:origin: org.geotools/gt-main

static public Geometry envelope(Geometry arg0)
{
   if (arg0 == null) return null;
   Geometry _this = arg0;
   return _this.getEnvelope();
}

代码示例来源:origin: org.geotools/gt-process-feature

public ClippingFeatureIterator(SimpleFeatureIterator delegate, Geometry clip,
    SimpleFeatureType schema) {
  this.delegate = delegate;
  
  // can we use the fast clipper?
  if(clip.getEnvelope().equals(clip)) {
    this.clipper = new GeometryClipper(clip.getEnvelopeInternal());
  } else {
    this.clip = clip;
  }
    
  fb = new SimpleFeatureBuilder(schema);
}

代码示例来源:origin: org.orbisgis/h2gis-functions

/**
   * @param geometry Geometry instance
   * @return Geometry envelope
   */
  public static Geometry getEnvelope(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getEnvelope();
  }
}

代码示例来源:origin: org.orbisgis/h2spatial

/**
   * @param geometry Geometry instance
   * @return Geometry envelope
   */
  public static Geometry getEnvelope(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getEnvelope();
  }
}

代码示例来源:origin: org.orbisgis/h2gis

/**
   * @param geometry Geometry instance
   * @return Geometry envelope
   */
  public static Geometry getEnvelope(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getEnvelope();
  }
}

代码示例来源:origin: org.geotools/gt2-main

static public Geometry envelope(Geometry arg0)
{
   Geometry _this = arg0;
   return _this.getEnvelope();
}

代码示例来源:origin: eu.agrosense.client/io-shape

@Override
public Geometry getBoundingBox() {
  return (this.geometry != null) ? geometry.getEnvelope() : null;
}

代码示例来源:origin: org.datasyslab/geospark

private void addGeometry(Geometry geometry, List<Polygon> result)
  {
    if (geometry instanceof MultiPolygon) {
      addMultiGeometry((MultiPolygon) geometry, result);
    }
    else {
      result.add((Polygon) (geometry.getEnvelope()));
    }
  }
}

代码示例来源:origin: ryantxu/spatial-solr-sandbox

@Override
 public boolean matches(Geometry geo) {
  return geo.getEnvelope().intersects(queryGeo);
 }
}

代码示例来源:origin: ryantxu/spatial-solr-sandbox

@Override
 public boolean matches(Geometry geo) {
  return geo.getEnvelope().within(queryGeo);
 }
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

public static boolean boundingBoxIntersects(
    GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
  Geometry g1 = getGeometry(geom1);
  Geometry g2 = getGeometry(geom2);
  return g1.getEnvelope().intersects(g2.getEnvelope());
}

代码示例来源:origin: org.teiid/teiid-engine

public static boolean boundingBoxIntersects(
    GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
  Geometry g1 = getGeometry(geom1);
  Geometry g2 = getGeometry(geom2);
  return g1.getEnvelope().intersects(g2.getEnvelope());
}

代码示例来源:origin: teiid/teiid

public static boolean boundingBoxIntersects(
    GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
  Geometry g1 = getGeometry(geom1);
  Geometry g2 = getGeometry(geom2);
  return g1.getEnvelope().intersects(g2.getEnvelope());
}

代码示例来源:origin: BaseXdb/basex

@Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return toElement(checkGeo(0, qc).getEnvelope(), qc);
 }
}

代码示例来源:origin: NationalSecurityAgency/datawave

protected static List<Geometry> getAllEnvelopeGeometries(Geometry geom) {
  List<Geometry> geometries = new ArrayList<>();
  if (geom.getNumGeometries() > 1)
    for (int geoIdx = 0; geoIdx < geom.getNumGeometries(); geoIdx++)
      geometries.addAll(getAllEnvelopeGeometries(geom.getGeometryN(geoIdx)));
  else
    geometries.add(geom.getEnvelope());
  return geometries;
}

代码示例来源:origin: org.geotools/gt2-jts-wrapper

/**
 * Returns a Geometry that represents the minimum bounding region of this
 * geometry.
 */
public final Geometry getMbRegion() {
  com.vividsolutions.jts.geom.Geometry jtsGeom = getJTSGeometry();
  return JTSUtils.jtsToGo1(jtsGeom.getEnvelope(), getCoordinateReferenceSystem());
}

代码示例来源:origin: org.geotools/gt-jts-wrapper

/**
 * Returns a Geometry that represents the minimum bounding region of this
 * geometry.
 */
public final Geometry getMbRegion() {
  com.vividsolutions.jts.geom.Geometry jtsGeom = getJTSGeometry();
  return JTSUtils.jtsToGo1(jtsGeom.getEnvelope(), getCoordinateReferenceSystem());
}

代码示例来源:origin: aseldawy/pigeon

@Override
public DataByteArray exec(Tuple input) throws IOException {
 Geometry geom = null;
 try {
  Object v = input.get(0);
  geom = GEOMETRY_PARSER.parseGeom(v);
  Geometry envelope = geom.getEnvelope();
  return new DataByteArray(WKB_WRITER.write(envelope));
 } catch (ExecException ee) {
  throw new GeoException(geom, ee);
 }
}

代码示例来源:origin: org.n52.sensorweb.sos/coding-sensorML-v101

private Geometry getGeometry4BBOX(EnvelopeDocument xbBbox) throws OwsExceptionReport {
  EnvelopeType xbEnvelope = xbBbox.getEnvelope();
  // parse srid; if not set, throw exception!
  int srid = SosHelper.parseSrsName(xbEnvelope.getSrsName());
  String lower = xbEnvelope.getLowerCorner().getStringValue();
  String upper = xbEnvelope.getUpperCorner().getStringValue();
  String geomWKT = String.format("MULTIPOINT(%s, %s)", lower, upper);
  return JTSHelper.createGeometryFromWKT(geomWKT, srid).getEnvelope();
}

代码示例来源:origin: org.n52.svalbard/svalbard-xmlbeans

private Geometry getGeometry4BBOX(EnvelopeDocument xbBbox) throws DecodingException {
  EnvelopeType xbEnvelope = xbBbox.getEnvelope();
  // parse srid; if not set, throw exception!
  int srid = CRSHelper.parseSrsName(xbEnvelope.getSrsName());
  String lower = xbEnvelope.getLowerCorner().getStringValue();
  String upper = xbEnvelope.getUpperCorner().getStringValue();
  String geomWKT = String.format("MULTIPOINT(%s, %s)", lower, upper);
  try {
    return JTSHelper.createGeometryFromWKT(geomWKT, srid).getEnvelope();
  } catch (ParseException ex) {
    throw new DecodingException(ex);
  }
}

相关文章