Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/server/MapInfoServiceImpl.java @ 5099:f9e2e1c84263
flys/issue1150: Renamed w/q in w/q-diagram.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 26 Feb 2013 10:18:24 +0100 |
parents | 5014a84c0c7d |
children |
rev | line source |
---|---|
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.server; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import com.google.gwt.user.server.rpc.RemoteServiceServlet; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import de.intevation.artifacts.common.utils.XMLUtils; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.artifacts.httpclient.exceptions.ConnectionException; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.artifacts.httpclient.http.HttpClient; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifacts.httpclient.http.HttpClientImpl; |
4632
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
11 import de.intevation.flys.client.client.services.MapInfoService; |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.flys.client.shared.exceptions.ServerException; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.flys.client.shared.model.BBox; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.flys.client.shared.model.MapInfo; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
4632
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
16 import org.apache.log4j.Logger; |
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
17 import org.w3c.dom.Document; |
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
18 import org.w3c.dom.Element; |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 /** |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 * This service fetches a document that contains meta information for a specific |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 * chart. |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 * |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 */ |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 public class MapInfoServiceImpl |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 extends RemoteServiceServlet |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 implements MapInfoService |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
31 private static final Logger logger = |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
32 Logger.getLogger(MapInfoServiceImpl.class); |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
33 |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
34 |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 public static final String XPATH_RIVER = |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 "/mapinfo/river/@name"; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 public static final String XPATH_SRID = |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 "/mapinfo/river/srid/@value"; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 public static final String XPATH_BBOX = |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 "/mapinfo/river/bbox/@value"; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 public static final String XPATH_RIVER_WMS = |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 "/mapinfo/river/river-wms/@url"; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
47 public static final String XPATH_RIVER_LAYERS = |
4632
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
48 "/mapinfo/river/river-wms/@layers"; |
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
49 |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 public static final String XPATH_WMS_URL = |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 "/mapinfo/river/background-wms/@url"; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 public static final String XPATH_WMS_LAYERS = |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 "/mapinfo/river/background-wms/@layers"; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 public static final String ERROR_NO_MAPINFO_FOUND = |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 "mapinfo_service_no_result"; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
4632
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
60 @Override |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1367
diff
changeset
|
61 public MapInfo getMapInfo(String locale, String river) |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 throws ServerException |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
64 logger.info("MapInfoServiceImpl.getMapInfo"); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1367
diff
changeset
|
66 String url = getServletContext().getInitParameter("server-url"); |
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1367
diff
changeset
|
67 |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
68 Document request = getRequestDocument(river, "rivermap"); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 HttpClient client = new HttpClientImpl(url, locale); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 try { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
73 logger.debug("MapInfoServiceImpl.callService"); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 Document result = client.callService(url, "mapinfo", request); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 if (result == null) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
77 logger.warn("MapInfo service returned no result."); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 throw new ServerException(ERROR_NO_MAPINFO_FOUND); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 return getMapInfo(result); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 catch (ConnectionException ce) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
84 logger.error(ce, ce); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 throw new ServerException(ERROR_NO_MAPINFO_FOUND); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
91 public static Document getRequestDocument(String rivername, String maptypeStr) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
92 logger.debug("MapInfoServiceImpl.getRequestDocument"); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 Document request = XMLUtils.newDocument(); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 ElementCreator cr = new ElementCreator(request, null, null); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
97 Element root = cr.create("mapinfo"); |
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
98 Element river = cr.create("river"); |
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
99 Element maptype = cr.create("maptype"); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 river.setTextContent(rivername); |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
102 maptype.setTextContent(maptypeStr); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 request.appendChild(root); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 root.appendChild(river); |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
106 root.appendChild(maptype); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 return request; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 public static MapInfo getMapInfo(Document result) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
828
diff
changeset
|
113 logger.debug("MapInfoServiceImpl.getMapInfo"); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 String river = XMLUtils.xpathString(result, XPATH_RIVER, null); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 String sridStr = XMLUtils.xpathString(result, XPATH_SRID, null); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 String bboxS = XMLUtils.xpathString(result, XPATH_BBOX, null); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 BBox bbox = BBox.getBBoxFromString(bboxS); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 |
4632
02cf2b1dff84
Make floodmap riveraxis layer name configurable.
Christian Lins <christian.lins@intevation.de>
parents:
1425
diff
changeset
|
120 String riverWMS = XMLUtils.xpathString(result, XPATH_RIVER_WMS, null); |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
121 String riverLayers = XMLUtils.xpathString(result, XPATH_RIVER_LAYERS, null); |
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
122 String wmsURL = XMLUtils.xpathString(result, XPATH_WMS_URL, null); |
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
123 String wmsLayers = XMLUtils.xpathString(result, XPATH_WMS_LAYERS, null); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 int srid = 4326; |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 try { |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 srid = Integer.parseInt(sridStr); |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 catch (NumberFormatException nfe) { |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
131 GWT.log("Could not parse SRID String: " + sridStr); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 |
4739
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
134 return new MapInfo( |
5014a84c0c7d
Add "maptype" parameter to MapInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
4632
diff
changeset
|
135 river, srid, bbox, riverWMS, riverLayers, wmsURL, wmsLayers); |
828
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 } |
910b03de6857
Added a service to get some basic spatial information used for map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |