BBOX from published layer

This commit is contained in:
Fabio Sinibaldi 2022-10-18 18:21:39 +02:00
parent f7101e98a4
commit 0c20baab35
2 changed files with 11 additions and 2 deletions

View File

@ -2,6 +2,8 @@ package org.gcube.application.cms.sdi.engine;
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher;
import it.geosolutions.geoserver.rest.GeoServerRESTReader;
import it.geosolutions.geoserver.rest.decoder.RESTFeatureType;
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder;
import lombok.extern.slf4j.Slf4j;
@ -168,8 +170,11 @@ public class SDIManagerWrapper extends SDIManager{
throw new SDIInteractionException("Unable to publish layer " + toSetLayerName + " under " + workspace + ". Unknown Geoserver fault.");
}
// RESTLayer l = gsReader.getLayer(workspace, toSetLayerName);
// RESTFeatureType f = gsReader.getFeatureType(l);
RESTLayer l = gsReader.getLayer(workspace, toSetLayerName);
RESTFeatureType f = gsReader.getFeatureType(l);
layerBuilder.setBBOX(f.getMaxX(),f.getMinX(),f.getMaxY(),f.getMinY(),0d,0d);
GCubeSDILayer materialization = layerBuilder.getLayer();

View File

@ -117,5 +117,9 @@ public class GCubeSDILayerBuilder {
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@ BBOX
public GCubeSDILayerBuilder setBBOX(Double maxX, Double minX, Double maxY, Double minY, Double maxZ, Double minZ){
bbox=new GCubeSDILayer.BBOX(maxX,minX,maxY,minY,maxZ,minZ);
return this;
}
}