Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java @ 1774:092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
flys-artifacts/trunk@3095 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 28 Oct 2011 05:54:25 +0000 |
parents | aaf8d32f85bd |
children | 0156105222c9 |
comparison
equal
deleted
inserted
replaced
1773:9be01e2e6897 | 1774:092e1e5020bc |
---|---|
1 package de.intevation.flys.wsplgen; | 1 package de.intevation.flys.wsplgen; |
2 | 2 |
3 import java.util.ArrayList; | 3 import java.util.ArrayList; |
4 import java.util.List; | 4 import java.util.List; |
5 | |
6 import com.vividsolutions.jts.geom.Envelope; | |
5 | 7 |
6 import de.intevation.artifacts.CallContext; | 8 import de.intevation.artifacts.CallContext; |
7 | 9 |
8 import de.intevation.artifactdatabase.state.Facet; | 10 import de.intevation.artifactdatabase.state.Facet; |
9 | 11 |
64 | 66 |
65 protected String getSrid() { | 67 protected String getSrid() { |
66 return FLYSUtils.getRiverSrid(artifact); | 68 return FLYSUtils.getRiverSrid(artifact); |
67 } | 69 } |
68 | 70 |
69 protected String getWSPLGENBounds() { | 71 protected Envelope getWSPLGENBounds() { |
70 String river = getRiver(); | 72 String river = getRiver(); |
71 double kms[] = FLYSUtils.getKmRange(artifact); | 73 double kms[] = FLYSUtils.getKmRange(artifact); |
72 | 74 |
73 CrossSectionTrack a = | 75 CrossSectionTrack a = |
74 CrossSectionTrack.getCrossSectionTrack(river, kms[0]); | 76 CrossSectionTrack.getCrossSectionTrack(river, kms[0]); |
78 | 80 |
79 if (a == null || b == null) { | 81 if (a == null || b == null) { |
80 return null; | 82 return null; |
81 } | 83 } |
82 | 84 |
83 return GeometryUtils.createOLBounds(a.getGeom(), b.getGeom()); | 85 Envelope envA = a.getGeom().getEnvelopeInternal(); |
86 Envelope envB = b.getGeom().getEnvelopeInternal(); | |
87 | |
88 envA.expandToInclude(envB); | |
89 | |
90 return envA; | |
84 } | 91 } |
85 | 92 |
86 protected String getBounds() { | 93 protected Envelope getBounds() { |
87 return GeometryUtils.getRiverBounds(getRiver()); | 94 return GeometryUtils.getRiverBoundary(getRiver()); |
88 } | 95 } |
89 | 96 |
90 public List<Facet> getFacets() { | 97 public List<Facet> getFacets() { |
91 return tmpFacets; | 98 return tmpFacets; |
92 } | 99 } |
102 ComputeType.ADVANCE, | 109 ComputeType.ADVANCE, |
103 stateId, | 110 stateId, |
104 hash, | 111 hash, |
105 getUrl()); | 112 getUrl()); |
106 | 113 |
107 String bounds = getWSPLGENBounds(); | 114 Envelope bounds = getWSPLGENBounds(); |
108 | 115 |
109 if (bounds == null || bounds.length() == 0) { | 116 if (bounds == null) { |
110 bounds = getBounds(); | 117 bounds = getBounds(); |
111 } | 118 } |
112 | 119 |
113 wsplgen.addLayer( | 120 wsplgen.addLayer( |
114 artifact.identifier() + MapfileGenerator.MS_WSPLGEN_POSTFIX); | 121 artifact.identifier() + MapfileGenerator.MS_WSPLGEN_POSTFIX); |