Geometry intersection = seg2.intersection(seg); Point p = null; if (intersection.isEmpty()) {
if (!polygon.intersects(startPoint)) continue; Geometry lineParts = line.intersection(polygon); if (lineParts.getLength() > 0.000001) { Coordinate edgeCoordinate = null;
.intersects(startPoint))) continue; Geometry lineParts = line.intersection(polygon); if (lineParts.getLength() > 0.000001) { Coordinate edgeCoordinate = null;
/** * Finds a reasonable point at which to label a Geometry. * @param geometry the geometry to analyze */ public void addPolygon(Geometry geometry) { LineString bisector = horizontalBisector(geometry); Geometry intersections = bisector.intersection(geometry); Geometry widestIntersection = widestGeometry(intersections); double width = widestIntersection.getEnvelopeInternal().getWidth(); if (interiorPoint == null || width > maxWidth) { interiorPoint = centre(widestIntersection.getEnvelopeInternal()); maxWidth = width; } }
public Geometry intersection(Geometry other) { return lineString.intersection(other); }
.createLineString(coordinateArrayC); static Geometry geometryAB = lineStringA.intersection(lineStringB); static Geometry geometryAC = lineStringA.intersection(lineStringC); static Geometry geometryBC = lineStringB.intersection(lineStringC);
Geometry intersection = l.intersection(factory.createLineString(new Coordinate[]{new Coordinate(x, bbox.getMinY()), new Coordinate(x, bbox.getMaxY())})); if(intersection.getNumGeometries() == 1) { LineString[] pair = GeometryUtils.split(l, intersection.getGeometryN(0).getCentroid().getCoordinate(), false); Geometry intersection = l.intersection(p); for(int i = 0; i < intersection.getNumGeometries(); i++) { Geometry geometryN = intersection.getGeometryN(i);
Geometry intersections = source.intersection(neighbor);
private LineString voronoiSide(int idgeom, int side,GeometryFactory geometryFactory, Coordinate circumcenter) { boolean triangleCCW = isCCW(idgeom); // Create linestring to envelope LineSegment sideGeom = getTriangleSegment(idgeom, side); Vector2D direction = new Vector2D(sideGeom.p0, sideGeom.p1); direction = direction.normalize().rotate(triangleCCW ? - Math.PI / 2 : Math.PI / 2).multiply(envelope.maxExtent()); LineSegment voronoiLine = new LineSegment(circumcenter, new Coordinate(direction.getX() + circumcenter.x, direction.getY() + circumcenter.y)); Geometry lineString = voronoiLine.toGeometry(geometryFactory).intersection(geometryFactory.toGeometry(envelope)); if(lineString instanceof LineString && lineString.getLength() > epsilon) { return (LineString)lineString; } else { return null; } }
private LineString voronoiSide(int idgeom, int side,GeometryFactory geometryFactory, Coordinate circumcenter) { boolean triangleCCW = isCCW(idgeom); // Create linestring to envelope LineSegment sideGeom = getTriangleSegment(idgeom, side); Vector2D direction = new Vector2D(sideGeom.p0, sideGeom.p1); direction = direction.normalize().rotate(triangleCCW ? - Math.PI / 2 : Math.PI / 2).multiply(envelope.maxExtent()); LineSegment voronoiLine = new LineSegment(circumcenter, new Coordinate(direction.getX() + circumcenter.x, direction.getY() + circumcenter.y)); Geometry lineString = voronoiLine.toGeometry(geometryFactory).intersection(geometryFactory.toGeometry(envelope)); if(lineString instanceof LineString && lineString.getLength() > epsilon) { return (LineString)lineString; } else { return null; } }
List<Point> intersections = extractPoints(part.intersection(multi));
List<Point> intersections = extractPoints(part.intersection(multi));
/** * Finds an interior point of a Polygon. * @param geometry the geometry to analyze */ private void addPolygon(Geometry geometry) { if (geometry.isEmpty()) return; Coordinate intPt; double width = 0; LineString bisector = horizontalBisector(geometry); if (bisector.getLength() == 0.0) { width = 0; intPt = bisector.getCoordinate(); } else { Geometry intersections = bisector.intersection(geometry); Geometry widestIntersection = widestGeometry(intersections); width = widestIntersection.getEnvelopeInternal().getWidth(); intPt = centre(widestIntersection.getEnvelopeInternal()); } if (interiorPoint == null || width > maxWidth) { interiorPoint = intPt; maxWidth = width; } }
Coordinate coordsEnd = coords[1]; if (Math.max(coordsStart.z, coordsEnd.z) > max * j * stepLength){ Geometry ptsIntersect = lineGeoms.intersection(rayStep); if (ptsIntersect instanceof Point && ptsIntersect!=null) { double coordWithZ = CoordinateUtils.interpolate(lineGeoms.getCoordinateN(0), lineGeoms.getCoordinateN(1), ptsIntersect.getCoordinate());
Geometry intersection = edgeGeometry.intersection(g);
Geometry intersection = edgeGeometry.intersection(g);