@Override public List<RasterCapabilitiesInfo> getRasterCapabilities(Map<String, String> connectionProperties) throws Exception { URL url = new URL(connectionProperties.get(GetWmsCapabilitiesRequest.GET_CAPABILITIES_URL)); SimpleHttpClient httpClient = new SimpleHttpClient(); if (connectionProperties.containsKey(WmsLayerBeanFactory.WMS_USERNAME)) { httpClient.setUser(connectionProperties.get(WmsLayerBeanFactory.WMS_USERNAME)); httpClient.setPassword(connectionProperties.get(WmsLayerBeanFactory.WMS_PASSWORD)); } WebMapServer wms = new WebMapServer(url, httpClient); WMSCapabilities capabilities = wms.getCapabilities(); List<RasterCapabilitiesInfo> layers = new ArrayList<RasterCapabilitiesInfo>(); List<RasterCapabilitiesInfo> nonNativeLayers = new ArrayList<RasterCapabilitiesInfo>(); for (org.geotools.data.ows.Layer owsLayer : WMSUtils.getNamedLayers(capabilities)) { if (owsLayer.getSrs().contains(defaultGeodesk.getMaps().get(0).getCrs())) { // Only add default crs layers.add(dtoFactoryService.buildRasterCapabilitesInfoFromWms(wms, owsLayer, defaultGeodesk.getMaps().get(0).getCrs())); } else { // Add all available crs-es for (String srs : owsLayer.getSrs()) { try { nonNativeLayers.add(dtoFactoryService.buildRasterCapabilitesInfoFromWms(wms, owsLayer, srs)); } catch (LayerException e) { log.warn("Got unknown crs from wms server, ignoring: {}", srs); } } } } layers.addAll(nonNativeLayers); return layers; }
@Override public List<RasterCapabilitiesInfo> getRasterCapabilities(Map<String, String> connectionProperties) throws Exception { URL url = new URL(connectionProperties.get(GetWmsCapabilitiesRequest.GET_CAPABILITIES_URL)); SimpleHttpClient httpClient = new SimpleHttpClient(); if (connectionProperties.containsKey(WmsLayerBeanFactory.WMS_USERNAME)) { httpClient.setUser(connectionProperties.get(WmsLayerBeanFactory.WMS_USERNAME)); httpClient.setPassword(connectionProperties.get(WmsLayerBeanFactory.WMS_PASSWORD)); } WebMapServer wms = new WebMapServer(url, httpClient); WMSCapabilities capabilities = wms.getCapabilities(); List<RasterCapabilitiesInfo> layers = new ArrayList<RasterCapabilitiesInfo>(); List<RasterCapabilitiesInfo> nonNativeLayers = new ArrayList<RasterCapabilitiesInfo>(); for (org.geotools.data.ows.Layer owsLayer : WMSUtils.getNamedLayers(capabilities)) { if (owsLayer.getSrs().contains(defaultGeodesk.getMaps().get(0).getCrs())) { // Only add default crs layers.add(dtoFactoryService.buildRasterCapabilitesInfoFromWms(wms, owsLayer, defaultGeodesk.getMaps().get(0).getCrs())); } else { // Add all available crs-es for (String srs : owsLayer.getSrs()) { try { nonNativeLayers.add(dtoFactoryService.buildRasterCapabilitesInfoFromWms(wms, owsLayer, srs)); } catch (LayerException e) { LOG.warn("Got unknown crs from wms server, ignoring: {}", srs); } } } } layers.addAll(nonNativeLayers); return layers; }
public void execute(GetWmsCapabilitiesRequest request, GetWmsCapabilitiesResponse response) throws Exception { response.setRasterCapabilities(discoServ.getRasterCapabilities(request.getConnectionProperties())); response.setDefaultCrs(defaultGeodesk.getMaps().get(0).getCrs()); }
public void execute(GetWmsCapabilitiesRequest request, GetWmsCapabilitiesResponse response) throws Exception { response.setRasterCapabilities(discoServ.getRasterCapabilities(request.getConnectionProperties())); response.setDefaultCrs(defaultGeodesk.getMaps().get(0).getCrs()); }
Crs crs; try { crs = geoService.getCrs2(map.getCrs()); unit = crs.getCoordinateSystem().getAxis(0).getUnit().toString(); if (UnitType.ENGLISH == displayUnitType || UnitType.ENGLISH_FOOT == displayUnitType) {
tiles = rasterLayerService.getTiles(getLayerId(), geoService.getCrs2(map.getCrs()), bbox, rasterScale); if (tiles.size() > 0) { Collection<Callable<ImageResult>> callables = new ArrayList<Callable<ImageResult>>(tiles.size());
"shapefile.")); CoordinateReferenceSystem targetCrs = geoService.getCrs2(defaultGeodesk.getMaps().get(0).getCrs());
"shapefile.")); CoordinateReferenceSystem targetCrs = geoService.getCrs2(defaultGeodesk.getMaps().get(0).getCrs());
vli.setCrs(sft.getCoordinateReferenceSystem().getIdentifiers().iterator().next().toString()); } else { vli.setCrs(defaultGeodesk.getMaps().get(0).getCrs());
vli.setCrs(sft.getCoordinateReferenceSystem().getIdentifiers().iterator().next().toString()); } else { vli.setCrs(defaultGeodesk.getMaps().get(0).getCrs());
@Override public void initialize(ClientMapInfo mapInfo, MapEventBus eventBus) { this.mapInfo = mapInfo; this.eventBus = eventBus; crs = mapInfo.getCrs(); // Calculate maximum bounds: maxBounds = new Bbox(mapInfo.getMaxBounds().getX(), mapInfo.getMaxBounds().getY(), mapInfo.getMaxBounds() .getWidth(), mapInfo.getMaxBounds().getHeight()); // if the max bounds was not configured, take the union of initial and layer bounds if (BboxService.equals(maxBounds, Bbox.ALL, 1e-10)) { maxBounds = new Bbox(mapInfo.getInitialBounds().getX(), mapInfo.getInitialBounds().getY(), mapInfo .getInitialBounds().getWidth(), mapInfo.getInitialBounds().getHeight()); if (mapInfo.getLayers() != null && mapInfo.getLayers().size() > 0) { for (ClientLayerInfo layerInfo : mapInfo.getLayers()) { if (layerInfo.getMaxExtent() != null) { maxBounds = BboxService.union(maxBounds, layerInfo.getMaxExtent()); } } } } // Set the best zoom strategy given the map info: if (mapInfo.getScaleConfiguration().getZoomLevels() != null && mapInfo.getScaleConfiguration().getZoomLevels().size() > 0) { zoomStrategy = new FixedStepZoomStrategy(mapInfo, maxBounds); } else { zoomStrategy = new FreeForAllZoomStrategy(mapInfo, maxBounds); } zoomStrategy.setMapSize(mapWidth, mapHeight); initialized = true; }
if (layerId.equals(clientLayerInfo.getServerLayerId())) { List<InternalFeature> features = vectorLayerService.getFeatures(layerId, geoService.getCrs2(clientMapInfo.getCrs()), getFilter(request.getFilter(), request.getFeatureIds()), null, VectorLayerService.FEATURE_INCLUDE_ALL);