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

Java GeometryCombiner类代码示例

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

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



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

示例1: unionOptimized

import com.vividsolutions.jts.geom.util.GeometryCombiner; //导入依赖的package包/类
private Geometry unionOptimized(Geometry g0, Geometry g1) {
        Envelope g0Env = g0.getEnvelopeInternal();
        Envelope g1Env = g1.getEnvelopeInternal();
        //*
        if (!g0Env.intersects(g1Env)) {
            Geometry combo = GeometryCombiner.combine(g0, g1);
//   		System.out.println("Combined");
//  		System.out.println(combo);
            return combo;
        }
        //*/
//  	System.out.println(g0.getNumGeometries() + ", " + g1.getNumGeometries());

        if (g0.getNumGeometries() <= 1 && g1.getNumGeometries() <= 1) {
            return this.unionActual(g0, g1);
        }

        // for testing...
//  	if (true) return g0.union(g1);

        Envelope commonEnv = g0Env.intersection(g1Env);
        return this.unionUsingEnvelopeIntersection(g0, g1, commonEnv);

//  	return UnionInteracting.union(g0, g1);
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:26,代码来源:CascadedPolygonUnion.java


示例2: unionOptimized

import com.vividsolutions.jts.geom.util.GeometryCombiner; //导入依赖的package包/类
private Geometry unionOptimized(Geometry g0, Geometry g1) {
        Envelope g0Env = g0.getEnvelopeInternal();
        Envelope g1Env = g1.getEnvelopeInternal();
        //*
        if (!g0Env.intersects(g1Env)) {
            Geometry combo = GeometryCombiner.combine(g0, g1);
//   		System.out.println("Combined");
//  		System.out.println(combo);
            return combo;
        }
        //*/
//  	System.out.println(g0.getNumGeometries() + ", " + g1.getNumGeometries());

        if (g0.getNumGeometries() <= 1 && g1.getNumGeometries() <= 1)
            return unionActual(g0, g1);

        // for testing...
//  	if (true) return g0.union(g1);

        Envelope commonEnv = g0Env.intersection(g1Env);
        return unionUsingEnvelopeIntersection(g0, g1, commonEnv);

//  	return UnionInteracting.union(g0, g1);
    }
 
开发者ID:Semantive,项目名称:jts,代码行数:25,代码来源:CascadedPolygonUnion.java


示例3: union

import com.vividsolutions.jts.geom.util.GeometryCombiner; //导入依赖的package包/类
public Geometry union() {
    PointLocator locater = new PointLocator();
    // use a set to eliminate duplicates, as required for union
    Set exteriorCoords = new TreeSet();

    for (int i = 0; i < this.pointGeom.getNumGeometries(); i++) {
        Point point = (Point) this.pointGeom.getGeometryN(i);
        Coordinate coord = point.getCoordinate();
        int loc = locater.locate(coord, this.otherGeom);
        if (loc == Location.EXTERIOR) {
            exteriorCoords.add(coord);
        }
    }

    // if no points are in exterior, return the other geom
    if (exteriorCoords.size() == 0) {
        return this.otherGeom;
    }

    // make a puntal geometry of appropriate size
    Geometry ptComp = null;
    Coordinate[] coords = CoordinateArrays.toCoordinateArray(exteriorCoords);
    if (coords.length == 1) {
        ptComp = this.geomFact.createPoint(coords[0]);
    } else {
        ptComp = this.geomFact.createMultiPoint(coords);
    }

    // add point component to the other geometry
    return GeometryCombiner.combine(ptComp, this.otherGeom);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:32,代码来源:PointGeometryUnion.java


示例4: union

import com.vividsolutions.jts.geom.util.GeometryCombiner; //导入依赖的package包/类
public Geometry union() {
    PointLocator locater = new PointLocator();
    // use a set to eliminate duplicates, as required for union
    Set exteriorCoords = new TreeSet();

    for (int i = 0; i < pointGeom.getNumGeometries(); i++) {
        Point point = (Point) pointGeom.getGeometryN(i);
        Coordinate coord = point.getCoordinate();
        int loc = locater.locate(coord, otherGeom);
        if (loc == Location.EXTERIOR)
            exteriorCoords.add(coord);
    }

    // if no points are in exterior, return the other geom
    if (exteriorCoords.size() == 0)
        return otherGeom;

    // make a puntal geometry of appropriate size
    Geometry ptComp = null;
    Coordinate[] coords = CoordinateArrays.toCoordinateArray(exteriorCoords);
    if (coords.length == 1) {
        ptComp = geomFact.createPoint(coords[0]);
    } else {
        ptComp = geomFact.createMultiPoint(coords);
    }

    // add point component to the other geometry
    return GeometryCombiner.combine(ptComp, otherGeom);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:30,代码来源:PointGeometryUnion.java


示例5: getOverlay

import com.vividsolutions.jts.geom.util.GeometryCombiner; //导入依赖的package包/类
protected List<String> getOverlay(final List<String> wktLayer1,
		final List<String> wktLayer2, final int op) {
	final Geometry layer1 = GeometryCombiner.combine(getList(wktLayer1));
	final Geometry layer2 = GeometryCombiner.combine(getList(wktLayer2));
	return topologicalOverlay.getOverlay(layer1, layer2, op);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:7,代码来源:AbstractJTSService.java


示例6: unionUsingEnvelopeIntersection

import com.vividsolutions.jts.geom.util.GeometryCombiner; //导入依赖的package包/类
/**
     * Unions two polygonal geometries, restricting computation
     * to the envelope intersection where possible.
     * The case of MultiPolygons is optimized to union only
     * the polygons which lie in the intersection of the two geometry's envelopes.
     * Polygons outside this region can simply be combined with the union result,
     * which is potentially much faster.
     * This case is likely to occur often during cascaded union, and may also
     * occur in real world data (such as unioning data for parcels on different street blocks).
     *
     * @param g0 a polygonal geometry
     * @param g1 a polygonal geometry
     * @param common the intersection of the envelopes of the inputs
     * @return the union of the inputs
     */
    private Geometry unionUsingEnvelopeIntersection(Geometry g0, Geometry g1, Envelope common) {
        List disjointPolys = new ArrayList();

        Geometry g0Int = this.extractByEnvelope(common, g0, disjointPolys);
        Geometry g1Int = this.extractByEnvelope(common, g1, disjointPolys);

//  	System.out.println("# geoms in common: " + intersectingPolys.size());
        Geometry union = this.unionActual(g0Int, g1Int);

        disjointPolys.add(union);
        Geometry overallUnion = GeometryCombiner.combine(disjointPolys);

        return overallUnion;
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:30,代码来源:CascadedPolygonUnion.java


示例7: unionUsingEnvelopeIntersection

import com.vividsolutions.jts.geom.util.GeometryCombiner; //导入依赖的package包/类
/**
     * Unions two polygonal geometries, restricting computation
     * to the envelope intersection where possible.
     * The case of MultiPolygons is optimized to union only
     * the polygons which lie in the intersection of the two geometry's envelopes.
     * Polygons outside this region can simply be combined with the union result,
     * which is potentially much faster.
     * This case is likely to occur often during cascaded union, and may also
     * occur in real world data (such as unioning data for parcels on different street blocks).
     *
     * @param g0     a polygonal geometry
     * @param g1     a polygonal geometry
     * @param common the intersection of the envelopes of the inputs
     * @return the union of the inputs
     */
    private Geometry unionUsingEnvelopeIntersection(Geometry g0, Geometry g1, Envelope common) {
        List disjointPolys = new ArrayList();

        Geometry g0Int = extractByEnvelope(common, g0, disjointPolys);
        Geometry g1Int = extractByEnvelope(common, g1, disjointPolys);

//  	System.out.println("# geoms in common: " + intersectingPolys.size());
        Geometry union = unionActual(g0Int, g1Int);

        disjointPolys.add(union);
        Geometry overallUnion = GeometryCombiner.combine(disjointPolys);

        return overallUnion;
    }
 
开发者ID:Semantive,项目名称:jts,代码行数:30,代码来源:CascadedPolygonUnion.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java WebConfig类代码示例发布时间:2022-05-23
下一篇:
Java AScan类代码示例发布时间: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