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

Java LinearComponentExtracter类代码示例

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

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



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

示例1: visit

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
@Override
protected void visit(Geometry geom) {
    /**
     * It may be the case that the rectangle and the
     * envelope of the geometry component are disjoint,
     * so it is worth checking this simple condition.
     */
    Envelope elementEnv = geom.getEnvelopeInternal();
    if (!this.rectEnv.intersects(elementEnv)) {
        return;
    }

    // check segment intersections
    // get all lines from geometry component
    // (there may be more than one if it's a multi-ring polygon)
    List lines = LinearComponentExtracter.getLines(geom);
    this.checkIntersectionWithLineStrings(lines);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:19,代码来源:RectangleIntersects.java


示例2: visit

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
protected void visit(Geometry geom) {
    /**
     * It may be the case that the rectangle and the
     * envelope of the geometry component are disjoint,
     * so it is worth checking this simple condition.
     */
    Envelope elementEnv = geom.getEnvelopeInternal();
    if (!rectEnv.intersects(elementEnv))
        return;

    // check segment intersections
    // get all lines from geometry component
    // (there may be more than one if it's a multi-ring polygon)
    List lines = LinearComponentExtracter.getLines(geom);
    checkIntersectionWithLineStrings(lines);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:17,代码来源:RectangleIntersects.java


示例3: splitBySegment

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
public static List<Geometry> splitBySegment(Geometry geom) {
  List<Geometry> items = new ArrayList<Geometry>();
  List lines = new ArrayList();

  LinearComponentExtracter.getLines(geom, lines);
  for (int icomp = 0; icomp < lines.size(); icomp++) {
    
    Coordinate[] pts = ((LineString) lines.get(icomp)).getCoordinates();
    for (int i = 0; i < pts.length - 1; i++) {
      LineString line = geomFactory.createLineString(
          new Coordinate[] { new Coordinate(pts[i]), new Coordinate(pts[i+1]) });
      items.add(line);
    }
  }
  return items;
}
 
开发者ID:dr-jts,项目名称:jeql,代码行数:17,代码来源:GeomFunction.java


示例4: getLines

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private Collection<Geometry> getLines(final Geometry geom) {
	final List<Geometry> linesList = new ArrayList<Geometry>();
	final LinearComponentExtracter lineFilter = new LinearComponentExtracter(
			linesList);

	geom.apply(lineFilter);

	return linesList;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:DivideLineStringTool.java


示例5: getLines

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private Collection<Geometry> getLines(final Geometry geom1, final Geometry geom2) {
	final List<Geometry> linesList = new ArrayList<Geometry>();
	final LinearComponentExtracter lineFilter = new LinearComponentExtracter(
			linesList);

	geom1.apply(lineFilter);
	geom2.apply(lineFilter);

	return linesList;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:11,代码来源:DividePolygonTool.java


示例6: getPoints

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
/**
 * Gets the computed offset points.
 *
 * @return List<Coordinate>
 */
public List getPoints(double offsetDistance) {
    List offsetPts = new ArrayList();
    List lines = LinearComponentExtracter.getLines(this.g);
    for (Object line1 : lines) {
        LineString line = (LineString) line1;
        this.extractPoints(line, offsetDistance, offsetPts);
    }
    //System.out.println(toMultiPoint(offsetPts));
    return offsetPts;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:16,代码来源:OffsetPointGenerator.java


示例7: isSimplePolygonal

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
/**
 * Computes simplicity for polygonal geometries.
 * Polygonal geometries are simple if and only if
 * all of their component rings are simple.
 *
 * @param geom a Polygonal geometry
 * @return true if the geometry is simple
 */
private boolean isSimplePolygonal(Geometry geom) {
    List rings = LinearComponentExtracter.getLines(geom);
    for (Object ring1 : rings) {
        LinearRing ring = (LinearRing) ring1;
        if (!this.isSimpleLinearGeometry(ring)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:19,代码来源:IsSimpleOp.java


示例8: getPolygonLines

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private Geometry getPolygonLines(Geometry g) {
    List lines = new ArrayList();
    LinearComponentExtracter lineExtracter = new LinearComponentExtracter(lines);
    List polys = PolygonExtracter.getPolygons(g);
    for (Object poly1 : polys) {
        Polygon poly = (Polygon) poly1;
        poly.apply(lineExtracter);
    }
    return g.getFactory().buildGeometry(lines);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:11,代码来源:BufferDistanceValidator.java


示例9: createConstraintSegments

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private static List createConstraintSegments(Geometry geom) {
    List lines = LinearComponentExtracter.getLines(geom);
    List constraintSegs = new ArrayList();
    for (Object line1 : lines) {
        LineString line = (LineString) line1;
        createConstraintSegments(line, constraintSegs);
    }
    return constraintSegs;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:10,代码来源:ConformingDelaunayTriangulationBuilder.java


示例10: init

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private void init(Geometry geom) {
    List lines = LinearComponentExtracter.getLines(geom);
    for (Object line1 : lines) {
        LineString line = (LineString) line1;
        Coordinate[] pts = line.getCoordinates();
        this.addLine(pts);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:9,代码来源:IndexedPointInAreaLocator.java


示例11: extractSegmentStrings

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
/**
 * Extracts all linear components from a given {@link Geometry}
 * to {@link SegmentString}s.
 * The SegmentString data item is set to be the source Geometry.
 *
 * @param geom the geometry to extract from
 * @return a List of SegmentStrings
 */
public static List extractSegmentStrings(Geometry geom) {
    List segStr = new ArrayList();
    List lines = LinearComponentExtracter.getLines(geom);
    for (Object line1 : lines) {
        LineString line = (LineString) line1;
        Coordinate[] pts = line.getCoordinates();
        segStr.add(new NodedSegmentString(pts, geom));
    }
    return segStr;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:19,代码来源:SegmentStringUtil.java


示例12: extractLines

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private List extractLines(Collection geoms) {
    List lines = new ArrayList();
    LinearComponentExtracter lce = new LinearComponentExtracter(lines);
    for (Object geom1 : geoms) {
        Geometry geom = (Geometry) geom1;
        geom.apply(lce);
    }
    return lines;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:10,代码来源:GeometryNoder.java


示例13: getPoints

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
/**
 * Gets the computed offset points.
 *
 * @return List<Coordinate>
 */
public List getPoints(double offsetDistance) {
    List offsetPts = new ArrayList();
    List lines = LinearComponentExtracter.getLines(g);
    for (Iterator i = lines.iterator(); i.hasNext(); ) {
        LineString line = (LineString) i.next();
        extractPoints(line, offsetDistance, offsetPts);
    }
    //System.out.println(toMultiPoint(offsetPts));
    return offsetPts;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:16,代码来源:OffsetPointGenerator.java


示例14: isSimplePolygonal

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
/**
 * Computes simplicity for polygonal geometries.
 * Polygonal geometries are simple if and only if
 * all of their component rings are simple.
 *
 * @param geom a Polygonal geometry
 * @return true if the geometry is simple
 */
private boolean isSimplePolygonal(Geometry geom) {
    List rings = LinearComponentExtracter.getLines(geom);
    for (Iterator i = rings.iterator(); i.hasNext(); ) {
        LinearRing ring = (LinearRing) i.next();
        if (!isSimpleLinearGeometry(ring))
            return false;
    }
    return true;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:18,代码来源:IsSimpleOp.java


示例15: getPolygonLines

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private Geometry getPolygonLines(Geometry g) {
    List lines = new ArrayList();
    LinearComponentExtracter lineExtracter = new LinearComponentExtracter(lines);
    List polys = PolygonExtracter.getPolygons(g);
    for (Iterator i = polys.iterator(); i.hasNext(); ) {
        Polygon poly = (Polygon) i.next();
        poly.apply(lineExtracter);
    }
    return g.getFactory().buildGeometry(lines);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:11,代码来源:BufferDistanceValidator.java


示例16: computeFacetDistance

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
/**
 * Computes distance between facets (lines and points)
 * of input geometries.
 */
private void computeFacetDistance() {
    GeometryLocation[] locGeom = new GeometryLocation[2];

    /**
     * Geometries are not wholely inside, so compute distance from lines and points
     * of one to lines and points of the other
     */
    List lines0 = LinearComponentExtracter.getLines(geom[0]);
    List lines1 = LinearComponentExtracter.getLines(geom[1]);

    List pts0 = PointExtracter.getPoints(geom[0]);
    List pts1 = PointExtracter.getPoints(geom[1]);

    // exit whenever minDistance goes LE than terminateDistance
    computeMinDistanceLines(lines0, lines1, locGeom);
    updateMinDistance(locGeom, false);
    if (minDistance <= terminateDistance) return;

    locGeom[0] = null;
    locGeom[1] = null;
    computeMinDistanceLinesPoints(lines0, pts1, locGeom);
    updateMinDistance(locGeom, false);
    if (minDistance <= terminateDistance) return;

    locGeom[0] = null;
    locGeom[1] = null;
    computeMinDistanceLinesPoints(lines1, pts0, locGeom);
    updateMinDistance(locGeom, true);
    if (minDistance <= terminateDistance) return;

    locGeom[0] = null;
    locGeom[1] = null;
    computeMinDistancePoints(pts0, pts1, locGeom);
    updateMinDistance(locGeom, false);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:40,代码来源:DistanceOp.java


示例17: createConstraintSegments

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private static List createConstraintSegments(Geometry geom) {
    List lines = LinearComponentExtracter.getLines(geom);
    List constraintSegs = new ArrayList();
    for (Iterator i = lines.iterator(); i.hasNext(); ) {
        LineString line = (LineString) i.next();
        createConstraintSegments(line, constraintSegs);
    }
    return constraintSegs;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:10,代码来源:ConformingDelaunayTriangulationBuilder.java


示例18: init

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private void init(Geometry geom) {
    List lines = LinearComponentExtracter.getLines(geom);
    for (Iterator i = lines.iterator(); i.hasNext(); ) {
        LineString line = (LineString) i.next();
        Coordinate[] pts = line.getCoordinates();
        addLine(pts);
    }
}
 
开发者ID:Semantive,项目名称:jts,代码行数:9,代码来源:IndexedPointInAreaLocator.java


示例19: extractSegmentStrings

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
/**
 * Extracts all linear components from a given {@link Geometry}
 * to {@link SegmentString}s.
 * The SegmentString data item is set to be the source Geometry.
 *
 * @param geom the geometry to extract from
 * @return a List of SegmentStrings
 */
public static List extractSegmentStrings(Geometry geom) {
    List segStr = new ArrayList();
    List lines = LinearComponentExtracter.getLines(geom);
    for (Iterator i = lines.iterator(); i.hasNext(); ) {
        LineString line = (LineString) i.next();
        Coordinate[] pts = line.getCoordinates();
        segStr.add(new NodedSegmentString(pts, geom));
    }
    return segStr;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:19,代码来源:SegmentStringUtil.java


示例20: extractLines

import com.vividsolutions.jts.geom.util.LinearComponentExtracter; //导入依赖的package包/类
private List extractLines(Collection geoms) {
    List lines = new ArrayList();
    LinearComponentExtracter lce = new LinearComponentExtracter(lines);
    for (Iterator it = geoms.iterator(); it.hasNext(); ) {
        Geometry geom = (Geometry) it.next();
        geom.apply(lce);
    }
    return lines;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:10,代码来源:GeometryNoder.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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