当前位置: 首页>>代码示例>>Java>>正文


Java GeometryGraph.computeSelfNodes方法代码示例

本文整理汇总了Java中com.vividsolutions.jts.geomgraph.GeometryGraph.computeSelfNodes方法的典型用法代码示例。如果您正苦于以下问题:Java GeometryGraph.computeSelfNodes方法的具体用法?Java GeometryGraph.computeSelfNodes怎么用?Java GeometryGraph.computeSelfNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vividsolutions.jts.geomgraph.GeometryGraph的用法示例。


在下文中一共展示了GeometryGraph.computeSelfNodes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkValid

import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
 * Checks validity of a LinearRing.
 */
private void checkValid(LinearRing g) {
    this.checkInvalidCoordinates(g.getCoordinates());
    if (this.validErr != null) {
        return;
    }
    this.checkClosedRing(g);
    if (this.validErr != null) {
        return;
    }

    GeometryGraph graph = new GeometryGraph(0, g);
    this.checkTooFewPoints(graph);
    if (this.validErr != null) {
        return;
    }
    LineIntersector li = new RobustLineIntersector();
    graph.computeSelfNodes(li, true);
    this.checkNoSelfIntersectingRings(graph);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:23,代码来源:IsValidOp.java

示例2: isSimpleLinearGeometry

import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
private boolean isSimpleLinearGeometry(Geometry geom) {
    if (geom.isEmpty()) {
        return true;
    }
    GeometryGraph graph = new GeometryGraph(0, geom);
    LineIntersector li = new RobustLineIntersector();
    SegmentIntersector si = graph.computeSelfNodes(li, true);
    // if no self-intersection, must be simple
    if (!si.hasIntersection()) {
        return true;
    }
    if (si.hasProperIntersection()) {
        this.nonSimpleLocation = si.getProperIntersectionPoint();
        return false;
    }
    if (this.hasNonEndpointIntersection(graph)) {
        return false;
    }
    if (this.isClosedEndpointsInInterior) {
        if (this.hasClosedEndpointIntersection(graph)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:26,代码来源:IsSimpleOp.java

示例3: isSimpleLinearGeometry

import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
private boolean isSimpleLinearGeometry(Geometry geom) {
    if (geom.isEmpty()) return true;
    GeometryGraph graph = new GeometryGraph(0, geom);
    LineIntersector li = new RobustLineIntersector();
    SegmentIntersector si = graph.computeSelfNodes(li, true);
    // if no self-intersection, must be simple
    if (!si.hasIntersection()) return true;
    if (si.hasProperIntersection()) {
        nonSimpleLocation = si.getProperIntersectionPoint();
        return false;
    }
    if (hasNonEndpointIntersection(graph)) return false;
    if (isClosedEndpointsInInterior) {
        if (hasClosedEndpointIntersection(graph)) return false;
    }
    return true;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:18,代码来源:IsSimpleOp.java

示例4: fullClosedLine

import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
LineString fullClosedLine(List<LineString> lines) {
    List<Coordinate> tail = new ArrayList<>();

    boolean found;
    do {
        found = false;
        for (int i = 0; i < lines.size(); i++) {
            if (addToClosed(tail, lines.get(i))) {
                lines.remove(i);
                i--;
                found = true;
            }
        }
    } while (found);

    LineString s = GeometryHelper.createLine(tail);
    if (!s.isClosed()) {
        throw new RuntimeException("Non-closed line starts from " + tail.get(0) + " ends to "
                + tail.get(tail.size() - 1));
    }
    if (!s.isSimple()) {
        GeometryGraph graph = new GeometryGraph(0, s);
        LineIntersector li = new RobustLineIntersector();
        SegmentIntersector si = graph.computeSelfNodes(li, true);
        if (si.hasProperInteriorIntersection()) {
            throw new RuntimeException("Self-intersection for " + relation.getObjectCode()
                    + " near point " + si.getProperIntersectionPoint());
        }else {
            throw new RuntimeException("Self-intersected line: " + s);
        }
    }
    return s;
}
 
开发者ID:alex73,项目名称:OSMemory,代码行数:34,代码来源:ExtendedRelation.java

示例5: checkValid

import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
 * Checks validity of a LinearRing.
 */
private void checkValid(LinearRing g) {
    checkInvalidCoordinates(g.getCoordinates());
    if (validErr != null) return;
    checkClosedRing(g);
    if (validErr != null) return;

    GeometryGraph graph = new GeometryGraph(0, g);
    checkTooFewPoints(graph);
    if (validErr != null) return;
    LineIntersector li = new RobustLineIntersector();
    graph.computeSelfNodes(li, true);
    checkNoSelfIntersectingRings(graph);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:17,代码来源:IsValidOp.java

示例6: isInteriorDisconnected

import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
public Expression<K, C, Boolean> isInteriorDisconnected() {
	return new AbstractUnaryTestExpression<K, C, T>(this, "IsInteriorDisconnected") {
		@Override
		public boolean test(T value, C context) {
			if (!(value instanceof Surface)) {
				return false;
			}

			try {
				final GeometryValidator validator = context.validateGeometry(value).validator;
				final Surface polygon = (Surface) value;
				final Ring exterior = new DefaultLinearRing("exterior", null, null, polygon
						.getExteriorRingCoordinates());

				final GeometryFactory geometryFactory = new GeometryFactory();

				final LinearRing exteriorRing = getJTSRing(exterior, validator);
				final ArrayList<LinearRing> interiorRings = new ArrayList<>();
				for (final Points points : polygon.getInteriorRingsCoordinates()) {
					final Ring ring = new DefaultLinearRing("interior", null, null, points);
					interiorRings.add(getJTSRing(ring, validator));
				}

				com.vividsolutions.jts.geom.Polygon jtsPolygon = geometryFactory.createPolygon(exteriorRing,
						interiorRings.toArray(new LinearRing[interiorRings.size()]));

				final GeometryGraph geometryGraph = new GeometryGraph(0, jtsPolygon);
				geometryGraph.computeSelfNodes(new RobustLineIntersector(), true);

				ConnectedInteriorTester connectedInteriorTester = new ConnectedInteriorTester(geometryGraph);

				return !connectedInteriorTester.isInteriorsConnected();
			} catch (InvocationTargetException | IllegalArgumentException | IllegalAccessException e) {
				throw new ExpressionEvaluationException(e);
			}
		}
	};
}
 
开发者ID:CDS-INSPIRE,项目名称:InSpider,代码行数:39,代码来源:GeometryExpression.java


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