Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/mapserver/RiverMapfileGenerator.java @ 5379:61bf64b102bc mapgenfix
Merge with default branch
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 22 Mar 2013 11:25:54 +0100 |
parents | a9243df307b1 |
children |
comparison
equal
deleted
inserted
replaced
5175:cfc5540a4eec | 5379:61bf64b102bc |
---|---|
1 package de.intevation.flys.mapserver; | 1 package de.intevation.flys.mapserver; |
2 | 2 |
3 import com.vividsolutions.jts.geom.Envelope; | 3 import com.vividsolutions.jts.geom.Envelope; |
4 import com.vividsolutions.jts.geom.LineString; | 4 import com.vividsolutions.jts.geom.MultiLineString; |
5 | 5 |
6 import de.intevation.flys.artifacts.model.LayerInfo; | 6 import de.intevation.flys.artifacts.model.LayerInfo; |
7 import de.intevation.flys.artifacts.model.RiverFactory; | 7 import de.intevation.flys.artifacts.model.RiverFactory; |
8 | |
9 import de.intevation.flys.model.River; | 8 import de.intevation.flys.model.River; |
10 import de.intevation.flys.model.RiverAxis; | 9 import de.intevation.flys.model.RiverAxis; |
11 import de.intevation.flys.utils.FLYSUtils; | 10 import de.intevation.flys.utils.FLYSUtils; |
12 import de.intevation.flys.utils.MapUtils; | 11 import de.intevation.flys.utils.MapUtils; |
13 | 12 |
14 import java.io.File; | 13 import java.io.File; |
15 import java.io.FileNotFoundException; | 14 import java.io.FileNotFoundException; |
16 | |
17 import java.util.ArrayList; | 15 import java.util.ArrayList; |
18 import java.util.List; | 16 import java.util.List; |
19 | |
20 import java.util.regex.Pattern; | 17 import java.util.regex.Pattern; |
21 | 18 |
22 import org.apache.log4j.Logger; | 19 import org.apache.log4j.Logger; |
23 | |
24 import org.apache.velocity.Template; | 20 import org.apache.velocity.Template; |
25 | 21 |
26 public class RiverMapfileGenerator extends MapfileGenerator { | 22 public class RiverMapfileGenerator extends MapfileGenerator { |
27 | 23 |
28 public static final String XPATH_RIVERMAP_RIVER_PROJECTION = | 24 public static final String XPATH_RIVERMAP_RIVER_PROJECTION = |
71 List<RiverAxis> riverAxis = RiverAxis.getRiverAxis(river.getName()); | 67 List<RiverAxis> riverAxis = RiverAxis.getRiverAxis(river.getName()); |
72 if (riverAxis == null) { | 68 if (riverAxis == null) { |
73 logger.warn("River " + river.getName() + " has no river axis!"); | 69 logger.warn("River " + river.getName() + " has no river axis!"); |
74 continue; | 70 continue; |
75 } | 71 } |
76 LineString geom = riverAxis.get(0).getGeom(); | 72 MultiLineString geom = riverAxis.get(0).getGeom(); |
77 Envelope extent = geom.getEnvelopeInternal(); | 73 Envelope extent = geom.getEnvelopeInternal(); |
78 | 74 |
79 createRiverAxisLayer( | 75 createRiverAxisLayer( |
80 river.getName(), | 76 river.getName(), |
81 river.getId(), | 77 river.getId(), |