Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MapInfoService.java @ 1838:853cd2120d69
Cosmetics, doc.
flys-artifacts/trunk@3174 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 07 Nov 2011 10:48:13 +0000 |
parents | 092e1e5020bc |
children | cbeeaaad1056 |
rev | line source |
---|---|
1058
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.services; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import org.apache.log4j.Logger; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import org.w3c.dom.Document; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import org.w3c.dom.Element; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
8 import com.vividsolutions.jts.geom.Envelope; |
1058
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifacts.CallMeta; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.GlobalContext; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.common.utils.Config; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.common.utils.XMLUtils; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifactdatabase.DefaultService; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.model.River; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.model.RiverAxis; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.utils.GeometryUtils; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 /** |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 * This service provides information about the supported rivers by this |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 * application. |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 * |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 */ |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 public class MapInfoService extends DefaultService { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 /** XPath that points to the river.*/ |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 public static final String XPATH_RIVER = "/mapinfo/river/text()"; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 public static final String XPATH_RIVER_PROJECTION = |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 "/artifact-database/floodmap/river[@name='%RIVER%']/srid/@value"; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 public static final String XPATH_RIVER_BACKGROUND = |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 "/artifact-database/floodmap/river[@name='%RIVER%']/background-wms"; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 public static final String XPATH_RIVER_WMS = |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 "/artifact-database/floodmap/river[@name='%RIVER%']/river-wms/@url"; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 /** The logger used in this service.*/ |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 private static Logger logger = Logger.getLogger(MapInfoService.class); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 /** |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 * The default constructor. |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 */ |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 public MapInfoService() { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 public Document process( |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 Document data, |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 GlobalContext globalContext, |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 CallMeta callMeta |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 ) { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 logger.debug("MapInfoService.process"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 Document result = XMLUtils.newDocument(); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 ElementCreator cr = new ElementCreator(result, null, null); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 Element mapinfo = cr.create("mapinfo"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 result.appendChild(mapinfo); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 String river = extractRiver(data); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 if (river == null || river.length() == 0) { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 logger.warn("Cannot generate information: river is empty!"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 return result; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 Element root = cr.create("river"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 cr.addAttr(root, "name", river); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 mapinfo.appendChild(root); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 RiverAxis axis = RiverAxis.getRiverAxis(river); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 if (axis != null) { |
1774
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
82 Envelope env = axis.getGeom().getEnvelopeInternal(); |
092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
83 String bounds = GeometryUtils.jtsBoundsToOLBounds(env); |
1058
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 logger.debug("River '" + river + "' bounds: " + bounds); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 Element bbox = cr.create("bbox"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 cr.addAttr(bbox, "value", bounds); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 root.appendChild(bbox); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 String xpathS = XPATH_RIVER_PROJECTION.replace("%RIVER%", river); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 String sridStr = Config.getStringXPath(xpathS); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 if (sridStr != null && sridStr.length() > 0) { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 Element srid = cr.create("srid"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 cr.addAttr(srid, "value", sridStr); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 root.appendChild(srid); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 String xpathB = XPATH_RIVER_BACKGROUND.replace("%RIVER%", river); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 Element back = (Element) Config.getNodeXPath(xpathB); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 if (back != null) { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 Element background = cr.create("background-wms"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 cr.addAttr(background, "url", back.getAttribute("url")); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 cr.addAttr(background, "layers", back.getAttribute("layers")); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 root.appendChild(background); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 String xpathWMS = XPATH_RIVER_WMS.replace("%RIVER%", river); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 String wmsStr = Config.getStringXPath(xpathWMS); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 if (wmsStr != null && wmsStr.length() > 0) { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 Element wms = cr.create("river-wms"); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 cr.addAttr(wms, "url", wmsStr); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 root.appendChild(wms); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 return result; |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 protected String extractRiver(Document data) { |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 return XMLUtils.xpathString( |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 data, XPATH_RIVER, ArtifactNamespaceContext.INSTANCE); |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 } |
c37084f31c84
Implemented a MapInfo service that returns some basic information to create maps for specific rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |