2191: Geo Utility enhancements: update json parser to retrieve z-axis property
Task-Url: https://support.d4science.org/issues/2191 Changed List<Double> for ZAxis git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/spatial-data/geo-utility@124055 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
aa7b96a1d3
commit
a87db32ae8
|
@ -25,7 +25,7 @@ public class LayerZAxis implements Serializable{
|
|||
|
||||
private String units;
|
||||
private boolean positive;
|
||||
private List<Long> values;
|
||||
private List<Double> values;
|
||||
|
||||
/**
|
||||
* Instantiates a new layer z axis.
|
||||
|
@ -40,7 +40,7 @@ public class LayerZAxis implements Serializable{
|
|||
* @param positive the positive
|
||||
* @param values the values
|
||||
*/
|
||||
public LayerZAxis(String units, boolean positive, List<Long> values) {
|
||||
public LayerZAxis(String units, boolean positive, List<Double> values) {
|
||||
this.units = units;
|
||||
this.positive = positive;
|
||||
this.values = values;
|
||||
|
@ -74,7 +74,7 @@ public class LayerZAxis implements Serializable{
|
|||
*
|
||||
* @return the values
|
||||
*/
|
||||
public List<Long> getValues() {
|
||||
public List<Double> getValues() {
|
||||
|
||||
return values;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class LayerZAxis implements Serializable{
|
|||
*
|
||||
* @param values the values to set
|
||||
*/
|
||||
public void setValues(List<Long> values) {
|
||||
public void setValues(List<Double> values) {
|
||||
|
||||
this.values = values;
|
||||
}
|
||||
|
|
|
@ -203,16 +203,15 @@ public class NcWmsGetMetadata {
|
|||
if(listMeta.contains(NcWmsLayerMetadata.METADATA.Z_AXIS)){
|
||||
JSONObject zaxis = json.getJSONObject(NcWmsLayerMetadata.METADATA.Z_AXIS.getKey());
|
||||
if(zaxis!=null){
|
||||
System.out.println(zaxis);
|
||||
logger.trace("z-axis: "+zaxis.toString());
|
||||
LayerZAxis zAxis = new LayerZAxis();
|
||||
zAxis.setUnits(zaxis.getString(LayerZAxis.UNITS));
|
||||
zAxis.setPositive(zaxis.getBoolean(LayerZAxis.POSITIVE));
|
||||
JSONArray values = zaxis.getJSONArray(LayerZAxis.VALUES);
|
||||
System.out.println(values);
|
||||
if(values!=null){
|
||||
List<Long> s = new ArrayList<Long>(values.length());
|
||||
List<Double> s = new ArrayList<Double>(values.length());
|
||||
for (int i=0; i<values.length(); i++) {
|
||||
s.add(values.getLong(i));
|
||||
s.add(values.getDouble(i));
|
||||
}
|
||||
zAxis.setValues(s);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue