Opening Lunaserv layers in MATLAB

36 views
Skip to first unread message

Dylan McDougall

unread,
Oct 6, 2017, 6:19:54 PM10/6/17
to Lunaserv
Hi,
I've been trying to incorporate some Lunaserv layers with my own data in MATLAB, but have run into some errors related to the GetCapabilities request. For example, when I run the MATLAB commands:

layer = WMSLayer('ServerURL','http://webmap.lroc.asu.edu/','LayerName','luna_wac_global');
wmsupdate(layer);


I get an error message that begins:

Warning: An error occurred while attempting to update layers from the server, 'http://webmap.lroc.asu.edu/'. These layers are being removed from the layer array. The number of
layers from this server that are being removed from the layer array is 1. The error message returned by the server is:
     <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
     <!DOCTYPE WMT_MS_Capabilities SYSTEM "http://webmap.lroc.asu.edu/wms_1.1.1_capabilities.dtd"[<!ELEMENT VendorSpecificCapabilities EMPTY>]>
    
     <WMT_MS_Capabilities version="1.1.1">
       <Service>
         <Name>OGC:WMS</Name>
         <Title>Space Exploration Resources - Lunaserv</Title>

                  ...

followed by the rest of the capabilities file.

I'm not very familiar with the WMS specification, so can anyone suggest what I can do to load the layer properly?

Thanks,
Dylan

Nick Estes

unread,
Oct 6, 2017, 6:26:29 PM10/6/17
to Dylan McDougall, Lunaserv
Dylan,

It looks like Matlab isn't generating quite the right URL for a map
request. If Matlab has a way to debug what URLs it's making, we might
be able to pinpoint the problem. Alternatively, if you can tell me what
IP you were making a request from and at what time, I can look through
the logs on this side and see if there's any clues in there.

--Nick
> --
> You received this message because you are subscribed to the Google
> Groups "Lunaserv" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lunaserv+u...@googlegroups.com.
> To post to this group, send email to luna...@googlegroups.com.
> Visit this group at https://groups.google.com/group/lunaserv.

Nick Estes

unread,
Oct 6, 2017, 6:31:47 PM10/6/17
to Dylan McDougall, Lunaserv
I've also passed your question along to one of our Matlab folks in the
office to see if he has any suggestions.

--Nick

Dylan McDougall

unread,
Oct 9, 2017, 5:14:58 PM10/9/17
to Lunaserv
Hi Nick,
I've just PM'ed you my IP address and request times. For the record, I am using the following commands:
wmsinfo('http://webmap.lroc.asu.edu/');
and
WMSLayer('ServerURL','http://webmap.lroc.asu.edu/?','LayerName','luna_wac_global'); wmsupdate(layer);

Are there any URL arguments I can try? I put the '?' at the end of the second command just for kicks, but that doesn't seem to make a difference.

Dylan

Nick Estes

unread,
Oct 9, 2017, 5:33:23 PM10/9/17
to Dylan McDougall, Lunaserv
Dylan,

I'm not sure what's going on, at first things look ok:

x.x.x.x - - [09/Oct/2017:13:40:10 -0700] "GET
/?REQUEST=GetCapabilities&VERSION=1.3.0&SERVICE=WMS HTTP/1.1" 200
1438509 "-" "MATLAB 9.2.0.556344 (R2017a)"

Matlab first requests capabilities with version 1.3.0 which Lunaserv
doesn't support, so Lunaserv responds with a version 1.1.1 capabilities
response.

x.x.x.x - - [09/Oct/2017:13:40:24 -0700] "GET
/?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS HTTP/1.1" 200
1438614 "-" "MATLAB 9.2.0.556344 (R2017a)"

Now Matlab is requesting version 1.1.1, and Lunaserv responds with
1.1.1, so this should be it in terms of version negotiation, but then
this happens:

x.x.x.x - - [09/Oct/2017:13:40:27 -0700] "GET
/?REQUEST=GetCapabilities&VERSION=1.3.0&SERVICE=WMS HTTP/1.1" 200
1438636 "-" "Java/1.7.0_60"
x.x.x.x - - [09/Oct/2017:13:40:29 -0700] "GET
/?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS HTTP/1.1" 200
1438738 "-" "Java/1.7.0_60"
x.x.x.x - - [09/Oct/2017:13:40:32 -0700] "GET
/?REQUEST=GetCapabilities&VERSION=1.1.0&SERVICE=WMS HTTP/1.1" 200
1438745 "-" "Java/1.7.0_60"
x.x.x.x - - [09/Oct/2017:13:40:35 -0700] "GET
/?wmtver=1.0.0&request=capabilities HTTP/1.1" 200 1438849 "-"
"Java/1.7.0_60"

Now it's gone from a user agent of Matlab to a user agent of Java, and
it appears to be doing version negotiation again, but this time it
doesn't work properly and then goes a bit nutty and tries for a web map
tiles request (which won't work).

Does wmsinfo return anything meaningful to you? On the server side, it
looks like it negotiates and returns a proper capabilities file when you
make the info request. After that is where it seems to go weird, and I
never see any requests for map tiles (which I would assume the second
bit you've listed should do). Most WMS clients are smart enough to add
or ignore the ? at the end of the URL as needed, so I would expect it to
work either way.

--Nick
>> [1]','LayerName','luna_wac_global');
>>>> wmsupdate(layer);
>>>>
>>>> I get an error message that begins:
>>>>
>>>> Warning: An error occurred while attempting to update layers from
>> the
>>>> server, 'http://webmap.lroc.asu.edu/'. These layers are being
>> removed
>>>> from the layer array. The number of
>>>> layers from this server that are being removed from the layer
>> array is
>>>> 1. The error message returned by the server is:
>>>> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
>>
>>>> <!DOCTYPE WMT_MS_Capabilities SYSTEM
>>>> "http://webmap.lroc.asu.edu/wms_1.1.1_capabilities.dtd
>> [2]"[<!ELEMENT
>>>> VendorSpecificCapabilities EMPTY>]>
>>>>
>>>> <WMT_MS_Capabilities version="1.1.1">
>>>> <Service>
>>>> <Name>OGC:WMS</Name>
>>>> <Title>Space Exploration Resources - Lunaserv</Title>
>>>> ...
>>>>
>>>> followed by the rest of the capabilities file.
>>>>
>>>> I'm not very familiar with the WMS specification, so can anyone
>>>> suggest what I can do to load the layer properly?
>>>>
>>>> Thanks,
>>>> Dylan
>>>>
>>>> --
>>>> You received this message because you are subscribed to the
>> Google
>>>> Groups "Lunaserv" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>> send
>>>> an email to lunaserv+u...@googlegroups.com.
>>>> To post to this group, send email to luna...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/lunaserv [3].
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lunaserv" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lunaserv+u...@googlegroups.com.
> To post to this group, send email to luna...@googlegroups.com.
> Visit this group at https://groups.google.com/group/lunaserv.
>
>
> Links:
> ------
> [1] http://webmap.lroc.asu.edu/
> [2] http://webmap.lroc.asu.edu/wms_1.1.1_capabilities.dtd
> [3] https://groups.google.com/group/lunaserv

Dylan McDougall

unread,
Oct 9, 2017, 7:50:47 PM10/9/17
to Lunaserv
Hi Nick,
I've gone through the code for the MATLAB WMS tools and found that when I download the capabilities file and load that into the workspace, the XML parser seems to stumble on "-inf"s, presumably on bounding boxes in the document. This is the stack trace:

Java exception occurred:
java.lang.NumberFormatException: For input string: "-inf"
    at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
    at java.lang.Double.parseDouble(Unknown Source)
    at org.geotools.data.wms.xml.WMSComplexTypes$_BoundingBoxType.getValue(WMSComplexTypes.java:3051)
    at org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:156)
    at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:264)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at com.mathworks.toolbox.geoweb.xml.XMLParser.parse(XMLParser.java:126)

I will probably start a MATLAB Answers thread about this problem; I'll post a link here when I do.

For the record, wmsinfo('http://webmap.lroc.asu.edu/') returns the following:

Error using wmsinfo (line 347)
WebMapServer encountered the following error while attempting to obtain the capabilities document from the server:

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://webmap.lroc.asu.edu/wms_1.1.1_capabilities.dtd"[<!ELEMENT VendorSpecificCapabilities EMPTY>]>
       ...
followed by the rest of the capabilities document.

Thanks,
Dylan

Nick Estes

unread,
Oct 9, 2017, 8:05:28 PM10/9/17
to Dylan McDougall, Lunaserv
Dylan,

That seems likely. The bounding boxes in there are auto-generated as
best as possible for each projection since projections can be added on
the fly. This is complicated by the fact that many projections can
repeat. There must be something in the new projections that were added
about 6 months ago that's resulting in the -inf instead of something
more reasonable. I'll look into that on this end and see if those
projections can be made a bit more sane. This is the first client we've
seen that has an issue with those value though; that's interesting.
Thanks for the stack trace.

--Nick
>>> wmsinfo('http://webmap.lroc.asu.edu/' [1]);
>>> and
>>> WMSLayer('ServerURL','http://webmap.lroc.asu.edu/?
>> [2]','LayerName','luna_wac_global');
>>>>>> WMSLayer('ServerURL','http://webmap.lroc.asu.edu/ [3]
>>>> [1]','LayerName','luna_wac_global');
>>>>>> wmsupdate(layer);
>>>>>>
>>>>>> I get an error message that begins:
>>>>>>
>>>>>> Warning: An error occurred while attempting to update layers
>> from
>>>> the
>>>>>> server, 'http://webmap.lroc.asu.edu/'. These layers are being
>>>> removed
>>>>>> from the layer array. The number of
>>>>>> layers from this server that are being removed from the layer
>>>> array is
>>>>>> 1. The error message returned by the server is:
>>>>>> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
>>>>
>>>>>> <!DOCTYPE WMT_MS_Capabilities SYSTEM
>>>>>> "http://webmap.lroc.asu.edu/wms_1.1.1_capabilities.dtd [4]
>>>> [2]"[<!ELEMENT
>>>>>> VendorSpecificCapabilities EMPTY>]>
>>>>>>
>>>>>> <WMT_MS_Capabilities version="1.1.1">
>>>>>> <Service>
>>>>>> <Name>OGC:WMS</Name>
>>>>>> <Title>Space Exploration Resources - Lunaserv</Title>
>>>>>> ...
>>>>>>
>>>>>> followed by the rest of the capabilities file.
>>>>>>
>>>>>> I'm not very familiar with the WMS specification, so can anyone
>>
>>>>>> suggest what I can do to load the layer properly?
>>>>>>
>>>>>> Thanks,
>>>>>> Dylan
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the
>>>> Google
>>>>>> Groups "Lunaserv" group.
>>>>>> To unsubscribe from this group and stop receiving emails from
>> it,
>>>> send
>>>>>> an email to lunaserv+u...@googlegroups.com.
>>>>>> To post to this group, send email to luna...@googlegroups.com.
>>>>>> Visit this group at https://groups.google.com/group/lunaserv
>> [5] [3].
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>
>>> Groups "Lunaserv" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>> send
>>> an email to lunaserv+u...@googlegroups.com.
>>> To post to this group, send email to luna...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/lunaserv [5].
>>>
>>>
>>> Links:
>>> ------
>>> [1] http://webmap.lroc.asu.edu/
>>> [2] http://webmap.lroc.asu.edu/wms_1.1.1_capabilities.dtd [4]
>>> [3] https://groups.google.com/group/lunaserv [5]
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lunaserv" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lunaserv+u...@googlegroups.com.
> To post to this group, send email to luna...@googlegroups.com.
> Visit this group at https://groups.google.com/group/lunaserv.
>
>
> Links:
> ------
> [1] http://webmap.lroc.asu.edu/&#39;
> [2] http://webmap.lroc.asu.edu/?
> [3] http://webmap.lroc.asu.edu/
> [4] http://webmap.lroc.asu.edu/wms_1.1.1_capabilities.dtd
> [5] https://groups.google.com/group/lunaserv

Nick Estes

unread,
Oct 9, 2017, 8:10:32 PM10/9/17
to Dylan McDougall, Lunaserv
It looks like the auto-stereographic projections that are having the
problem. I suspect it may have something to do with the scale being
user-defined that leads to the issue. I'll see what I can dig up.

--Nick
Reply all
Reply to author
Forward
0 new messages