本文整理了Java中org.locationtech.jts.geom.Point.buffer()
方法的一些代码示例,展示了Point.buffer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.buffer()
方法的具体详情如下:
包路径:org.locationtech.jts.geom.Point
类名称:Point
方法名:buffer
暂无
代码示例来源:origin: geotools/geotools
public Geometry buffer(double distance) {
return point.buffer(distance);
}
代码示例来源:origin: geotools/geotools
public Geometry buffer(double distance, int quadrantSegments, int endCapStyle) {
return point.buffer(distance, quadrantSegments, endCapStyle);
}
代码示例来源:origin: geotools/geotools
public Geometry buffer(double distance, int quadrantSegments) {
return point.buffer(distance, quadrantSegments);
}
代码示例来源:origin: geotools/geotools
@Override
public Polygon getBuffer(double distance) {
// convert to the target unit
distance = converter.convert(distance);
// buffer and return
return (Polygon) center.buffer(distance, quadrantSegments);
}
}
代码示例来源:origin: geotools/geotools
private LineString circleArcInBounds(
double x, double y, double radius, ReferencedEnvelope bounds) {
Point center = gf.createPoint(new Coordinate(x, y));
Polygon buffered = (Polygon) center.buffer(radius, 64);
Polygon mask = JTS.toGeometry(bounds);
Geometry intersection = buffered.getExteriorRing().intersection(mask);
return (LineString) intersection;
}
代码示例来源:origin: geotools/geotools
@Test
public void testFullyOutsideCircle() throws Exception {
Point p = (Point) wkt.read("POINT(5 5)");
LineString ls = ((Polygon) p.buffer(10)).getExteriorRing();
Geometry clipped = clipper.clip(ls, false);
assertNull(clipped);
showResult("Circle around", ls, clipped);
}
代码示例来源:origin: geotools/geotools
@Test
public void testCrossingCircle() throws Exception {
Point p = (Point) wkt.read("POINT(5 5)");
LineString ls = ((Polygon) p.buffer(6)).getExteriorRing();
MultiLineString clipped = (MultiLineString) clipper.clip(ls, false);
assertEquals(4, clipped.getNumGeometries());
showResult("Circle around", ls, clipped);
}
代码示例来源:origin: locationtech/jts
Geometry ptBuf = line.getPointN(i).buffer(dist);
parts.add(ptBuf);
代码示例来源:origin: locationtech/jts
/**
* Gets a geometry which represents the Minimum Bounding Circle.
* If the input is degenerate (empty or a single unique point),
* this method will return an empty geometry or a single Point geometry.
* Otherwise, a Polygon will be returned which approximates the
* Minimum Bounding Circle.
* (Note that because the computed polygon is only an approximation,
* it may not precisely contain all the input points.)
*
* @return a Geometry representing the Minimum Bounding Circle.
*/
public Geometry getCircle()
{
//TODO: ensure the output circle contains the extermal points.
//TODO: or maybe even ensure that the returned geometry contains ALL the input points?
compute();
if (centre == null)
return input.getFactory().createPolygon();
Point centrePoint = input.getFactory().createPoint(centre);
if (radius == 0.0)
return centrePoint;
return centrePoint.buffer(radius);
}
代码示例来源:origin: locationtech/jts
private Coordinate[] createTestPoints(int nPts)
{
Point pt = geomFact.createPoint(new Coordinate(baseX, baseY));
Geometry circle = pt.buffer(2 * rectSize, nPts/4);
return circle.getCoordinates();
}
代码示例来源:origin: locationtech/jts
private Coordinate[] createTestPoints(int nPts)
{
Point pt = geomFact.createPoint(new Coordinate(baseX, baseY));
Geometry circle = pt.buffer(2 * rectSize, nPts/4);
return circle.getCoordinates();
}
代码示例来源:origin: geosolutions-it/jai-ext
@Test
public void testCircles() throws Exception {
if (isOSX) {
System.out.println("skipping testCircles on OSX");
} else {
final int buffers[] = new int[]{3, 5, 7, 8, 10, 15, 20};
for (int i = 0; i < buffers.length; i++) {
Point p = new GeometryFactory().createPoint(new Coordinate(10, 10));
Geometry buffer = p.buffer(buffers[i]);
ROIGeometry g = new ROIGeometry(buffer);
ROIShape shape = getEquivalentROIShape(g);
assertROIEquivalent(g, shape, "Circle");
}
}
}
代码示例来源:origin: geosolutions-it/jai-ext
@Test
public void testXor() throws Exception {
if (isOSX) {
System.out.println("skipping testXor on OSX");
} else {
Point p1 = new GeometryFactory().createPoint(new Coordinate(10, 10));
Point p2 = new GeometryFactory().createPoint(new Coordinate(20, 10));
Geometry buffer1 = p1.buffer(15);
Geometry buffer2 = p2.buffer(15);
ROIGeometry rg1 = new ROIGeometry(buffer1);
ROIGeometry rg2 = new ROIGeometry(buffer2);
ROI rgXor = rg1.exclusiveOr(rg2);
ROIShape rs1 = getEquivalentROIShape(rg1);
ROIShape rs2 = getEquivalentROIShape(rg2);
ROI rsXor = rs1.exclusiveOr(rs2);
assertROIEquivalent(rgXor, rsXor, "Xor");
}
}
代码示例来源:origin: geosolutions-it/jai-ext
@Test
@Ignore("not working on any platform ?")
public void testUnion() throws Exception {
Point p1 = new GeometryFactory().createPoint(new Coordinate(10, 10));
Point p2 = new GeometryFactory().createPoint(new Coordinate(20, 10));
Geometry buffer1 = p1.buffer(15);
Geometry buffer2 = p2.buffer(15);
ROIGeometry rg1 = new ROIGeometry(buffer1);
ROIGeometry rg2 = new ROIGeometry(buffer2);
ROIShape rs1 = getEquivalentROIShape(rg1);
ROIShape rs2 = getEquivalentROIShape(rg2);
assertROIEquivalent(rg1, rs1, "circle 1 ROIG, circle 1 ROIS");
assertROIEquivalent(rg2, rs2, "circle 2 ROIG, circle 2 ROIS");
}
代码示例来源:origin: geosolutions-it/jai-ext
@Test
public void testSubtract() throws Exception {
Point p1 = new GeometryFactory().createPoint(new Coordinate(10, 10));
Point p2 = new GeometryFactory().createPoint(new Coordinate(20, 10));
Geometry buffer1 = p1.buffer(15);
Geometry buffer2 = p2.buffer(15);
ROIGeometry rg1 = new ROIGeometry(buffer1);
ROIGeometry rg2 = new ROIGeometry(buffer2);
ROI rgSubtract = rg1.subtract(rg2);
ROIShape rs1 = getEquivalentROIShape(rg1);
ROIShape rs2 = getEquivalentROIShape(rg2);
ROI rsSubtract = rs1.subtract(rs2);
assertROIEquivalent(rgSubtract, rsSubtract, "Subtract");
}
代码示例来源:origin: geosolutions-it/jai-ext
@Test
@Ignore("not working on any platform ?")
public void testIntersect() throws Exception {
Point p1 = new GeometryFactory().createPoint(new Coordinate(10, 10));
Point p2 = new GeometryFactory().createPoint(new Coordinate(20, 10));
Geometry buffer1 = p1.buffer(15);
Geometry buffer2 = p2.buffer(15);
ROIGeometry rg1 = new ROIGeometry(buffer1);
ROIGeometry rg2 = new ROIGeometry(buffer2);
ROI rgIntersection = rg1.intersect(rg2);
ROIShape rs1 = getEquivalentROIShape(rg1);
ROIShape rs2 = getEquivalentROIShape(rg2);
ROI rsIntersection = rs1.intersect(rs2);
assertROIEquivalent(rgIntersection, rsIntersection, "Intersection");
}
内容来源于网络,如有侵权,请联系作者删除!