use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest in project geo-platform by geosdi.
the class GeoserverConnectorLayersTest method f_existLayerInWorkspace.
@Test
public void f_existLayerInWorkspace() throws Exception {
GeoserverLoadWorkspaceLayerRequest geoserverLoadWorkspaceLayerRequest = this.geoserverConnectorStore.loadWorkspaceLayerRequest().withQuietOnNotFound(FALSE).withLayerName("sfdem").withWorkspaceName("sf");
Boolean result = geoserverLoadWorkspaceLayerRequest.exist();
logger.info("################{}\n", result);
GeoserverLayer geoserverLayer = geoserverLoadWorkspaceLayerRequest.getResponse();
logger.info("################{}\n", geoserverLayer);
assertTrue("####################", geoserverLayer.getLayerType() == GeoserverLayerType.Raster);
assertTrue("####################", this.restReader.existsLayer("tiger", "poi", FALSE) == result);
assertTrue("####################", this.restReader.existsLayer("tigerr", "poi", FALSE) == this.geoserverConnectorStore.loadWorkspaceLayerRequest().withQuietOnNotFound(FALSE).withLayerName("poi").withWorkspaceName("tigerr").exist());
}
use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest in project geo-platform by geosdi.
the class GeoserverConnectorLayersTest method m_getFeatureType.
@Test
public void m_getFeatureType() throws Exception {
GeoserverLoadWorkspaceLayerRequest geoserverLoadWorkspaceLayerRequest = this.geoserverConnectorStore.loadWorkspaceLayerRequest().withQuietOnNotFound(FALSE).withLayerName("poi").withWorkspaceName("tiger");
Boolean result = geoserverLoadWorkspaceLayerRequest.exist();
logger.info("################{}\n", result);
GeoserverLayer geoserverLayer = geoserverLoadWorkspaceLayerRequest.getResponse();
logger.info("################{}\n", geoserverLayer);
GPGeoserverFeatureTypeInfo gpGeoserverFeatureTypeInfo = this.geoserverConnectorStore.loadFeatureTypeWithUrl().withUrl(geoserverLayer.getLayerResource().getHref()).getResponse();
RESTLayer restLayer = this.restReader.getLayer("tiger", "poi");
RESTFeatureType featureType = this.restReader.getFeatureType(restLayer);
assertTrue("#################", gpGeoserverFeatureTypeInfo.getNativeBoundingBox().getMaxx() == featureType.getNativeBoundingBox().getMaxX());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getNativeBoundingBox().getMaxy() == featureType.getNativeBoundingBox().getMaxY());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getNativeBoundingBox().getMinx() == featureType.getNativeBoundingBox().getMinX());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getNativeBoundingBox().getMiny() == featureType.getNativeBoundingBox().getMinY());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getNativeBoundingBox().getCrs().equals(featureType.getNativeBoundingBox().getCRS()));
assertTrue("#################", gpGeoserverFeatureTypeInfo.getLatLonBoundingBox().getMaxx() == featureType.getLatLonBoundingBox().getMaxX());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getLatLonBoundingBox().getMaxy() == featureType.getLatLonBoundingBox().getMaxY());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getLatLonBoundingBox().getMinx() == featureType.getLatLonBoundingBox().getMinX());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getLatLonBoundingBox().getMiny() == featureType.getLatLonBoundingBox().getMinY());
assertTrue("#################", gpGeoserverFeatureTypeInfo.getLatLonBoundingBox().getCrs().equals(featureType.getLatLonBoundingBox().getCRS()));
assertTrue("#################", gpGeoserverFeatureTypeInfo.getNativeName().equals(featureType.getNativeName()));
stream(gpGeoserverFeatureTypeInfo.getAttributes().getValues().spliterator(), FALSE).forEach(c -> c.getName());
stream(featureType.getAttributes().spliterator(), FALSE).forEach(c -> System.out.println(c.getName()));
}
use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest in project geo-platform by geosdi.
the class GeoserverConnectorLayersTest method d_getLayerWithWorkspace.
@Test
public void d_getLayerWithWorkspace() throws Exception {
RESTLayer restLayer = this.restReader.getLayer("nurc", "mosaic");
GeoserverLoadWorkspaceLayerRequest geoserverLoadLayerRequest = this.geoserverConnectorStore.loadWorkspaceLayerRequest().withLayerName("mosaic").withWorkspaceName("nurc");
GeoserverLayer geoserverLayer = geoserverLoadLayerRequest.getResponse();
logger.info("##########################RESOURCE_URL_REST_READER {}\n", restLayer.getResourceUrl());
logger.info("##########################RESOURCE_URL_GEOSERVER_CONNECTOR {}\n", geoserverLayer.getLayerResource().getHref());
logger.info("#######################GEOSERVER_LAYER: {}\n", geoserverLayer);
logger.info("#######################REST_READER_DEFAULT_STYLE: {}\n", restLayer.getDefaultStyle());
assertTrue("###################STYLE NAME:", restLayer.getDefaultStyle().equals(geoserverLayer.getDefaultStyle().getName()));
}
use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest in project geo-platform by geosdi.
the class GeoserverConnectorLayersTest method c_getLayerWithWorkspace.
@Test
public void c_getLayerWithWorkspace() throws Exception {
RESTLayer restLayer = this.restReader.getLayer("tiger", "poi");
GeoserverLoadWorkspaceLayerRequest geoserverLoadLayerRequest = this.geoserverConnectorStore.loadWorkspaceLayerRequest().withLayerName("poi").withWorkspaceName("tiger");
GeoserverLayer geoserverLayer = geoserverLoadLayerRequest.getResponse();
logger.info("##########################STYLES_REST_READER {}\n", restLayer.getStyles().getNames());
logger.info("#######################GEOSERVER_LAYER: {}\n", geoserverLayer);
List<String> styleNames = geoserverLoadLayerRequest.getResponse().getLayerStyle().getStyles().stream().map(s -> s.getName()).collect(Collectors.toList());
logger.info("#######################GEOSERVER_STYLE_NAMES: {}\n", styleNames);
assertTrue("###################STYLES_LENGTH", styleNames.size() == restLayer.getStyles().getNames().size());
if (restLayer.getStyles() != null) {
for (String styleName : restLayer.getStyles().getNames()) {
logger.info("#######################STYLE_NAME: {}\n", styleName);
assertTrue("###################STYLE NAME:", styleNames.contains(styleName));
}
}
}
use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest in project geo-platform by geosdi.
the class GPGeoserverLayersConnectorStoreV220XTest method h_loadGeoserverWorkspaceLayerTest.
@Test
public void h_loadGeoserverWorkspaceLayerTest() throws Exception {
GeoserverLoadWorkspaceLayerRequest loadWorkspaceLayerRequest = geoserverConnectorStoreV2_20_x.loadWorkspaceLayerRequest();
loadWorkspaceLayerRequest.withWorkspaceName("tiger").withLayerName("poi");
logger.info("######################LOAD_WORKSPACE_LAYER_RESPONSE : {}\n", loadWorkspaceLayerRequest.getResponse());
}
Aggregations