Hello all,
I wonder if there are some instruction around for how to get TerriaMap to talk to ncWMS2. I hope someone can help.
I have setup a tomcat9 server with THREDDS4.6 and NCWMS2.4. It is serving up WMS requests to the Godiva3 client, which is working well. The tomcat is running on port 8088.
Then I installed and started TerriaMap on its default port 3001. It runs on the same server as the tomcat. But the browser is running elsewhere in the LAN so I opened 3001 and 8088 ports in the servers firewall.
Then I tried adding the ncWMS-URL to TerriaMap via the "Add Web Data" function. I set the "file type" to "
Web Map Service (WMS) Service" in Step 1 and enter the ncWMS URL (
http://192.168.1.100:8088/ncWMS2/wms) in Step2.
I immediately get an error "Group is not available. An error occurred while invoking GetCapabilities on the WMS server...." followed by a hint that CORS might the issue.
So I attempted to test for CORS according to
https://stackoverflow.com/a/12179364. But I'm not sure which URLs from my local setup to use in testing. Which is the "Origin" here? The ncWMS URL or the TerriaMap URL?
So I tried it "both ways round" and this is what curl tells me:
< Access-Control-Allow-Origin: *
---blank---
My second attempt was to add a specific ncWMS layer directly to the catalog in my terria.json file:
"catalog": [
{
"name": "WMS example",
"type": "group",
"isPromoted": true,
"isOpen": true,
"items": [
{
"name": "Temperature",
"layers": "fmrc_gridT_hourly/votemper",
"type": "wms",
"maxRefreshIntervals": 9000,
"showDatetimePicker": true,
"useOwnClock": true,
},
.....
When I reload TerriaMap, I now have an item "Temperature" in the Add data>Data catalogue and it has a circled + next to it.
When I click + to add the data, I get an error "Request has failed".
My tomcat's "localhost_access_log" file reveals the requests TerriaMap was trying to make
192.168.1.100 - - [24/Sep/2019:08:49:31 +0400] "GET /ncWMS2/wms?service=WMS&version=1.3.0&request=GetCapabilities HTTP/1.1" 403 -
192.168.1.100 - - [24/Sep/2019:08:49:31 +0400] "GET /ncWMS2/wms?service=WMS&version=1.1.1&sld_version=1.1.0&request=DescribeLayer&layers=fmrc_gridT_hourly%2Fvotemper HTTP/1.1" 403 -
The second request fails because ncWMS doesn't support the DescribeLayer request, but why that first one failed with 403 (Forbidden) is a mystery, because I can execute the GetCapabilities request using curl without issues:
<?xml version="1.0" encoding="UTF-8"?>
<WMS_Capabilities
version="1.3.0"
updateSequence="2019-09-24T07:18:59.965+04:00"
<Service>
<Name>WMS</Name>
...
So I can only assume that it's a CORS issue, but as far as I know my tomcat has CORS enabled, but I can't confirm this using the usual tools (such as
https://www.test-cors.org/) because our servers aren't public.
Can anyone help out with any suggestions on how to solve this?
I refuse to believe that TerriaMap cannot be used with ncWMS at all. This should be possible, right?
Thanks a lot in advance,
Fred