Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java @ 5128:a020100ee6a1
SCHEME CHANGE: Merge branch dami into default.
A summary on the scheme changes:
HWS and Lines tables are dropped and will be replaced by HWS_Lines and
HWS_Points.
The catchment table removed and will be replaced
by a WMS Service.
Hydr_boundaries has an added reference to boundary_kind sectie_kind
and sobek_kind objects.
Dem has a new column srid.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 28 Feb 2013 11:48:17 +0100 |
parents | ed237d6e8e27 |
children | c1b60f8c3390 |
comparison
equal
deleted
inserted
replaced
5126:e37b25628dd4 | 5128:a020100ee6a1 |
---|---|
8 import org.hibernate.Session; | 8 import org.hibernate.Session; |
9 | 9 |
10 import de.intevation.flys.model.Building; | 10 import de.intevation.flys.model.Building; |
11 import de.intevation.flys.model.CrossSectionTrack; | 11 import de.intevation.flys.model.CrossSectionTrack; |
12 import de.intevation.flys.model.Fixpoint; | 12 import de.intevation.flys.model.Fixpoint; |
13 import de.intevation.flys.model.Line; | |
14 import de.intevation.flys.model.River; | 13 import de.intevation.flys.model.River; |
15 import de.intevation.flys.model.RiverAxis; | 14 import de.intevation.flys.model.RiverAxis; |
15 import de.intevation.flys.model.HWSLine; | |
16 | 16 |
17 | 17 |
18 public class SpatialInfo { | 18 public class SpatialInfo { |
19 | 19 |
20 private static Logger logger = Logger.getLogger(SpatialInfo.class); | 20 private static Logger logger = Logger.getLogger(SpatialInfo.class); |
40 } | 40 } |
41 | 41 |
42 logger.info("Spatial information of River '" + RIVERNAME + "'"); | 42 logger.info("Spatial information of River '" + RIVERNAME + "'"); |
43 spatial.doRiverAxisInfo(river); | 43 spatial.doRiverAxisInfo(river); |
44 spatial.doCrossSectionTracksInfo(river); | 44 spatial.doCrossSectionTracksInfo(river); |
45 spatial.doLinesInfo(river); | |
46 spatial.doBuildingsInfo(river); | 45 spatial.doBuildingsInfo(river); |
47 spatial.doFixpointsInfo(river); | 46 spatial.doFixpointsInfo(river); |
48 } | 47 } |
49 finally { | 48 finally { |
50 if (spatial != null) { | 49 if (spatial != null) { |
110 logger.info("River contains " + list.size() + " CrossSectionTracks."); | 109 logger.info("River contains " + list.size() + " CrossSectionTracks."); |
111 } | 110 } |
112 } | 111 } |
113 | 112 |
114 | 113 |
115 protected void doLinesInfo(River river) { | |
116 Query query = session.createQuery( | |
117 "from Line where river =:river"); | |
118 query.setParameter("river", river); | |
119 | |
120 List<Line> list = query.list(); | |
121 | |
122 if (list == null || list.size() == 0) { | |
123 logger.warn("No Lines for '" + river.getName() + "' found!"); | |
124 return; | |
125 } | |
126 else { | |
127 logger.info("River contains " + list.size() + " Lines."); | |
128 } | |
129 } | |
130 | |
131 | |
132 protected void doBuildingsInfo(River river) { | 114 protected void doBuildingsInfo(River river) { |
133 Query query = session.createQuery( | 115 Query query = session.createQuery( |
134 "from Building where river =:river"); | 116 "from Building where river =:river"); |
135 query.setParameter("river", river); | 117 query.setParameter("river", river); |
136 | 118 |
159 } | 141 } |
160 else { | 142 else { |
161 logger.info("River contains " + list.size() + " Fixpoints."); | 143 logger.info("River contains " + list.size() + " Fixpoints."); |
162 } | 144 } |
163 } | 145 } |
146 | |
147 @Deprecated | |
148 protected void doLinesInfo(River river) { | |
149 doHWSLinesInfo(river); | |
150 } | |
151 | |
152 protected void doHWSLinesInfo(River river) { | |
153 Query query = session.createQuery( | |
154 "from hws_lines where river =:river"); | |
155 query.setParameter("river", river); | |
156 | |
157 List<HWSLine> list = query.list(); | |
158 | |
159 if (list == null || list.size() == 0) { | |
160 logger.warn("No Lines for '" + river.getName() + "' found!"); | |
161 return; | |
162 } | |
163 else { | |
164 logger.info("River contains " + list.size() + " Lines."); | |
165 } | |
166 } | |
164 } | 167 } |
165 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 168 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |