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

Feature/5854 implement wms wfs #140

Merged
merged 3 commits into from
Sep 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public enum RelationType {
DESCRIBEDBY("describedby"),
ICON("icon"),
PREVIEW("preview"),
WFS("wfs"),
WMS("wms"),
;

private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,16 @@ List<LinkModel> mapLinks(MDMetadataType source) {
// an empty string by default
linkModel.setRel("");

// WMS or WFS links shouldn't be displayed in the link panel)
// differentiate WMS, WFS and others
safeGet(() -> ciOnlineResource.getProtocol().getCharacterString().getValue().toString())
.ifPresent(protocol -> {
if (!LinkUtils.isWmsOrWfs(protocol)) {
if (LinkUtils.isWms(protocol)) {
linkModel.setRel(RelationType.WMS.getValue());
}
else if (LinkUtils.isWfs(protocol)) {
linkModel.setRel(RelationType.WFS.getValue());
}
else {
linkModel.setRel(RelationType.RELATED.getValue());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ public class LinkUtils {
);

public static boolean isWmsOrWfs (String protocol) {
return isWms(protocol) || isWfs(protocol);
}

public static boolean isWms(String protocol) {
return protocol.startsWith("OGC:WMS")
|| protocol.startsWith("OGC:WFS")
|| protocol.startsWith("IMOS:NCWMS")
;
}

public static boolean isWfs(String protocol) {
return protocol.startsWith("OGC:WFS");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
2 changes: 1 addition & 1 deletion indexer/src/test/resources/canned/associated/self.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,5 @@
"sci:citation" : "{\"suggestedCitation\":\"The citation in a list of references is: \\\"IMOS [year-of-data-download], [Title], [data-access-URL], accessed [date-of-access].\\\"\",\"useLimitations\":[\"Data, products and services from IMOS are provided \\\"as is\\\" without any warranty as to fitness for a particular purpose.\"],\"otherConstraints\":[\"Any users of IMOS data are required to clearly acknowledge the source of the material derived from IMOS in the format: \\\"Data was sourced from Australia’s Integrated Marine Observing System (IMOS) – IMOS is enabled by the National Collaborative Research Infrastructure strategy (NCRIS).\\\" If relevant, also credit other organisations involved in collection of this particular datastream (as listed in 'credit' in the metadata record).\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
3 changes: 2 additions & 1 deletion indexer/src/test/resources/canned/keywords_null_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
5 changes: 3 additions & 2 deletions indexer/src/test/resources/canned/sample10_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@
},
{
"href": "http://geoserver-123.aodn.org.au/geoserver/wms",
"rel": "",
"rel": "wms",
"type": "",
"title": "imos:anmn_velocity_timeseries_map"
},
Expand Down Expand Up @@ -1389,6 +1389,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
3 changes: 2 additions & 1 deletion indexer/src/test/resources/canned/sample11_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
3 changes: 2 additions & 1 deletion indexer/src/test/resources/canned/sample12_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
3 changes: 2 additions & 1 deletion indexer/src/test/resources/canned/sample13_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
3 changes: 2 additions & 1 deletion indexer/src/test/resources/canned/sample14_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
7 changes: 4 additions & 3 deletions indexer/src/test/resources/canned/sample15_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,13 @@
"links": [
{
"href": "https://geoserver.imas.utas.edu.au/geoserver/seamap/wfs?version=1.0.0&request=GetFeature&typeName=SeamapAus_QLD_GBRWHA_seagrass&outputFormat=SHAPE-ZIP",
"rel": "",
"rel": "wfs",
"type": "",
"title": "SHAPE-ZIP"
},
{
"href": "https://geoserver.imas.utas.edu.au/geoserver/seamap/wms",
"rel": "",
"rel": "wms",
"type": "",
"title": "seamap:SeamapAus_QLD_GBRWHA_seagrass"
},
Expand Down Expand Up @@ -509,6 +509,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
16 changes: 8 additions & 8 deletions indexer/src/test/resources/canned/sample4_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,37 +206,37 @@
"title" : "NetCDF files via THREDDS catalog"
}, {
"href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms",
"rel" : "",
"rel" : "wms",
"type" : "",
"title" : "csiro_oa_reconstruction_url/SST"
}, {
"href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms",
"rel" : "",
"rel" : "wms",
"type" : "",
"title" : "csiro_oa_reconstruction_url/SSS"
}, {
"href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms",
"rel" : "",
"rel" : "wms",
"type" : "",
"title" : "csiro_oa_reconstruction_url/ALK"
}, {
"href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms",
"rel" : "",
"rel" : "wms",
"type" : "",
"title" : "csiro_oa_reconstruction_url/DIC"
}, {
"href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms",
"rel" : "",
"rel" : "wms",
"type" : "",
"title" : "csiro_oa_reconstruction_url/OMEGA_A"
}, {
"href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms",
"rel" : "",
"rel" : "wms",
"type" : "",
"title" : "csiro_oa_reconstruction_url/OMEGA_C"
}, {
"href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms",
"rel" : "",
"rel" : "wms",
"type" : "",
"title" : "csiro_oa_reconstruction_url/pH_T"
}, {
Expand Down Expand Up @@ -386,5 +386,5 @@
"sci:citation" : "{\"suggestedCitation\":null,\"useLimitations\":null,\"otherConstraints\":[\"The citation in a list of references is: citation name/s (year metadata published), metadata title. File identifier and Data accessed at (add http link).\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
2 changes: 1 addition & 1 deletion indexer/src/test/resources/canned/sample5_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,5 @@
"sci:citation" : "{\"suggestedCitation\":\"The citation in a list of references is: \\\"IMOS [year-of-data-download], [Title], [data-access-URL], accessed [date-of-access].\\\"\",\"useLimitations\":[\"Data, products and services from IMOS are provided \\\"as is\\\" without any warranty as to fitness for a particular purpose.\"],\"otherConstraints\":[\"Any users of IMOS data are required to clearly acknowledge the source of the material derived from IMOS in the format: \\\"Data was sourced from Australia’s Integrated Marine Observing System (IMOS) – IMOS is enabled by the National Collaborative Research Infrastructure strategy (NCRIS).\\\" If relevant, also credit other organisations involved in collection of this particular datastream (as listed in 'credit' in the metadata record).\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
2 changes: 1 addition & 1 deletion indexer/src/test/resources/canned/sample6_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,5 +544,5 @@
"sci:citation" : "{\"suggestedCitation\":null,\"useLimitations\":null,\"otherConstraints\":[\"Access to the raw (not quality-controlled) voyage data is intended for the collectors and processors of the data obtained in the MNF RV Investigator voyage. Quality-controlled data products will be made available under a CCBY licence.\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
2 changes: 1 addition & 1 deletion indexer/src/test/resources/canned/sample7_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@
"sci:citation" : "{\"suggestedCitation\":null,\"useLimitations\":null,\"otherConstraints\":[\"The data was collected under contract between AIMS and another party(s). Specific agreements for access and use of the data shall be negotiated separately. Contact the AIMS Data Centre (adc@aims.gov.au) for further information\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
3 changes: 2 additions & 1 deletion indexer/src/test/resources/canned/sample7_stac_no_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
2 changes: 1 addition & 1 deletion indexer/src/test/resources/canned/sample8_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,5 +531,5 @@
"sci:citation" : "{\"suggestedCitation\":null,\"useLimitations\":null,\"otherConstraints\":[\"Access to the raw (not quality-controlled) voyage data is intended for the collectors and processors of the data obtained in the MNF RV Investigator voyage. Quality-controlled data products will be made available under the MNF CCBY licence.\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
3 changes: 2 additions & 1 deletion indexer/src/test/resources/canned/sample9_stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,5 @@
"sci:citation" : "{\"suggestedCitation\":null,\"useLimitations\":null,\"otherConstraints\":[\"Data is made available under a Creative Commons Attribution 4.0 International Licence, please see link. Data is supplied 'as is' without any warranty or guarantee except as required by law to be given to you. The data may not be free of error, comprehensive, current or appropriate for your particular purpose. You accept all risk and responsibility for its use. ATTRIBUTION STATEMENT: The dataset [Insert-dataset-name-here] downloaded on [Insert-DD-Mmm-YYYY-here] was collected on voyage [Insert-voyage-name-here] by the Marine National Facility.\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,7 @@
"https://stac-extensions.github.io/contacts/v0.1.1/schema.json",
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
"https://stac-extensions.github.io/language/v1.0.0/schema.json",
"https://stac-extensions.github.io/themes/v1.0.0/schema.json"
"https://stac-extensions.github.io/themes/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@
"sci:citation" : "{\"suggestedCitation\":null,\"useLimitations\":null,\"otherConstraints\":[\"Data is made available under a Creative Commons Attribution 4.0 International Licence, please see link. Data is supplied 'as is' without any warranty or guarantee except as required by law to be given to you. The data may not be free of error, comprehensive, current or appropriate for your particular purpose. You accept all risk and responsibility for its use. ATTRIBUTION STATEMENT: The dataset [Insert-dataset-name-here] downloaded on [Insert-DD-Mmm-YYYY-here] was provided by CSIRO.\"]}",
"type" : "Collection",
"stac_version" : "1.0.0",
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json" ]
"stac_extensions" : [ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/language/v1.0.0/schema.json", "https://stac-extensions.github.io/themes/v1.0.0/schema.json", "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" ]
}
Loading
Loading