Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUS-4270 #176

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2192,8 +2192,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
Loading