| | |
| | | @Value("${shujian.url}") |
| | | String sjUrl; |
| | | |
| | | @Value("${shujian.path}") |
| | | String sjPath; |
| | | |
| | | @Resource |
| | | PathHelper pathHelper; |
| | | |
| | |
| | | layer.setNodata(getNoData(pub, metas)); |
| | | |
| | | CreateLayerEntity.ImagePathList imagePathList = entity.new ImagePathList(); |
| | | imagePathList.setPath(pathHelper.getConfig().getUploadPath()); |
| | | imagePathList.setPath(sjPath); |
| | | entity.getImage_path_list().add(imagePathList); |
| | | |
| | | List<CreateLayerEntity.ImageList> imageLists = entity.getImage_list(); |
| | | for (MetaEntity meta : metas) { |
| | | CreateLayerEntity.ImageList imageList = entity.new ImageList(); |
| | | imageList.setPath(meta.getPath()); |
| | | imageList.setPath(meta.getPath().replace("\\", "/")); |
| | | imageLists.add(imageList); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 获取 nodata |
| | | */ |
| | | private List<String> getNoData(PubEntity pub, List<MetaEntity> metas) { |
| | | private List<Integer> getNoData(PubEntity pub, List<MetaEntity> metas) { |
| | | int bands = 1; |
| | | for (MetaEntity meta : metas) { |
| | | if (StringHelper.isEmpty(meta.getBands())) { |
| | |
| | | } |
| | | } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (int i = 0; i < bands; i++) { |
| | | list.add(String.valueOf(pub.getNodata())); |
| | | list.add(pub.getNodata()); |
| | | } |
| | | |
| | | return list; |
| | |
| | | */ |
| | | public Integer postLayerEntity(CreateLayerEntity layerEntity) { |
| | | Map<String, Object> map = getMapData(layerEntity); |
| | | String url = String.format("%s/sj_raster/v6/api/layer?%s", sjUrl, ak); |
| | | String url = String.format("%s/sj_raster/v6/api/layer?op=create_ex&%s", sjUrl, ak); |
| | | |
| | | LayerResultEntity rs = postForRest(url, map, LayerResultEntity.class); |
| | | boolean flag = null == rs || !StaticData.SUCCESS.equals(rs.getStatus()) || null == rs.getResult().getLayer_id(); |