/** * Given a request and a target format, builds the WMS request * * @param request * @param string */ public String getWmsLink() { GetMapRequest request = getRequest(); final Envelope bbox = request.getBbox(); if (bbox == null) return null; Map<String, String> params = new LinkedHashMap<>(); params.put("service", "WMS"); params.put("version", "1.1.0"); params.put("request", "GetMap"); params.put("layers", getName()); String bboxValue = bbox.getMinX() + "," + bbox.getMinY() + "," + bbox.getMaxX() + "," + bbox.getMaxY(); params.put("bbox", bboxValue); params.put("width", String.valueOf(request.getWidth())); params.put("height", String.valueOf(request.getHeight())); params.put("srs", String.valueOf(request.getSRS())); return ResponseUtils.buildURL(getBaseURL(), getPath("wms", false), params, URLType.SERVICE); }
String srs = request.getSRS(); int epsgId = Integer.parseInt(srs.substring(srs.indexOf(':') + 1)); SRS srs2 = SRS.getSRS(epsgId);
params.put("srs", req.getSRS());
axisFlip = true; String srs = request.getSRS(); epsgId = Integer.parseInt(srs.substring(srs.lastIndexOf(':') + 1)); SRS srs2 = SRS.getSRS(epsgId);
String epsgCode = getMap.getSRS(); epsgCode = WMS.toInternalSRS(epsgCode, WMS.version(getMap.getVersion())); getMap.setSRS(epsgCode);
public static void setupEnvironmentVariables(WMSMapContent mapContent) { // setup some SLD variable substitution environment used by rendering transformations EnvFunction.setLocalValue("wms_bbox", mapContent.getRenderingArea()); EnvFunction.setLocalValue( "wms_crs", mapContent.getRenderingArea().getCoordinateReferenceSystem()); EnvFunction.setLocalValue("wms_srs", mapContent.getRequest().getSRS()); EnvFunction.setLocalValue("wms_width", mapContent.getMapWidth()); EnvFunction.setLocalValue("wms_height", mapContent.getMapHeight()); try { double scaleDenominator = mapContent.getScaleDenominator(true); EnvFunction.setLocalValue("wms_scale_denominator", scaleDenominator); } catch (Exception e) { LOGGER.log( Level.SEVERE, "Failed to compute the scale denominator, wms_scale_denominator env variable is unset", e); } } }
String reqSRS = getMap.getSRS();
assertEquals(10d, request.getBbox().getMaxY(), 0); assertEquals("epsg:3003", request.getSRS());
String srs = request.getSRS(); Envelope bbox = request.getBbox(); String format = request.getFormat();
String srs = request.getSRS(); Envelope bbox = request.getBbox(); String format = request.getFormat();
String srs = request.getSRS(); Envelope bbox = request.getBbox(); String format = request.getFormat();