use of org.geosdi.geoplatform.responce.LayerAttribute in project geo-platform by geosdi.
the class LayerService method describeFeatureType.
@Override
public List<GPLayerAttributes> describeFeatureType(String layerName) throws GeoPlatformException {
List<GPLayerAttributes> attributeList = Lists.<GPLayerAttributes>newArrayList();
try {
List<LayerAttribute> result = this.geoPlatformPublishClient.describeFeatureType(layerName).getLayerAttributes();
for (LayerAttribute layerAttribute : result) {
GPLayerAttributes gpLayerAttributes = new GPLayerAttributes();
gpLayerAttributes.setAttributeType(layerAttribute.getType());
gpLayerAttributes.setAttributeValue(layerAttribute.getValue());
attributeList.add(gpLayerAttributes);
}
} catch (ResourceNotFoundFault rnff) {
throw new GeoPlatformException(rnff.getMessage());
}
return attributeList;
}
use of org.geosdi.geoplatform.responce.LayerAttribute in project geo-platform by geosdi.
the class FilterDescribeFeatureCommand method execute.
@Override
public FilterDescribeFeatureResponse execute(FilterDescribeFeatureRequest request, HttpServletRequest httpServletRequest) {
try {
logger.debug("##################### Executing {} Command", this.getClass().getSimpleName());
List<GPLayerAttributes> attributeList = Lists.newArrayList();
try {
List<LayerAttribute> result = this.geoPlatformPublishClient.describeFeatureType(request.getLayerName()).getLayerAttributes();
for (LayerAttribute layerAttribute : result) {
GPLayerAttributes gpLayerAttributes = new GPLayerAttributes();
gpLayerAttributes.setAttributeType(layerAttribute.getType());
gpLayerAttributes.setAttributeValue(layerAttribute.getValue());
attributeList.add(gpLayerAttributes);
}
} catch (ResourceNotFoundFault rnff) {
throw new GeoPlatformException(rnff.getMessage());
}
logger.debug("#################### Found {} ", attributeList);
return new FilterDescribeFeatureResponse(Lists.<GPLayerAttributes>newArrayList(attributeList));
} catch (Exception ex) {
ex.printStackTrace();
throw new GeoPlatformException(ex.getMessage());
}
}
use of org.geosdi.geoplatform.responce.LayerAttribute in project geo-platform by geosdi.
the class CASFilterDescribeFeatureCommand method execute.
@Override
public FilterDescribeFeatureResponse execute(FilterDescribeFeatureRequest request, HttpServletRequest httpServletRequest) {
logger.debug("##################### Executing {} Command", this.getClass().getSimpleName());
List<GPLayerAttributes> attributeList = Lists.<GPLayerAttributes>newArrayList();
try {
List<LayerAttribute> result = this.casPublisherService.describeFeatureType(request.getLayerName()).getLayerAttributes();
for (LayerAttribute layerAttribute : result) {
GPLayerAttributes gpLayerAttributes = new GPLayerAttributes();
gpLayerAttributes.setAttributeType(layerAttribute.getType());
gpLayerAttributes.setAttributeValue(layerAttribute.getValue());
attributeList.add(gpLayerAttributes);
}
} catch (ResourceNotFoundFault rnff) {
throw new GeoPlatformException(rnff.getMessage());
}
logger.debug("#################### Found {} ", attributeList);
return new FilterDescribeFeatureResponse(Lists.newArrayList(attributeList));
}
use of org.geosdi.geoplatform.responce.LayerAttribute in project geo-platform by geosdi.
the class GeoserverConnectorFeatureTypesTest method b_readFeatureType.
/*
url: "http://${geoserver_url}/geoserver/rest/workspaces/${workspace_name}/datastores/${store_name}/featuretypes/${layer_name}.json
*/
@Test()
public void b_readFeatureType() throws Exception {
GeoserverLoadFeatureTypeWithUrlRequest geoserverLoadFeatureTypeWithUrlRequest = this.geoserverConnectorStore.loadFeatureTypeWithUrl().withUrl("http://150.145.141.180/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.json");
GPGeoserverFeatureTypeInfo gpGeoserverFeatureTypeInfo = geoserverLoadFeatureTypeWithUrlRequest.getResponse();
logger.info("########################ATTRIBUTES {}\n", gpGeoserverFeatureTypeInfo.getAttributes());
List<LayerAttribute> result = gpGeoserverFeatureTypeInfo.getAttributes().getValues().stream().map(att -> new LayerAttribute(att.getName(), att.getBinding())).collect(Collectors.toList());
logger.info("########################RESULT {}\n", result);
}
Aggregations