| | |
| | | @Value("${shujian.url}") |
| | | String sjUrl; |
| | | |
| | | @Value("${shujian.ctUrl}") |
| | | String ctUrl; |
| | | |
| | | @Value("${shujian.path}") |
| | | String sjPath; |
| | | |
| | |
| | | */ |
| | | public void selectSjColorTables(Integer pageSize, Integer pageIndex, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | String url = String.format(COLOR_TABLE, sjUrl, ak, pageSize, pageIndex); |
| | | String url = String.format(COLOR_TABLE, ctUrl, ak, pageSize, pageIndex); |
| | | |
| | | HttpHelper httpHelper = new HttpHelper(); |
| | | httpHelper.service(req, res, null, url); |
| | |
| | | layer.setProjection(getEpsg(pub)); |
| | | layer.setType(TYPES.indexOf(pub.getType())); |
| | | layer.setEnhance_type(pub.getEnhanceType()); |
| | | layer.setEnhance_factor(pub.getEnhanceFactor()); |
| | | layer.setNodata(getNoData(pub, metas)); |
| | | layer.setConfig(getColorTableConfig(entity, pub)); |
| | | |
| | | CreateLayerEntity.ImagePathList imagePathList = entity.new ImagePathList(); |
| | | imagePathList.setPath(sjPath); |
| | |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取颜色表的配置 |
| | | */ |
| | | private CreateLayerEntity.Config getColorTableConfig(CreateLayerEntity entity, PubEntity pub) { |
| | | if (null == pub.getColorTable() && null == pub.getGradientColorTable()) { |
| | | return null; |
| | | } |
| | | |
| | | Integer type = null != pub.getColorTable() ? 0 : 1; |
| | | List<?> levels = null != pub.getColorTable() ? pub.getColorTable() : pub.getGradientColorTable(); |
| | | |
| | | return entity.new Config(type, levels); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | entity.setLayerid(layerId); |
| | | entity.setServiceid(serviceId); |
| | | entity.setEventid(pub.getUuid()); |
| | | entity.setUpdateUser(pub.getUserId()); |
| | | entity.setUrl(String.format(TYPES.get(0).equals(pub.getType()) ? DOM_FORMAT : DEM_FORMAT, sjUrl, serviceId, StaticData.I0)); |
| | | if (StringHelper.isEmpty(entity.getGeom())) { |
| | | entity.setGeom(StaticData.NULL); |
| | | } |
| | |
| | | resEntity = createResEntity(entity); |
| | | return resService.insert(resEntity); |
| | | } else { |
| | | resEntity.setUpdateUser(pub.getUserId()); |
| | | resEntity.setCnName(entity.getName()); |
| | | resEntity.setUrl(entity.getUrl()); |
| | | return resService.update(resEntity); |
| | |
| | | if (null == pub.getEpsg() || 0 == pub.getEpsg()) { |
| | | pub.setEpsg(entity.getEpsg()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |