• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CascadedPolygonUnion类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vividsolutions.jts.operation.union.CascadedPolygonUnion的典型用法代码示例。如果您正苦于以下问题:Java CascadedPolygonUnion类的具体用法?Java CascadedPolygonUnion怎么用?Java CascadedPolygonUnion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CascadedPolygonUnion类属于com.vividsolutions.jts.operation.union包,在下文中一共展示了CascadedPolygonUnion类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createPolygonsFromRanges

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
public static Geometry createPolygonsFromRanges( double[] xRanges, double[] yRanges ) {
    List<Geometry> geomsList = new ArrayList<>();
    int cols = xRanges.length - 1;
    int rows = yRanges.length - 1;
    for( int x = 0; x < cols - 1; x++ ) {
        double x1 = xRanges[x];
        double x2 = xRanges[x + 1];
        for( int y = 0; y < rows - 1; y++ ) {
            double y1 = xRanges[y];
            double y2 = xRanges[y + 1];

            Envelope env = new Envelope(x1, x2, y1, y2);
            Polygon poly = GeometryUtilities.createPolygonFromEnvelope(env);
            geomsList.add(poly);
        }
    }
    Geometry union = CascadedPolygonUnion.union(geomsList);
    return union;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:20,代码来源:GeometryUtilities.java


示例2: process

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
@Execute
public void process() {

    // create a geometry list of the input polygons
    List<Geometry> inInundationGeomsList = FeatureUtilities.featureCollectionToGeometriesList(inInundationArea, false, null);

    // make the union and merge of the polygons
    Geometry union = CascadedPolygonUnion.union(inInundationGeomsList);
    List<Geometry> removedHoles = removeHoles(union);

    // store the results in the output feature collection
    outInundationArea = new DefaultFeatureCollection();
    SimpleFeatureCollection outMergedAreaFC = FeatureUtilities.featureCollectionFromGeometry(inInundationArea.getBounds()
            .getCoordinateReferenceSystem(), removedHoles.toArray(GeometryUtilities.TYPE_POLYGON));

    ((DefaultFeatureCollection) outInundationArea).addAll(outMergedAreaFC);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:18,代码来源:OmsLW09_NetworBufferMergerHolesRemover.java


示例3: process

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
@Execute
public void process() throws Exception {
    checkNull(inBankfull);

    List<Geometry> geoms = FeatureUtilities.featureCollectionToGeometriesList(inBankfull, true, null);

    // creates a unique feature with multipolygons
    Geometry union = CascadedPolygonUnion.union(geoms);

    // makes a buffer of each geometry in the feature and merges the touching geometries
    Geometry buffer = union.buffer(0.05);

    // splits the remaining geometries (not touching)
    List<Geometry> newGeoms = new ArrayList<Geometry>();
    for( int i = 0; i < buffer.getNumGeometries(); i++ ) {
        Geometry geometryN = buffer.getGeometryN(i);
        if (geometryN instanceof Polygon) {
            newGeoms.add(geometryN);
        }
    }

    outBankfull = FeatureUtilities.featureCollectionFromGeometry(inBankfull.getBounds().getCoordinateReferenceSystem(),
            newGeoms.toArray(GeometryUtilities.TYPE_POLYGON));

}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:26,代码来源:OmsLW01_ChannelPolygonMerger.java


示例4: difference

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static Geometry difference(STRtree tree, AtomicInteger counter, Geometry geom) {
    List<Geometry> query = tree.query(geom.getEnvelopeInternal());
    log.info("{} {} {}", counter.getAndDecrement(), query.size(), geom.getEnvelopeInternal());
    if (!query.isEmpty()) {
        List<Geometry> collect = query.stream().map(t -> t.buffer(DELTA)).collect(toList());
        return geom.difference(CascadedPolygonUnion.union(collect).buffer(-1 * DELTA));
    }
    return geom;
}
 
开发者ID:Mappy,项目名称:fpm,代码行数:11,代码来源:Oceans.java


示例5: run

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
public void run() {
    File rootFolder = new File(tomtomFolder);
    List<String> countries = asList(rootFolder.list(directoryFileFilter()));
    log.info("Listing tomtom files for {} countries : {} ", countries.size(), countries);
    List<Geometry> allPolygons = countries.stream() //
            .map(country -> new File(rootFolder.getAbsolutePath() + "/" + country)) //
            .filter(CoastlineGenerator::hasA0Files) //
            .map(file -> new File(file, getA0Files(file))) //
            .flatMap(file -> readFeatures(file).stream()) //
            .map(Feature::getGeometry) //
            .map(CoastlineGenerator::cropIfNeeded) //
            .collect(toList());

    Geometry naturalEarthPolygon = getNaturalEarthGeometry();
    log.info("Merging {} tomtom polygons with naturalEarth polygon", allPolygons.size());
    allPolygons.add(naturalEarthPolygon);
    MultiPolygon coastlineMultipolygon = (MultiPolygon) new CascadedPolygonUnion(allPolygons).union().reverse();

    log.info("Serializing coastlines.");
    for (int i = 0; i < coastlineMultipolygon.getNumGeometries(); i++) {
        Polygon polygon = (Polygon) coastlineMultipolygon.getGeometryN(i);
        serializer.write(GEOMETRY_FACTORY.createPolygon(polygon.getExteriorRing().getCoordinateSequence()), COASTLINE_TAG);
        if (polygon.getNumInteriorRing() != 0) {
            for (int j = 0; j < polygon.getNumInteriorRing(); j++) {
                serializer.write(GEOMETRY_FACTORY.createPolygon(polygon.getInteriorRingN(j).getCoordinateSequence()), COASTLINE_TAG);
            }
        }
    }
    serializer.close();
}
 
开发者ID:Mappy,项目名称:fpm,代码行数:31,代码来源:CoastlineGenerator.java


示例6: convexHulls

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
private static Geometry convexHulls(Geometry g) {
    int gN = g.getNumGeometries();
    
    List<Geometry> sG = new ArrayList<Geometry>();
    for(int i = 0; i < gN; i++) {
        sG.add(g.getGeometryN(i).convexHull());
    }
    
    return new CascadedPolygonUnion(sG).union();
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:11,代码来源:Contours.java


示例7: unionCascaded

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
public Geometry unionCascaded(List geoms)
{
	return CascadedPolygonUnion.union(geoms);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:5,代码来源:UnionPerfTester.java


示例8: getFloodingArea

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
private PreparedGeometry getFloodingArea( SimpleFeatureCollection inFloodingAreas ) throws Exception {
    List<Geometry> geometriesList = FeatureUtilities.featureCollectionToGeometriesList(inFloodingAreas, true, null);
    Geometry polygonUnion = CascadedPolygonUnion.union(geometriesList);
    PreparedGeometry preparedGeometry = PreparedGeometryFactory.prepare(polygonUnion);
    return preparedGeometry;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:7,代码来源:OmsLW10_SingleTree_AreaToNetpointAssociator.java


示例9: fastUnion

import com.vividsolutions.jts.operation.union.CascadedPolygonUnion; //导入依赖的package包/类
public static Geometry fastUnion(List<Geometry> gs) {
    return gs.isEmpty() ?
            geometryFactory.createGeometryCollection(new Geometry[] {}) :
            new CascadedPolygonUnion(gs).union();
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:6,代码来源:Util.java



注:本文中的com.vividsolutions.jts.operation.union.CascadedPolygonUnion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HttpServletResponseAdapter类代码示例发布时间:2022-05-23
下一篇:
Java GetSnapshotsResponse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap