use of org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo in project geo-platform by geosdi.
the class DTOServerConverter method convertToRasterLayerGrid.
/**
* @param layer
* @return {@link GPRasterLayerGrid}
*/
private GPRasterLayerGrid convertToRasterLayerGrid(RasterLayerDTO layer) {
GPRasterLayerGrid raster = new GPRasterLayerGrid();
raster.setLabel(layer.getTitle());
raster.setTitle(layer.getTitle());
raster.setAlias(layer.getAlias());
raster.setName(layer.getName());
raster.setAbstractText(layer.getAbstractText());
raster.setLayerType(WMS);
raster.setDataSource(layer.getUrlServer());
if (layer.getBbox() != null) {
raster.setBbox(new BBoxClientInfo(layer.getBbox().getMinX(), layer.getBbox().getMinY(), layer.getBbox().getMaxX(), layer.getBbox().getMaxY()));
raster.setCrs(layer.getSrs());
}
raster.setMaxScale(layer.getMaxScale());
raster.setMinScale(layer.getMinScale());
if (layer.isTemporalLayer()) {
logger.debug("##############Trying to read Temporal Information.");
GPTemporalDimension dimension = layer.getTemporalLayer().getDimension();
if (dimension != null) {
GPTemporalDimensionBean dimensionBean = new GPTemporalDimensionBean();
dimensionBean.setName(dimension.getName());
dimensionBean.setUnits(dimension.getUnits());
raster.setDimension(dimensionBean);
}
GPTemporalExtent extent = layer.getTemporalLayer().getExtent();
if (extent != null) {
GPTemporalExtentBean extentBean = new GPTemporalExtentBean();
extentBean.setName(extent.getName());
extentBean.setDefaultExtent(extent.getDefaultExtent());
extentBean.setValue(extent.getValue());
raster.setExtent(extentBean);
}
}
if (layer.isSetAttribution()) {
logger.info("##############Trying to read Logo Information.");
GPAttributionLogoURLBean logoURLBean = new GPAttributionLogoURLBean();
logoURLBean.setOnlineResource(layer.getLayerAttribution().getLogoUrl().getOnlineResource());
logoURLBean.setHeight(layer.getLayerAttribution().getLogoUrl().getHeight());
logoURLBean.setWidth(layer.getLayerAttribution().getLogoUrl().getWidth());
logoURLBean.setFormat(layer.getLayerAttribution().getLogoUrl().getFormat());
raster.setLogoURLBean(logoURLBean);
}
ArrayList<GPStyleStringBeanModel> styles = new ArrayList<GPStyleStringBeanModel>();
for (String styleString : layer.getStyleList()) {
GPStyleStringBeanModel style = new GPStyleStringBeanModel();
style.setStyleString(styleString);
styles.add(style);
}
raster.setStyles(styles);
return raster;
}
use of org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo in project geo-platform by geosdi.
the class MapControlManager method drawFeatureOnMap.
/**
* Draw Feature on the Map
*
* @param wkt
*/
public void drawFeatureOnMap(String wkt) {
MultiPolygon geom = MultiPolygon.narrowToMultiPolygon(Geometry.fromWKT(wkt).getJSObject());
geom.transform(new Projection(WGS_84.getCode()), new Projection(GOOGLE_MERCATOR.getCode()));
VectorFeature vectorFeature = new VectorFeature(geom);
this.vector.addFeature(vectorFeature);
this.map.zoomToExtent(geom.getBounds());
Projection projection = new Projection(WGS_84.getCode());
Projection mapProjection = new Projection(map.getProjection());
Bounds mapBounds = this.map.getExtent().transform(mapProjection, projection);
BBoxClientInfo bbox = ViewportUtility.generateBBOXFromBounds(mapBounds);
}
use of org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo in project geo-platform by geosdi.
the class SaveViewportAction method isStoreModelCorrect.
private boolean isStoreModelCorrect() {
boolean check = true;
BBoxClientInfo bbox;
for (GPClientViewport viewport : store.getModels()) {
bbox = viewport.getBbox();
System.out.println("BBOXXX: " + bbox.getLowerLeftX());
if (bbox == null || bbox.getLowerLeftX() == 0.0d || bbox.getLowerLeftY() == 0.0d || bbox.getUpperRightX() == 0.0d || bbox.getUpperRightY() == 0.0d || viewport.getName() == null || viewport.getName().isEmpty() || viewport.getZoomLevel() < 0) {
check = false;
break;
}
}
return check;
}
use of org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo in project geo-platform by geosdi.
the class GPCatalogFinderService method convertBBoxDTO.
private BBoxClientInfo convertBBoxDTO(BBox bBox) {
if (bBox == null) {
return null;
}
BBoxClientInfo bBoxClient = new BBoxClientInfo();
bBoxClient.setLowerLeftX(bBox.getMinX());
bBoxClient.setLowerLeftY(bBox.getMinY());
bBoxClient.setUpperRightX(bBox.getMaxX());
bBoxClient.setUpperRightY(bBox.getMaxY());
return bBoxClient;
}
use of org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo in project geo-platform by geosdi.
the class FeatureDemoUI method toppStates.
public GPLayerBean toppStates() {
GPRasterBean layer = new GPRasterLayerGrid();
layer.setDataSource(SCOPE);
layer.setName("topp:states");
layer.setLayerType(GPLayerType.WMS);
layer.setTitle("USA Population");
layer.setAbstractText("This is some census data on the states.");
layer.setCrs("EPSG:4326");
layer.setBbox(new BBoxClientInfo(-124.731422, 24.955967, -66.969849, 49.371735));
ArrayList<GPStyleStringBeanModel> styles = new ArrayList<GPStyleStringBeanModel>(3);
GPStyleStringBeanModel polygonStyle = new GPStyleStringBeanModel();
polygonStyle.setStyleString("polygon");
styles.add(polygonStyle);
GPStyleStringBeanModel pophatchStyle = new GPStyleStringBeanModel();
pophatchStyle.setStyleString("pophatch");
styles.add(pophatchStyle);
GPStyleStringBeanModel populationStyle = new GPStyleStringBeanModel();
populationStyle.setStyleString("population");
styles.add(populationStyle);
layer.setStyles(styles);
return layer;
}
Aggregations