eblondel / ows4R

R Interface for OGC Web-Services (OWS)

Home Page:https://eblondel.github.io/ows4R/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get all styles of a layer?

itati01 opened this issue · comments

Hi,

I just started to play with ows4r, so I hope that I do not miss anything obvious. The goal is to get all styles belonging to a layer. I currently can get just one style:

wms <- WMSClient$new(wms_url, "1.3.0")
lyr <- wms$getCapabilities()$findLayerByName(layer_name)
lyr$getStyle()

Would it be possible to extend getStyle to get more/all styles (or with a new getStyles method)? Thanks!

@itati01 it's a mistake, the right method should be getStyles(). Just pushed a fix, if you want you can test reinstalling ows4R from github.

@eblondel That was quick! Thanks a lot. By the way, is it possible to obtain attributes of the styles (e.g. title, long name)?

yes i can extend it, and replace the current method by 'getStylenames', i do a commit soon...

@itati01 here it goes. Now you have getStyles that returns a named list, and getStylenames.

Thanks a lot. Both WMSLayer methods work. A small issue: the first two names returned by getStylenames() are (here) identical.

If you can send me the WMS you are trying to query. I suppose that the default style is listed as additional available style for the same layer you are looking at, it means that the style is referenced more than once in the WMS GetCapabilities. I've tested it over various WMS and it works fine.

I checked the Capabilities of the WMS server and found indeed two entries in the XML. So, the issue could be closed.