Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

How can I use it with WMS ? #82

Open
aequorsolutions opened this issue Aug 17, 2022 · 7 comments
Open

How can I use it with WMS ? #82

aequorsolutions opened this issue Aug 17, 2022 · 7 comments

Comments

@aequorsolutions
Copy link

Hello,

is it possible to use this plugins with data provided by WMS U and V components?

Thank you for the attention

@VictorVelarde
Copy link
Contributor

Hi, short answer is no. WMS doesn't store U or V real values but usually just a visual encoding of those, in png, .jpg.., with some kind of r.g.b. color mapping to the original float value. WCS is the best choice.

The only possible path to something like that would be using some kind of manual procedure, to encode previously the real values in the RGB somehow (thus having control of the WMS server), with an approach similar to this: https://docs.mapbox.com/data/tilesets/reference/mapbox-terrain-rgb-v1/#elevation-data

@aequorsolutions
Copy link
Author

Hi Victor,
I'm trying to use NASA GIBS service which provide only WMS layers.
Looking deeper, I found the origin of the wind and ocean currents data, but it provides only netCDF files via HTTP and OpenDAP.
Do you have any sugestions on how to get this data to use with VectorField plugin?

I spend a lot of time on google but I cound not find anything useful.

@VictorVelarde
Copy link
Contributor

VictorVelarde commented Aug 23, 2022

Probably trying to find same dataset served by NASA under a Thredds server, which allows using WCS & geotiff, is the best option. I'm not sure exactly which dataset you require, but chances are that they are served that way in another url. Eg: https://thredds.jpl.nasa.gov/thredds/catalog.html ??

Reading netCDF & OpenDAP in the browser and prepare the field is something I've never tried. There are libs at npm (search for netcdf / opendap) but all look old & not well maintained (eg: https://www.npmjs.com/package/jsdap/v/5.0.0)

@aequorsolutions
Copy link
Author

Hello Victor,

thank you very much for send the links.
I found two datasets that are served with WCS.

https://thredds.jpl.nasa.gov/thredds/wcs/ocean_circulation/ALL_OSCAR_L4_OC_third-deg.nc?service=WCS&version=1.0.0&request=GetCapabilities

https://thredds.jpl.nasa.gov/thredds/wcs/ncml_aggregation/OceanWinds/smap/aggregate__SMAP_JPL_L3_WIND_SPEED_CAP_8DAY-RUNNINGMEAN_V5.ncml?service=WCS&version=1.0.0&request=GetCapabilities

The final question is how can I use the U and V data provide as WCS layers with the plugin?
The example uses asc files, which makes it easy to use.

I appreciate very much for all the help.

@VictorVelarde
Copy link
Contributor

VictorVelarde commented Aug 24, 2022

Check code in this WCS example here to getCoverage for a variable: https://ihcantabria.github.io/Leaflet.CanvasLayer.Field/example_ScalarField_Geotiff_WCS.html. You would need 2 combined requests for vectorField, one per each u | v component

@aequorsolutions
Copy link
Author

Hi Victor,

Sorry for the stupid questions, I didn't see that there is an example with WCS

After a few hours of study and attempts, I managed to use the plugin with the products made available by NASA via thredds;
However, the result was not quite as expected, the data were strange, with winds from the south across the globe (figure below)

I suspect it may be related to the CRS=EPSG:4326 argument that didn't work in the request.

This is the final urlCoverage I was able to use:

U:
https://thredds.jpl.nasa.gov/thredds/wcs/ncml_aggregation/OceanWinds/ccmp/aggregate__CCMP_MEASURES_ATLAS_L4_OW_L3_5A_5DAY_WIND_VECTORS_FLK.ncml?SERVICE=WCS&VERSION=1.0.0&REQUEST=GetCoverage&COVERAGE=uwnd&TIME=2011-12-01T00:00:00Z&FORMAT=geotiff

V:
https://thredds.jpl.nasa.gov/thredds/wcs/ncml_aggregation/OceanWinds/ccmp/aggregate__CCMP_MEASURES_ATLAS_L4_OW_L3_5A_5DAY_WIND_VECTORS_FLK.ncml?SERVICE=WCS&VERSION=1.0.0&REQUEST=GetCoverage&COVERAGE=vwnd&TIME=2011-12-01T00:00:00Z&FORMAT=geotiff

(Manually the browser downloads geotiff, but to run it in the application I had to disable CORS with the Chrome Access-Control-Allow-Origin extension)

Thank you again for all the help.

image

@VictorVelarde
Copy link
Contributor

Looks like either the values inside are expressed in a non standard magnitude (usually m/s) or there is a problem in code combining both bands

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants