I've tried to use the geoserver API to create a LayerGroup using the example in
the documentation [1], but I'm getting an error 500.

On older versions of geoserver (e.g. 2.8) I get a 
'java.lang.NullPointerException'.

On newer versions (e.g. 2.16) I get next message:

java.lang.IllegalArgumentException: Invalid style group: No layer or layer
group named 'default_polygon' found in the catalog

>From the API documentation [2], it seems that the API has evolved, despite the
swagger API version number seems not to be managed (1.0.0).

The example above looks like:

<layerGroup>
  <name>nyc</name>
  <layers>
    <layer>roads</layer>
    <layer>parks</layer>
    <layer>buildings</layer>
  </layers>
  <styles>
    <style>roads_style</style>
    <style>polygon</style>
    <style>polygon</style>
  </styles>
</layerGroup>

However, with the new API it would looked like:

<layerGroup>
  <name>nyc</name>
  <publishables>
    <published type="layer">
      <name>roads</name>
    </published>
    <published type="layer">
      <name>parks</name>
    </published>
    <published type="layer">
      <name>buildings</name>
    </published>
  </layers>
  <styles>
    <style><name>roads_style</name></style>
    <style><name>polygon</name></style>
    <style><name>polygon</name></style>
  </styles>
</layerGroup>

The attribute 'type="layer"' seems not to be documented, but I copied from a
working example I found.

I wonder whether this is a bug or it is normal behaviour. Afaik, when the
corresponding layer and style exist both in the catalog, the style is taken as
a Symbology Encoding [3], so it must not be interpreted as a Style Group, and
it shouldn't look for the named layers.

>From the API [2]:

layer > name : Name of the comprising layer, or empty to indicate a style group
defined by the corresponding style

style > name : Name of the style for the corresponding layer in the list, or
empty to use the default style of the corresponding layer.

I wonder:

1. whether I'm doing anything wrong,
2. whether this is a bug, and
3. whether there is more detailed documentation about API usage.

Thanks in advance,
-Eduardo


[1] https://docs.geoserver.org/stable/en/user/rest/layergroups.html

[2] https://docs.geoserver.org/latest/en/api/#1.0.0/layergroups.yaml

[3] https://docs.geoserver.org/stable/en/user/styling/sld/working.html


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to