Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java @ 4860:ba4d7f153890
FacetCreator: Updated to use RangeAccess instead of FLYSUtils.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 23 Jan 2013 13:04:54 +0100 |
parents | 6ccdcb956c14 |
children | a9243df307b1 2c1045a1e3fe |
comparison
equal
deleted
inserted
replaced
4859:e31231d0a720 | 4860:ba4d7f153890 |
---|---|
7 | 7 |
8 import com.vividsolutions.jts.geom.Envelope; | 8 import com.vividsolutions.jts.geom.Envelope; |
9 | 9 |
10 import de.intevation.artifactdatabase.state.Facet; | 10 import de.intevation.artifactdatabase.state.Facet; |
11 import de.intevation.artifacts.CallContext; | 11 import de.intevation.artifacts.CallContext; |
12 import de.intevation.flys.artifacts.access.RangeAccess; | |
12 import de.intevation.flys.artifacts.FLYSArtifact; | 13 import de.intevation.flys.artifacts.FLYSArtifact; |
13 import de.intevation.flys.artifacts.model.FacetTypes; | 14 import de.intevation.flys.artifacts.model.FacetTypes; |
14 import de.intevation.flys.artifacts.model.map.WMSLayerFacet; | 15 import de.intevation.flys.artifacts.model.map.WMSLayerFacet; |
15 import de.intevation.flys.artifacts.model.map.WSPLGENLayerFacet; | 16 import de.intevation.flys.artifacts.model.map.WSPLGENLayerFacet; |
16 import de.intevation.flys.artifacts.resources.Resources; | 17 import de.intevation.flys.artifacts.resources.Resources; |
58 this.cc = cc; | 59 this.cc = cc; |
59 this.hash = hash; | 60 this.hash = hash; |
60 this.stateId = sId; | 61 this.stateId = sId; |
61 } | 62 } |
62 | 63 |
64 // TODO We have FLYSUtils and will have RiverAccess to do this | |
63 protected String getRiver() { | 65 protected String getRiver() { |
64 return artifact.getDataAsString("river"); | 66 return artifact.getDataAsString("river"); |
65 } | 67 } |
66 | 68 |
67 protected String getUrl() { | 69 protected String getUrl() { |
72 return FLYSUtils.getRiverSrid(artifact); | 74 return FLYSUtils.getRiverSrid(artifact); |
73 } | 75 } |
74 | 76 |
75 protected Envelope getWSPLGENBounds() { | 77 protected Envelope getWSPLGENBounds() { |
76 String river = getRiver(); | 78 String river = getRiver(); |
77 double kms[] = FLYSUtils.getKmRange(artifact); | 79 RangeAccess rangeAccess = new RangeAccess(artifact, null); |
80 double kms[] = rangeAccess.getKmRange(); | |
78 | 81 |
79 logger.debug("### getWSPLGENBounds"); | 82 logger.debug("### getWSPLGENBounds"); |
80 logger.debug("### from km: " + kms[0]); | 83 logger.debug("### from km: " + kms[0]); |
81 logger.debug("### to km: " + kms[1]); | 84 logger.debug("### to km: " + kms[1]); |
82 | 85 |
109 return tmpFacets; | 112 return tmpFacets; |
110 } | 113 } |
111 | 114 |
112 public void createWSPLGENFacet() { | 115 public void createWSPLGENFacet() { |
113 String river = getRiver(); | 116 String river = getRiver(); |
114 double kms[] = FLYSUtils.getKmRange(artifact); | 117 RangeAccess rangeAccess = new RangeAccess(artifact, null); |
118 double kms[] = rangeAccess.getKmRange(); | |
115 | 119 |
116 WSPLGENLayerFacet wsplgen = new WSPLGENLayerFacet( | 120 WSPLGENLayerFacet wsplgen = new WSPLGENLayerFacet( |
117 0, | 121 0, |
118 FLOODMAP_WSPLGEN, | 122 FLOODMAP_WSPLGEN, |
119 Resources.format( | 123 Resources.format( |