Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/BedHeightsArtifact.java @ 8169:856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Mon, 01 Sep 2014 09:43:55 +0200 |
parents | a709e6334c4a |
children | e4606eae8ea5 |
comparison
equal
deleted
inserted
replaced
8168:75a6ac0c73ef | 8169:856701739443 |
---|---|
87 String code = getDatacageIDValue(data); | 87 String code = getDatacageIDValue(data); |
88 | 88 |
89 if (code != null) { | 89 if (code != null) { |
90 String [] parts = code.split("-"); | 90 String [] parts = code.split("-"); |
91 | 91 |
92 if (parts.length >= 4) { | 92 if (parts.length >= 3) { |
93 // The setting is a bit complicated: | 93 // The setting is a bit complicated: |
94 // This artifact can spawn epoch type bedheight facets, | 94 // This artifact can spawn epoch type bedheight facets, |
95 // 'singlevalue'/singleyear bedheight facets or | 95 // 'singlevalue'/singleyear bedheight facets or |
96 // sounding-width facets. The type is indicated by | 96 // sounding-width facets. The type is indicated by |
97 // the ids-param which comes from datacage. | 97 // the ids-param which comes from datacage. |
102 if (type.equals("soundings")) { | 102 if (type.equals("soundings")) { |
103 type = "singlevalues"; | 103 type = "singlevalues"; |
104 facetType = BEDHEIGHT_SOUNDING_WIDTH; | 104 facetType = BEDHEIGHT_SOUNDING_WIDTH; |
105 } | 105 } |
106 addStringData("height_id", parts[2]); | 106 addStringData("height_id", parts[2]); |
107 addStringData("time", parts[3]); | |
108 addStringData("type", type); | 107 addStringData("type", type); |
109 String btype = type; | 108 String btype = type; |
110 int hId = Integer.parseInt(parts[2]); | 109 int hId = Integer.parseInt(parts[2]); |
111 | 110 |
112 if (type.equals("singlevalues")) { | 111 if (type.equals("singlevalues")) { |
131 | 130 |
132 ArrayList<Facet> facets = new ArrayList<Facet>(1); | 131 ArrayList<Facet> facets = new ArrayList<Facet>(1); |
133 facets.add(facet); | 132 facets.add(facet); |
134 | 133 |
135 addFacets(STATIC_STATE_NAME, facets); | 134 addFacets(STATIC_STATE_NAME, facets); |
135 } | |
136 else { | |
137 logger.error("Invalid datacage ID '" + code + "'"); | |
136 } | 138 } |
137 } | 139 } |
138 super.setup(identifier, factory, context, callMeta, data, loadFacets); | 140 super.setup(identifier, factory, context, callMeta, data, loadFacets); |
139 } | 141 } |
140 | 142 |