OpenLayers OpenLayers

Ticket #2145 (closed feature: fixed)

Opened 9 months ago

Last modified 9 months ago

Add parsing of Attribution, KeywordList and MetadataURL to WMSCapabilities

Reported by: ahocevar Assigned to: tschaub
Priority: minor Milestone: 2.9 Release
Component: Format Version: SVN
Keywords: Cc: sbenthall
State: Complete

Description

The attached patch adds some additional layer information to the capability object of the format output. Patch comes with tests, tests pass in FF3. Please review.

Attachments

openlayers-2145.patch (14.8 kB) - added by ahocevar on 06/19/09 05:25:41.
MetadataURL, Attribution and KeywordList parsing
openlayers-2145.2.patch (14.7 kB) - added by ahocevar on 06/21/09 13:00:41.
satisfy IE - removed DTD with invalid URL
openlayers-2145.3.patch (14.9 kB) - added by ahocevar on 06/23/09 09:05:26.
use correct DTD url, which also satisfies IE and is a more appropriate solution
2145.patch (15.1 kB) - added by tschaub on 06/23/09 13:01:28.
wmscapabilities enhancements

Change History

06/19/09 05:25:41 changed by ahocevar

  • attachment openlayers-2145.patch added.

MetadataURL, Attribution and KeywordList parsing

06/19/09 10:11:22 changed by sbenthall

Thanks for working on this, Andreas.

For me, tests fail in IE7.

 Format/WMSCapabilities/v1_1_1.html: fail 1 ok 1 (detailed: fail 0 ok 13)
    test_read ok 13
        ok object contains capability property
        ok getmap formats parsed
        ok getmap href parsed
        ok layers parsed
        ok correct number of layers parsed
        ok [2] correct layer name
        ok [2] correct layer title
        ok [2] correct layer abstract
        ok [2] correct layer bbox 
        ok [2] correct styles length
        ok [2] correct style name
        ok [2] correct legend url
        ok [2] correct queryable attribute

    test_ogc planned 11 assertions but got 0; fail 0 ok 0
        exception: : object: 'null' is null or not an object

06/19/09 10:15:50 changed by sbenthall

They pass in Safari though.

06/21/09 13:00:41 changed by ahocevar

  • attachment openlayers-2145.2.patch added.

satisfy IE - removed DTD with invalid URL

06/21/09 13:01:55 changed by ahocevar

The new patch fixes tests in IE. The problem was that the DTD of the OGC example points to an invalid URL.

06/23/09 01:59:49 changed by bartvde

Hi Andreas, why not use the official location for the DTD instead?

http://schemas.opengis.net/wms/1.1.1/capabilities_1_1_1.dtd

06/23/09 09:05:26 changed by ahocevar

  • attachment openlayers-2145.3.patch added.

use correct DTD url, which also satisfies IE and is a more appropriate solution

06/23/09 09:06:05 changed by ahocevar

Thanks for the suggestion Bart. New patch uses official DTD url.

06/23/09 09:19:02 changed by bartvde

Andreas, I can't say commit, but this looks good to me, no further comments.

06/23/09 12:42:53 changed by sbenthall

  • cc set to sbenthall.

06/23/09 13:01:28 changed by tschaub

  • attachment 2145.patch added.

wmscapabilities enhancements

06/23/09 13:10:50 changed by tschaub

  • state changed from Review to Commit.

This looks good.

A couple changes in the latest patch:

  • Looks like read_cap_LegendURL wasn't previously parsing the legend format. This method became readImageInfo in the patches above. The format element is now parsed for LogoURL and LegendURL.
  • Though both LogoURL and LegendURL have width and height attributes, I think it is a bit clearer to do the parsing in the read_alias_NodeName methods. If you don't mind, I'd rather not have readImageInfo (the next step in improving this is to use readChildNodes and other methods on the XML format).

If you feel strongly about adding readImageInfo, I'm not strongly opposed. In either case, please commit. Tests pass in FF3 and IE6.

06/23/09 15:30:42 changed by ahocevar

Tim: my aim was to avoide code duplication, but since our xml parsers are modular, I see the advantage of better code readibility if everything is done in the block where it belongs to. So I am in favor of your changes.

06/24/09 03:28:22 changed by ahocevar

  • status changed from new to closed.
  • state changed from Commit to Complete.
  • resolution set to fixed.

closed with r9499: added parsing of Attribution, KeywordList and MetadataURL to WMSCapabilities. Thanks tschaub for the improvements to my original patch. r=tschaub