本文整理了Java中com.vividsolutions.jts.operation.union.UnaryUnionOp
类的一些代码示例,展示了UnaryUnionOp
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UnaryUnionOp
类的具体详情如下:
包路径:com.vividsolutions.jts.operation.union.UnaryUnionOp
类名称:UnaryUnionOp
[英]Unions a Collection
of Geometrys or a single Geometry (which may be a GeoometryCollection) together. By using this special-purpose operation over a collection of geometries it is possible to take advantage of various optimizations to improve performance. Heterogeneous GeometryCollections are fully supported.
The result obeys the following contract:
Collection
个几何体或单个几何体(可能是地质计量集合)合并在一起。通过在一组几何图形上使用这种特殊用途的操作,可以利用各种优化来提高性能。完全支持异构Geometry集合。代码示例来源:origin: com.vividsolutions/jts
public static Geometry union(Geometry geom)
{
UnaryUnionOp op = new UnaryUnionOp(geom);
return op.union();
}
代码示例来源:origin: com.vividsolutions/jts
public UnaryUnionOp(Geometry geom)
{
extract(geom);
}
代码示例来源:origin: com.vividsolutions/jts
/**
* Computes the union of all the elements of this geometry.
* <p>
* <code>union()</code> supports
* {@link GeometryCollection}s
* (which the other overlay operations currently do not).
* <p>
* The result obeys the following contract:
* <ul>
* <li>Unioning a set of {@link LineString}s has the effect of fully noding
* and dissolving the linework.
* <li>Unioning a set of {@link Polygon}s will always
* return a {@link Polygonal} geometry (unlike {@link #union(Geometry)},
* which may return geometrys of lower dimension if a topology collapse occurred.
* </ul>
*
* @return the union geometry
* @throws TopologyException if a robustness error occurs
*
* @see UnaryUnionOp
*/
public Geometry union() {
return UnaryUnionOp.union(this);
}
代码示例来源:origin: com.vividsolutions/jts
if (points.size() > 0) {
Geometry ptGeom = geomFact.buildGeometry(points);
unionPoints = unionNoOpt(ptGeom);
if (lines.size() > 0) {
Geometry lineGeom = geomFact.buildGeometry(lines);
unionLines = unionNoOpt(lineGeom);
Geometry unionLA = unionWithNull(unionLines, unionPolygons);
Geometry union = null;
if (unionPoints == null)
代码示例来源:origin: org.orbisgis/h2spatial
/**
* @param geomList Geometry list
* @return union of all Geometries in geomList
*/
public static Geometry union(Geometry geomList) {
return UnaryUnionOp.union(geomList);
}
}
代码示例来源:origin: com.vividsolutions/jts-core
if (points.size() > 0) {
Geometry ptGeom = geomFact.buildGeometry(points);
unionPoints = unionNoOpt(ptGeom);
if (lines.size() > 0) {
Geometry lineGeom = geomFact.buildGeometry(lines);
unionLines = unionNoOpt(lineGeom);
Geometry unionLA = unionWithNull(unionLines, unionPolygons);
Geometry union = null;
if (unionPoints == null)
代码示例来源:origin: com.vividsolutions/jts
public static Geometry union(Collection geoms)
{
UnaryUnionOp op = new UnaryUnionOp(geoms);
return op.union();
}
代码示例来源:origin: org.orbisgis/h2gis-functions
/**
* @param geomList Geometry list
* @return union of all Geometries in geomList
*/
public static Geometry union(Geometry geomList) {
return UnaryUnionOp.union(geomList);
}
}
代码示例来源:origin: com.vividsolutions/jts
public UnaryUnionOp(Collection geoms, GeometryFactory geomFact)
{
this.geomFact = geomFact;
extract(geoms);
}
代码示例来源:origin: com.vividsolutions/jts
public static Geometry union(Collection geoms, GeometryFactory geomFact)
{
UnaryUnionOp op = new UnaryUnionOp(geoms, geomFact);
return op.union();
}
代码示例来源:origin: org.orbisgis/h2gis
/**
* @param geomList Geometry list
* @return union of all Geometries in geomList
*/
public static Geometry union(Geometry geomList) {
return UnaryUnionOp.union(geomList);
}
}
代码示例来源:origin: com.vividsolutions/jts
public UnaryUnionOp(Collection geoms)
{
extract(geoms);
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Constructs a unary union operation for a {@link Geometry}
* (which may be a {@link GeometryCollection}).
*
* @param geom a geometry to union
* @return the union of the elements of the geometry
* or an empty GEOMETRYCOLLECTION
*/
public static Geometry union(Geometry geom)
{
UnaryUnionOp op = new UnaryUnionOp(geom);
return op.union();
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Computes the union of all the elements of this geometry.
* <p>
* This method supports
* {@link GeometryCollection}s
* (which the other overlay operations currently do not).
* <p>
* The result obeys the following contract:
* <ul>
* <li>Unioning a set of {@link LineString}s has the effect of fully noding
* and dissolving the linework.
* <li>Unioning a set of {@link Polygon}s always
* returns a {@link Polygonal} geometry (unlike {@link #union(Geometry)},
* which may return geometries of lower dimension if a topology collapse occurred).
* </ul>
*
* @return the union geometry
* @throws TopologyException if a robustness error occurs
*
* @see UnaryUnionOp
*/
public Geometry union() {
return UnaryUnionOp.union(this);
}
代码示例来源:origin: com.vividsolutions/jts
private void extract(Collection geoms)
{
for (Iterator i = geoms.iterator(); i.hasNext();) {
Geometry geom = (Geometry) i.next();
extract(geom);
}
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Computes the geometric union of a {@link Collection}
* of {@link Geometry}s.
*
* @param geoms a collection of geometries
* @return the union of the geometries,
* or <code>null</code> if the input is empty
*/
public static Geometry union(Collection geoms)
{
UnaryUnionOp op = new UnaryUnionOp(geoms);
return op.union();
}
代码示例来源:origin: harbby/presto-connectors
/**
* This "pages" through standard geo boundaries offset by multiples of 360
* longitudinally that intersect geom, and the intersecting results of a page
* and the geom are shifted into the standard -180 to +180 and added to a new
* geometry that is returned.
*/
private static Geometry cutUnwrappedGeomInto360(Geometry geom) {
Envelope geomEnv = geom.getEnvelopeInternal();
if (geomEnv.getMinX() >= -180 && geomEnv.getMaxX() <= 180)
return geom;
assert geom.isValid() : "geom";
//TODO opt: support geom's that start at negative pages --
// ... will avoid need to previously shift in unwrapDateline(geom).
List<Geometry> geomList = new ArrayList<Geometry>();
//page 0 is the standard -180 to 180 range
for (int page = 0; true; page++) {
double minX = -180 + page * 360;
if (geomEnv.getMaxX() <= minX)
break;
Geometry rect = geom.getFactory().toGeometry(new Envelope(minX, minX + 360, -90, 90));
assert rect.isValid() : "rect";
Geometry pageGeom = rect.intersection(geom);//JTS is doing some hard work
assert pageGeom.isValid() : "pageGeom";
shiftGeomByX(pageGeom, page * -360);
geomList.add(pageGeom);
}
return UnaryUnionOp.union(geomList);
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Constructs a unary union operation for a {@link Geometry}
* (which may be a {@link GeometryCollection}).
* @param geom
*/
public UnaryUnionOp(Geometry geom)
{
extract(geom);
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Computes the geometric union of a {@link Collection}
* of {@link Geometry}s.
*
* If no input geometries were provided but a {@link GeometryFactory} was provided,
* an empty {@link GeometryCollection} is returned.
*
* @param geoms a collection of geometries
* @param geomFact the geometry factory to use if the collection is empty
* @return the union of the geometries,
* or an empty GEOMETRYCOLLECTION
*/
public static Geometry union(Collection geoms, GeometryFactory geomFact)
{
UnaryUnionOp op = new UnaryUnionOp(geoms, geomFact);
return op.union();
}
代码示例来源:origin: com.spatial4j/spatial4j
/**
* This "pages" through standard geo boundaries offset by multiples of 360
* longitudinally that intersect geom, and the intersecting results of a page
* and the geom are shifted into the standard -180 to +180 and added to a new
* geometry that is returned.
*/
private static Geometry cutUnwrappedGeomInto360(Geometry geom) {
Envelope geomEnv = geom.getEnvelopeInternal();
if (geomEnv.getMinX() >= -180 && geomEnv.getMaxX() <= 180)
return geom;
assert geom.isValid() : "geom";
//TODO opt: support geom's that start at negative pages --
// ... will avoid need to previously shift in unwrapDateline(geom).
List<Geometry> geomList = new ArrayList<Geometry>();
//page 0 is the standard -180 to 180 range
for (int page = 0; true; page++) {
double minX = -180 + page * 360;
if (geomEnv.getMaxX() <= minX)
break;
Geometry rect = geom.getFactory().toGeometry(new Envelope(minX, minX + 360, -90, 90));
assert rect.isValid() : "rect";
Geometry pageGeom = rect.intersection(geom);//JTS is doing some hard work
assert pageGeom.isValid() : "pageGeom";
shiftGeomByX(pageGeom, page * -360);
geomList.add(pageGeom);
}
return UnaryUnionOp.union(geomList);
}
内容来源于网络,如有侵权,请联系作者删除!