comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 246:87e92debc53f

Added extent and projection as ows metadata to the mapfile.
author raimund renkert <raimund.renkert@intevation.de>
date Wed, 10 Aug 2011 13:18:53 +0200
parents 2eeeae07aaa2
children 30e10eb9ac68
comparison
equal deleted inserted replaced
245:2eeeae07aaa2 246:87e92debc53f
160 Double.parseDouble(mapNode.getAttribute("extent_min_x")), 160 Double.parseDouble(mapNode.getAttribute("extent_min_x")),
161 Double.parseDouble(mapNode.getAttribute("extent_min_y")), 161 Double.parseDouble(mapNode.getAttribute("extent_min_y")),
162 Double.parseDouble(mapNode.getAttribute("extent_max_x")), 162 Double.parseDouble(mapNode.getAttribute("extent_max_x")),
163 Double.parseDouble(mapNode.getAttribute("extent_max_y"))); 163 Double.parseDouble(mapNode.getAttribute("extent_max_y")));
164 164
165 map.setMetaData(
166 "ows_extent",
167 mapNode.getAttribute("extent_min_x") + ", " +
168 mapNode.getAttribute("extent_min_y") + ", " +
169 mapNode.getAttribute("extent_max_x") + ", " +
170 mapNode.getAttribute("extent_max_y"));
171
165 //Set the units and projection. 172 //Set the units and projection.
166 int proj = Integer.parseInt(mapNode.getAttribute("projection")); 173 int proj = Integer.parseInt(mapNode.getAttribute("projection"));
167 if(proj != 0) { 174 if(proj != 0) {
168 map.setProjection("epsg:" + mapNode.getAttribute("projection")); 175 map.setProjection("epsg:" + mapNode.getAttribute("projection"));
169 } 176 }
194 } 201 }
195 else { 202 else {
196 units = MS_UNITS.MS_METERS; 203 units = MS_UNITS.MS_METERS;
197 } 204 }
198 map.setUnits(units); 205 map.setUnits(units);
206
207 String srs = map.getMetaData("ows_srs");
208 srs += " EPSG:" + mapNode.getAttribute("projection");
209 map.setMetaData("ows_srs", srs);
199 } 210 }
200 211
201 /** 212 /**
202 * Create layer objects and set the attributes. 213 * Create layer objects and set the attributes.
203 */ 214 */
241 if(!group.equals("")) { 252 if(!group.equals("")) {
242 layer.setMetaData("wms_layer_group", group); 253 layer.setMetaData("wms_layer_group", group);
243 } 254 }
244 layer.setMetaData("wms_title", ulname); 255 layer.setMetaData("wms_title", ulname);
245 256
257 if(layerElement.hasAttribute("extent_min_x") &&
258 layerElement.hasAttribute("extent_max_x") &&
259 layerElement.hasAttribute("extent_min_y") &&
260 layerElement.hasAttribute("extent_max_y")) {
261 layer.setMetaData(
262 "ows_extent",
263 layerElement.getAttribute("extent_min_x") + ", " +
264 layerElement.getAttribute("extent_min_y") + ", " +
265 layerElement.getAttribute("extent_max_x") + ", " +
266 layerElement.getAttribute("extent_max_y"));
267 }
246 //The layer status. 268 //The layer status.
247 String stat = layerElement.getAttribute("status"); 269 String stat = layerElement.getAttribute("status");
248 if (stat.equals("on")) { 270 if (stat.equals("on")) {
249 layer.setStatus(1); 271 layer.setStatus(1);
250 } 272 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)