nbnuk / nbnatlas-issues

Issue tracking for NBN Atlases
https://nbnatlas.org
2 stars 0 forks source link

Wildcat website - help with web service calls for map layers #414

Open sophiathirza opened 6 years ago

sophiathirza commented 6 years ago

Scottish Wildcat Action website (http://www.scottishwildcataction.org/how-you-can-help/#report) uses NBN webservices to map the distribution of 3 wildcat taxons in Scotland. This hasn't worked since the launch.

The developer sent me this snippet of code: wildcataction_NBN.txt and I sent this them this back to replace the web service call with the new API: wildcataction_NBN_Atlas.txt

sophiathirza commented 6 years ago

I received this email from the developer: I've plugged those into a test map to see if it works, but it doesn't seem to be returning anything. The test map a copy of the live one and you can see it at: http://wildcataction.natappdata.co.uk/wildcatmaptest.html

I can see it's making lots of requests of the NBN API like:

https://records-ws.nbnatlas.org/ogc/wms/reflect?service=WMS&request=GetMap&version=1.1.1&layers=ALA%3Aoccurrences&styles=&format=image%2Fpng&transparent=true&q=lsid%3ANHMSYS0000332741&fq=(occurrence_decade_i%3A2010%20OR%20occurrence_decade_i%3A2000)&bgcolor=0x000000&ENV=colourmode%3Aosgrid%3Bcolor%3Af45642%3Bname%3Acircle%3Bsize%3A4%3Bopacity%3A0.3%3Bgridres%3Asinglegrid&height=256&width=256&srs=EPSG%3A3857&bbox=-1252344.2714243277,7200979.560689886,-939258.2035682457,7514065.628545967

(this would be a single 'square' area on the map - it doesn't do the whole map in one go and breaks it up into tiles to overlay on the map)

but despite not erroring and seemingly being a successful request, they have an empty response, and nothing is shown if you try the URL in the browser on its own.

@djtfmartin can you see what is wrong with the API call? thanks

sophiathirza commented 6 years ago

They asked for the records to be displayed on 2km squares.

sophiathirza commented 5 years ago

@reupost could you help me with this please?

reupost commented 5 years ago

There seem to be a few issues here.

  1. I'm not seeing any 2km resolution grid data for the species even on our main portal: https://records.nbnatlas.org/occurrences/search?q=wild+cat#tab_mapView . So including gridres=singlegrid just gives you the same as gridres=10kgrid I think.

  2. The bounding box in the example above doesn't have data in it; the call also seems sensitive to capitalisation of the BBOX parameter, so this works: https://records-ws.nbnatlas.org/mapping/wms/reflect?service=WMS&request=GetMap&version=1.1.1&layers=ALA%3Aoccurrences&styles=&format=image%2Fpng&transparent=true&q=lsid%3ANHMSYS0000332741&fq=(occurrence_decade_i%3A2010%20OR%20occurrence_decade_i%3A2000)&bgcolor=0x000000&height=256&width=256&srs=EPSG%3A3857&BBOX=-1252344.2714243277,7514065.628545966,-626172.1357121639,8140237.764258131&ENV=color%3Adf4a21%3Bopacity%3A0.3%3Bgridres%3A10kgrid%3Bcolormode%3Agrid

but this doesn't: https://records-ws.nbnatlas.org/mapping/wms/reflect?service=WMS&request=GetMap&version=1.1.1&layers=ALA%3Aoccurrences&styles=&format=image%2Fpng&transparent=true&q=lsid%3ANHMSYS0000332741&fq=(occurrence_decade_i%3A2010%20OR%20occurrence_decade_i%3A2000)&bgcolor=0x000000&height=256&width=256&srs=EPSG%3A3857&bbox=-1252344.2714243277,7514065.628545966,-626172.1357121639,8140237.764258131&ENV=color%3Adf4a21%3Bopacity%3A0.3%3Bgridres%3A10kgrid%3Bcolormode%3Agrid

  1. The colormode (not colourmode) must be set to grid, not osgrid - or it must be removed to allow the other ENV variables (opacity, name:circle and size:4) to be expressed.

A working WMS call which is close to what was provided as an example is thus:

https://records-ws.nbnatlas.org/mapping/wms/reflect?service=WMS&request=GetMap&version=1.1.1&layers=ALA%3Aoccurrences&styles=&format=image%2Fpng&transparent=true&q=lsid%3ANHMSYS0000332741&fq=(occurrence_decade_i%3A2010%20OR%20occurrence_decade_i%3A2000)&bgcolor=0x000000&height=256&width=256&srs=EPSG%3A3857&BBOX=-1252344.2714243277,7514065.628545966,-626172.1357121639,8140237.764258131&ENV=color%3Adf4a21%3Bopacity%3A0.3%3Bgridres%3Asinglegrid

Changes:

sophiathirza commented 5 years ago

Thanks for looking into this. Are you able to give me the script that I should send to them, please? The script that I sent them is in the text file in the first comment.

reupost commented 5 years ago

Here's an example with both point- and grid- style maps. It's worth noting that you need to define the projection for the grid maps. I'm not sure if you can easily mix point- and grid- layers: simply adding a point layer on a grid map won't show because the points aren't in the correct projection. wildcat.txt

c-van-dierkson commented 4 years ago

@sophiathirza Can this be closed now?

sophiathirza commented 4 years ago

@c-van-dierkson No, I still haven't got this working.

c-van-dierkson commented 4 years ago

@sophiathirza Is there any further dev time you need for this?

sophiathirza commented 4 years ago

@c-van-dierkson Yes, I need help on this one.