Can I use a WMS layer that has Lonlim set to [-180,360] in Matlab?
조회 수: 1 (최근 30일)
이전 댓글 표시
I would like to use the GEBCO WMS layer as a basemap in webmaps - all good using wmsfind, refine and wmsupdate
But the GEBCO WMS is set up with Lonlim = [-180,360] - ie it's 1.5 times round the globe
When I try and use wmsread, or webmap, I get an error:
Error using webmap
Expected the 'Lonlim' value to be in the interval [-180, 180] or [0 360].
Can anyone think of a way around this?
댓글 수: 1
dpb
2022년 6월 24일
I "know nuthink!" as Sgt Schultz would say about WMS layers, but I see there are input parameters for wmsread for 'Lonlim' that you might be able to set to bound the return. There's a note that the input image will have to allow this for it to work, but that would be my first stab at it.
After that, I dunno what one could do about downloading raw data from server and somehow munging on it...there have to be other toolsets that can handle such; seems strange if it's possible to do that that the ML functions can't handle it....looks like an enhancement request in the making if not a quality of implementation pseudo bug.
답변 (1개)
Narvik
2023년 10월 27일
Hi Helen Snaith,
I understand that you are facing an issue while trying to use the “wmsread” and “webmap” function with Lonlim set to [-180, 360]. This is a known limitation of the functions and is due to the data on the WMS server. The data does not conform to the WMS specification.
A workaround for this issue is to set the “LonLim” property of the WMSLayer object. Here is a code snippet for your reference:
layers = wmsfind('bluemarbleng');
layer = wmsupdate(layers(1));
lonlim = [min(layer.Lonlim), max(layer.Lonlim)];
layer.Lonlim = [max([-180, lonlim(1)]), min([180, lonlim(2)])];
[A,R] = wmsread(layer);
% update your layers before setting the limits
You can also refer to the following documentation link for more information on troubleshooting WMS servers:
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!