Skip to content

Commit

Permalink
Merge pull request #176 from chrisvpeters/AUS-4270
Browse files Browse the repository at this point in the history
AUS-4270
  • Loading branch information
jia020 authored Nov 7, 2024
2 parents 3065503 + d6dc547 commit a67d12a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
20 changes: 16 additions & 4 deletions src/main/java/org/auscope/portal/server/config/LayerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ public IRISSelector knownTypeIRISSelector(String networkCode, String serviceEndP
* The service endpoint that the instance of the selector is concerned with.
* @throws MalformedURLException
*/
public VMFSelector knownTypeVMFSelector(String layerName, String serviceEndPoint, JSONArray polygonGeoJson) {
public VMFSelector knownTypeVMFSelector(String layerName, String serviceEndPoint, JSONArray polygonGeoJson, String apikey, String maps) {
try {
return new VMFSelector(layerName, serviceEndPoint, polygonGeoJson);
return new VMFSelector(layerName, serviceEndPoint, polygonGeoJson, apikey, maps);
} catch (MalformedURLException e) {
log.error("Malformed URL for VMF service point: " + serviceEndPoint);
}
Expand Down Expand Up @@ -435,17 +435,25 @@ else if (cswKey.startsWith("serviceNames")) {
case "vmf": {
String layerName = null;
String serviceEndPoint = null;
String apikey = null;
String maps = null;
JSONArray polygonGeoJson = new JSONArray();

Map<String, Object> x = (Map<String, Object>) v1;
String[] attr = new String[2];
String[] attr = new String[4];
x.forEach((sk1, sv1) -> {
if (sk1.startsWith("selector")) {
attr[1] = (String) sv1;
}
if (sk1.startsWith("endPoint")) {
attr[0] = (String) sv1;
}
if (sk1.startsWith("apikey")) {
attr[2] = (String) sv1;
}
if (sk1.startsWith("maps")) {
attr[3] = (String) sv1;
}
if (sk1.startsWith("polygon_geojson")) {

Double[] lon = new Double[1];
Expand All @@ -469,11 +477,15 @@ else if (cswKey.startsWith("serviceNames")) {
});
layerName = attr[1];
serviceEndPoint = attr[0];
apikey = attr[2];
maps = attr[3];

layer.setEndPoint(serviceEndPoint);
layer.setPolygon(polygonGeoJson);
layer.setApikey(apikey);
layer.setMaps(maps);

layer.setKnownLayerSelector(knownTypeVMFSelector(layerName,serviceEndPoint,polygonGeoJson));
layer.setKnownLayerSelector(knownTypeVMFSelector(layerName,serviceEndPoint,polygonGeoJson,apikey,maps));
break;
}
case "kml": {
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/layers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2206,8 +2206,10 @@
order: "ind01"
vmf:
selector: "Indigenous Map"
endPoint: "https://native-land.ca/wp-json/nativeland/v1/api/index.php"
polygon_geojson: [[111.64,-17.61],[132.45,-8.23],[146.26,-10.53],[159.37,-24.57],[147.95,-45.25],[110.29,-34.29]]
endPoint: "https://native-land.ca/api/index.php"
polygon_geojson: [[146.26, -10.53], [132.45, -8.23], [111.64, -17.61], [110.29, -34.29], [147.95, -45.25], [159.37, -24.57], [146.26, -10.53]]
apikey: "_7AyXpOSiefzoaCbUaPOM"
maps: "territories"

"regolith-depth-layer":
name: "Soil and Landscape Grid National Soil Attribute Maps - Depth of Regolith"
Expand Down

0 comments on commit a67d12a

Please sign in to comment.