Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java @ 4654:861c47e0a8a0
Refactor Mapserver mapfile generation.
Prepares the existing mapfile generation code for
a river axis mapfile generator.
Removes unused asynchronous mapfile generation to
reduce complexity.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sat, 08 Dec 2012 00:19:29 +0100 |
parents | |
children | 442fbb290fa8 |
rev | line source |
---|---|
4654
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.utils; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
2 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
3 import de.intevation.flys.artifacts.model.LayerInfo; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
4 import de.intevation.flys.artifacts.model.RiverFactory; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
5 import de.intevation.flys.model.River; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
6 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
7 import java.util.List; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
8 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
9 public class RiverMapfileGenerator extends MapfileGenerator { |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
10 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
11 /** |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
12 * Generate river axis mapfile. |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
13 */ |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
14 @Override |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
15 protected void generate() { |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
16 List<River> rivers = RiverFactory.getRivers(); |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
17 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
18 for (River river : rivers) { |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
19 createRiverAxisLayer( |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
20 river.getName(), |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
21 river.getId(), |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
22 "41677", |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
23 "100,100,100,100"); |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
24 } |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
25 } |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
26 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
27 protected void createRiverAxisLayer(String riverName, int riverID, String srid, String extend) { |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
28 LayerInfo layerInfo = new LayerInfo(); |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
29 layerInfo.setName(riverName); |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
30 layerInfo.setSrid(srid); |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
31 layerInfo.setExtent(extend); |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
32 } |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
33 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
34 } |