Skip to content

Commit 4176069

Browse files
clausmichelepcampalani
authored andcommitted
change srs to String
1 parent 75f6216 commit 4176069

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

src/main/java/org/openeo/spring/loaders/WCSCollectionsLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ static Collection parseCollection(String coverageID, InputStream stream,
662662
dim.setType(TypeEnum.SPATIAL); // FIXME this should be implicit
663663

664664
// int gridDim = Integer.parseInt(gridDims[index]) + 1;
665-
int epsgCode = axisLabel2EpsgCode.get(label);
665+
String epsgCode = axisLabel2EpsgCode.get(label).toString();
666666
dim.setReferenceSystem(epsgCode);
667667

668668
// axis type: easting/northing/z ?

src/main/java/org/openeo/spring/model/BandSummary.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ public class BandSummary {
3131

3232
@JsonProperty(value="center_wavelength", required=false)
3333
private Double centerwavelength;
34-
34+
35+
@JsonProperty(value="full_width_half_max", required=false)
36+
private Double full_width_half_max;
37+
3538
@JsonProperty(value="gsd", required=false)
3639
private Double gsd;
3740

src/main/java/org/openeo/spring/model/DimensionSpatial.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static AxisEnum fromValue(String value) {
8383
private String unit = null;
8484

8585
@JsonProperty("reference_system")
86-
private Integer referenceSystem = null;
86+
private String referenceSystem = null;
8787

8888
public DimensionSpatial axis(AxisEnum axis) {
8989
this.axis = axis;
@@ -195,7 +195,7 @@ public void setUnit(String unit) {
195195
this.unit = unit;
196196
}
197197

198-
public DimensionSpatial referenceSystem(Integer referenceSystem) {
198+
public DimensionSpatial referenceSystem(String referenceSystem) {
199199
this.referenceSystem = referenceSystem;
200200
return this;
201201
}
@@ -208,11 +208,11 @@ public DimensionSpatial referenceSystem(Integer referenceSystem) {
208208

209209
@Valid
210210

211-
public Integer getReferenceSystem() {
211+
public String getReferenceSystem() {
212212
return referenceSystem;
213213
}
214214

215-
public void setReferenceSystem(Integer referenceSystem) {
215+
public void setReferenceSystem(String referenceSystem) {
216216
this.referenceSystem = referenceSystem;
217217
}
218218

src/main/java/org/openeo/spring/model/Link.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public class Link {
4444

4545
@JsonProperty("title")
4646
private String title;
47+
48+
@JsonProperty("method")
49+
private String method;
4750

4851

4952
public long getId() {

src/main/java/org/openeo/wcps/WCPSQueryFactory.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,7 +2839,7 @@ private void executeProcesses(String processID, String processNodeKey) {
28392839
collectionIDs.add(col);
28402840
Collection collection = collectionMap.get(collectionID);
28412841

2842-
int srs = getSRSFromCollection(collection);
2842+
String srs = getSRSFromCollection(collection);
28432843

28442844
JSONArray processDataCubeTempExt = new JSONArray();
28452845
JSONObject spatialExtentNode = new JSONObject();
@@ -2926,8 +2926,8 @@ else if (processID.equals("filter_bbox")) {
29262926
JSONObject processFilterArguments = processFilter.getJSONObject("arguments");
29272927
Collection collection = collectionMap.get(collectionID);
29282928

2929-
int srs = getSRSFromCollection(collection);
2930-
if (srs > 0) {
2929+
String srs = getSRSFromCollection(collection);
2930+
if (!srs.equals("")) {
29312931
createBoundingBoxFilterFromArgs(processFilterArguments, srs, collectionID, false);
29322932
}
29332933
}
@@ -3168,7 +3168,7 @@ private String readAll(Reader rd) throws IOException {
31683168
// }
31693169
// }
31703170

3171-
private void createBoundingBoxFilterFromArgs(JSONObject argsObject, int srs, String collectionID, Boolean spatNull) {
3171+
private void createBoundingBoxFilterFromArgs(JSONObject argsObject, String srs, String collectionID, Boolean spatNull) {
31723172
String left = null;
31733173
String right = null;
31743174
String top = null;
@@ -3244,14 +3244,14 @@ private void createBoundingBoxFilterFromArgs(JSONObject argsObject, int srs, Str
32443244
SpatialReference src = new SpatialReference();
32453245
src.ImportFromEPSG(4326);
32463246
SpatialReference dst = new SpatialReference();
3247-
dst.ImportFromEPSG(srs);
3247+
dst.ImportFromEPSG(new Integer(srs));
32483248
log.debug("SRS is :" + srs);
32493249
CoordinateTransformation tx = new CoordinateTransformation(src, dst);
32503250
double[] c1 = null;
32513251
double[] c2 = null;
32523252
c1 = tx.TransformPoint(Double.parseDouble(bottom), Double.parseDouble(left));
32533253
c2 = tx.TransformPoint(Double.parseDouble(top), Double.parseDouble(right));
3254-
if (srs==3035 || srs==4326) {
3254+
if (srs.equals("3035") || srs.equals("4326")) {
32553255
left = Double.toString(c1[1]);
32563256
bottom = Double.toString(c1[0]);
32573257
right = Double.toString(c2[1]);
@@ -3412,15 +3412,15 @@ else if (spatAxisUpperCase.contentEquals("N") || spatAxisUpperCase.contentEquals
34123412
SpatialReference src = new SpatialReference();
34133413
src.ImportFromEPSG(4326);
34143414
SpatialReference dst = new SpatialReference();
3415-
dst.ImportFromEPSG(srs);
3415+
dst.ImportFromEPSG(new Integer(srs));
34163416
log.debug("SRS is : " + srs);
34173417
CoordinateTransformation tx = new CoordinateTransformation(src, dst);
34183418
double[] c1 = null;
34193419
double[] c2 = null;
34203420
c1 = tx.TransformPoint(Double.parseDouble(bottom), Double.parseDouble(left));
34213421
c2 = tx.TransformPoint(Double.parseDouble(top), Double.parseDouble(right));
34223422
//TODO include other CRS exceptions of different axis order
3423-
if (srs==3035 || srs==4326) {
3423+
if (srs.equals("3035") || srs.equals("4326")) {
34243424
left = Double.toString(c1[1]);
34253425
bottom = Double.toString(c1[0]);
34263426
right = Double.toString(c2[1]);
@@ -3654,8 +3654,8 @@ else if (bandCommonName.equals("nir")) {
36543654
}
36553655
}
36563656

3657-
private int getSRSFromCollection(Collection collection) {
3658-
int srs = 0;
3657+
private String getSRSFromCollection(Collection collection) {
3658+
String srs = "";
36593659
for(Dimension dimension: collection.getCubeColonDimensions().values()) {
36603660
if(dimension.getType() == Dimension.TypeEnum.SPATIAL) {
36613661
srs = ((DimensionSpatial) dimension).getReferenceSystem();

0 commit comments

Comments
 (0)