Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all styles of a layer? #74

Closed
itati01 opened this issue May 11, 2022 · 7 comments
Closed

Get all styles of a layer? #74

itati01 opened this issue May 11, 2022 · 7 comments
Assignees
Milestone

Comments

@itati01
Copy link

itati01 commented May 11, 2022

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!

@eblondel eblondel self-assigned this May 11, 2022
@eblondel eblondel added this to the 0.3 milestone May 11, 2022
@eblondel
Copy link
Owner

@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.

@itati01
Copy link
Author

itati01 commented May 11, 2022

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

@eblondel
Copy link
Owner

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

eblondel added a commit that referenced this issue May 11, 2022
@eblondel
Copy link
Owner

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

eblondel added a commit that referenced this issue May 11, 2022
@itati01
Copy link
Author

itati01 commented May 11, 2022

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

@eblondel
Copy link
Owner

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.

@itati01
Copy link
Author

itati01 commented May 13, 2022

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

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

No branches or pull requests

2 participants