comparison flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java @ 4738:d93748043cbc

Little work on the RiverMapfileGenerator.
author Christian Lins <christian.lins@intevation.de>
date Wed, 02 Jan 2013 15:15:45 +0100
parents 38ec171544de
children 8062b571884d
comparison
equal deleted inserted replaced
4737:718adea968e2 4738:d93748043cbc
50 for (River river : rivers) { 50 for (River river : rivers) {
51 createRiverAxisLayer( 51 createRiverAxisLayer(
52 river.getName(), 52 river.getName(),
53 river.getId(), 53 river.getId(),
54 "41677", 54 "41677",
55 "100,100,100,100"); 55 "-10000 -10000 10000 10000");
56 riverFiles.add("river-" + river.getName() + ".map"); 56 riverFiles.add("river-" + river.getName() + ".map");
57 } 57 }
58 writeMapfile(riverFiles); 58 writeMapfile(riverFiles);
59 } 59 }
60 60
61 protected void createRiverAxisLayer(String riverName, int riverID, String srid, String extend) { 61 protected void createRiverAxisLayer(String riverName, int riverID, String srid, String extend) {
62 LayerInfo layerInfo = new LayerInfo(); 62 LayerInfo layerInfo = new LayerInfo();
63 layerInfo.setName(riverName); 63 layerInfo.setName(riverName);
64 layerInfo.setSrid(srid); 64 layerInfo.setSrid(srid);
65 layerInfo.setExtent(extend); 65 layerInfo.setExtent(extend);
66 layerInfo.setConnectionType(FLYSUtils.isUsingOracle() ? "oraclespatial" : "postgis"); 66 layerInfo.setType("line");
67 layerInfo.setData("geom FROM river_axis"); // FIXME: Use templates for that
68 layerInfo.setFilter("river_id = " + riverID);
69 layerInfo.setTitle(riverName + " RiverAxis");
67 70
68 File layerFile = new File("river-" + riverName + ".map"); 71 File layerFile = new File("river-" + riverName + ".map");
69 Template template = getTemplateByName(DB_LAYER_TEMPLATE); 72 Template template = getTemplateByName("riveraxis-layer.vm");
70 if (template == null) { 73 if (template == null) {
71 logger.warn("Template '" + DB_LAYER_TEMPLATE + "' not found."); 74 logger.warn("Template riveraxis-layer.vm not found.");
72 return; 75 return;
73 } 76 }
74 77
75 try { 78 try {
76 writeLayer(layerInfo, layerFile, template); 79 writeLayer(layerInfo, layerFile, template);

http://dive4elements.wald.intevation.org