|
|
@ -7,6 +7,7 @@ import org.locationtech.jts.geom.GeometryFactory; |
|
|
|
import org.locationtech.jts.geom.LineString; |
|
|
|
import org.locationtech.jts.geom.LineString; |
|
|
|
import org.locationtech.jts.geom.Point; |
|
|
|
import org.locationtech.jts.geom.Point; |
|
|
|
import org.locationtech.jts.geom.impl.CoordinateArraySequence; |
|
|
|
import org.locationtech.jts.geom.impl.CoordinateArraySequence; |
|
|
|
|
|
|
|
import org.locationtech.jts.operation.buffer.BufferOp; |
|
|
|
import org.locationtech.jts.operation.buffer.BufferParameters; |
|
|
|
import org.locationtech.jts.operation.buffer.BufferParameters; |
|
|
|
import org.locationtech.proj4j.BasicCoordinateTransform; |
|
|
|
import org.locationtech.proj4j.BasicCoordinateTransform; |
|
|
|
import org.locationtech.proj4j.CRSFactory; |
|
|
|
import org.locationtech.proj4j.CRSFactory; |
|
|
@ -21,10 +22,14 @@ public class FlightUtils { |
|
|
|
System.out.println(coord.x + "," + coord.y); |
|
|
|
System.out.println(coord.x + "," + coord.y); |
|
|
|
} |
|
|
|
} |
|
|
|
Geometry geometry = geometryFactory.createGeometry(line); |
|
|
|
Geometry geometry = geometryFactory.createGeometry(line); |
|
|
|
|
|
|
|
int nSegments = 10; |
|
|
|
int cap = BufferParameters.CAP_ROUND; |
|
|
|
int cap = BufferParameters.CAP_ROUND; |
|
|
|
Geometry buffer = geometry.buffer(bufval,20,cap); |
|
|
|
int join = BufferParameters.JOIN_ROUND; |
|
|
|
|
|
|
|
BufferParameters bufferParam = new BufferParameters(nSegments, cap, join, join); |
|
|
|
|
|
|
|
BufferOp ops = new BufferOp(geometry, bufferParam); |
|
|
|
|
|
|
|
Geometry bufTrans = ops.getResultGeometry((bufval/177763.63662580872)*2); |
|
|
|
|
|
|
|
|
|
|
|
Coordinate[] coords = buffer.getCoordinates(); |
|
|
|
Coordinate[] coords = bufTrans.getCoordinates(); |
|
|
|
System.out.println("-------------------------------------"); |
|
|
|
System.out.println("-------------------------------------"); |
|
|
|
for (Coordinate coord : coords) { |
|
|
|
for (Coordinate coord : coords) { |
|
|
|
|
|
|
|
|
|
|
|