Search in sources :

Example 1 with BBoxClientInfo

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;
}
Also used : BBoxClientInfo(org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo) GPRasterLayerGrid(org.geosdi.geoplatform.gui.model.server.GPRasterLayerGrid) GPAttributionLogoURLBean(org.geosdi.geoplatform.gui.model.logo.GPAttributionLogoURLBean) GPStyleStringBeanModel(org.geosdi.geoplatform.gui.model.tree.GPStyleStringBeanModel) GPTemporalExtentBean(org.geosdi.geoplatform.gui.model.temporal.extent.GPTemporalExtentBean) GPTemporalDimensionBean(org.geosdi.geoplatform.gui.model.temporal.dimension.GPTemporalDimensionBean) GPTemporalExtent(org.geosdi.geoplatform.core.model.temporal.extent.GPTemporalExtent) ArrayList(java.util.ArrayList) GPTemporalDimension(org.geosdi.geoplatform.core.model.temporal.dimension.GPTemporalDimension)

Example 2 with BBoxClientInfo

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);
}
Also used : BBoxClientInfo(org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo) VectorFeature(org.gwtopenmaps.openlayers.client.feature.VectorFeature) MultiPolygon(org.gwtopenmaps.openlayers.client.geometry.MultiPolygon) Bounds(org.gwtopenmaps.openlayers.client.Bounds) Projection(org.gwtopenmaps.openlayers.client.Projection)

Example 3 with BBoxClientInfo

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;
}
Also used : BBoxClientInfo(org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo) GPClientViewport(org.geosdi.geoplatform.gui.configuration.map.client.GPClientViewport)

Example 4 with BBoxClientInfo

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;
}
Also used : BBoxClientInfo(org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo)

Example 5 with BBoxClientInfo

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;
}
Also used : BBoxClientInfo(org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo) GPRasterLayerGrid(org.geosdi.geoplatform.gui.model.server.GPRasterLayerGrid) GPStyleStringBeanModel(org.geosdi.geoplatform.gui.model.tree.GPStyleStringBeanModel) ArrayList(java.util.ArrayList) GPRasterBean(org.geosdi.geoplatform.gui.model.GPRasterBean)

Aggregations

BBoxClientInfo (org.geosdi.geoplatform.gui.configuration.map.client.geometry.BBoxClientInfo)19 Bounds (org.gwtopenmaps.openlayers.client.Bounds)10 Projection (org.gwtopenmaps.openlayers.client.Projection)9 GPClientViewport (org.geosdi.geoplatform.gui.configuration.map.client.GPClientViewport)6 GPBBox (org.geosdi.geoplatform.core.model.GPBBox)3 ArrayList (java.util.ArrayList)2 GPViewport (org.geosdi.geoplatform.core.model.GPViewport)2 GPRasterLayerGrid (org.geosdi.geoplatform.gui.model.server.GPRasterLayerGrid)2 GPStyleStringBeanModel (org.geosdi.geoplatform.gui.model.tree.GPStyleStringBeanModel)2 WMS (org.gwtopenmaps.openlayers.client.layer.WMS)2 WMSOptions (org.gwtopenmaps.openlayers.client.layer.WMSOptions)2 WMSParams (org.gwtopenmaps.openlayers.client.layer.WMSParams)2 GPMessage (org.geosdi.geoplatform.core.model.GPMessage)1 GPUser (org.geosdi.geoplatform.core.model.GPUser)1 GPTemporalDimension (org.geosdi.geoplatform.core.model.temporal.dimension.GPTemporalDimension)1 GPTemporalExtent (org.geosdi.geoplatform.core.model.temporal.extent.GPTemporalExtent)1 RasterTreeNode (org.geosdi.geoplatform.gui.client.model.RasterTreeNode)1 GPLoginUserDetail (org.geosdi.geoplatform.gui.client.model.security.GPLoginUserDetail)1 IGPAccountDetail (org.geosdi.geoplatform.gui.global.security.IGPAccountDetail)1 GPClientMessage (org.geosdi.geoplatform.gui.impl.message.GPClientMessage)1