美文网首页
两条线线创建多边形,数组合并拷贝

两条线线创建多边形,数组合并拷贝

作者: hehehehe | 来源:发表于2020-08-19 16:38 被阅读0次
    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);
    
    

    相关文章

      网友评论

          本文标题:两条线线创建多边形,数组合并拷贝

          本文链接:https://www.haomeiwen.com/subject/hqhdjktx.html