Skip to content

Commit

Permalink
Merge pull request #134 from opengeospatial/issue#131
Browse files Browse the repository at this point in the history
Closes #131
  • Loading branch information
dstenger authored Oct 24, 2024
2 parents 70214e6 + a4cd658 commit 4a09095
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ public String validatePositionQueryUsingParameters(Set<String> collectionIds, St
List<String> crsList = jsonResponse.getList("crs");

String supportedCRS = null;
for (int q = 0; q < crsList.size(); q++) {
if (crsList.get(q).equals("CRS:84") ||
crsList.get(q).equals("CRS84") ||
crsList.get(q).equals("EPSG:4326") ||
crsList.get(q).contains("www.opengis.net/def/crs/OGC/1.3/CRS84")) {
supportedCRS = crsList.get(q);
if(crsList != null) {
for (int q = 0; q < crsList.size(); q++) {
if (crsList.get(q).equals("CRS:84") ||
crsList.get(q).equals("CRS84") ||
crsList.get(q).equals("EPSG:4326") ||
crsList.get(q).contains("www.opengis.net/def/crs/OGC/1.3/CRS84")) {
supportedCRS = crsList.get(q);
}
}
}
if (supportedCRS == null) {
Expand All @@ -78,8 +80,14 @@ public String validatePositionQueryUsingParameters(Set<String> collectionIds, St
HashMap positionQuery = (HashMap) dataQueries.get("position");
HashMap link = (HashMap) positionQuery.get("link");
HashMap variables = (HashMap) link.get("variables");
ArrayList<String> outputFormatList = (ArrayList<String>) variables.get("output_formats");
String supportedFormat = getSupportedFormat(outputFormatList);
String supportedFormat = null;

if(variables==null) { //Avoids Nullpointer Exception
sb.append(" The variables element is missing from the collection " + collectionId + ". ");
} else {
ArrayList<String> outputFormatList = (ArrayList<String>) variables.get("output_formats");
supportedFormat = getSupportedFormat(outputFormatList);
}

double medianx = 0d;
double mediany = 0d;
Expand Down

0 comments on commit 4a09095

Please sign in to comment.