两条线线创建多边形,数组合并拷贝
2020-08-19 本文已影响0人
hehehehe
Map<Long, List<AdLane>> roadLanesMap = adLanesGroup.stream()
.collect(Collectors.groupingBy(AdLane::getROAD_ID));
Coordinate[] leftCoordinates = rDivGeom.getCoordinates();
Coordinate[] rightCoordinates = lDivGeom.getCoordinates();
Coordinate[] coordinates = new Coordinate[leftCoordinates.length + rightCoordinates.length + 1];
System.arraycopy(leftCoordinates, 0, coordinates, 0, leftCoordinates.length);
System.arraycopy(rightCoordinates, 0, coordinates, leftCoordinates.length, rightCoordinates.length);
System.arraycopy(leftCoordinates, 0, coordinates, leftCoordinates.length + rightCoordinates.length, 1);
Polygon polygon = GeoUtils.polygonFromCoordinates(coordinates);
polygons.add(polygon);