hslayers / hslayers-ng

User interface and map building extensions for OpenLayers
https://ng.hslayers.org/
MIT License
36 stars 20 forks source link

Malformed SLD when uploading GeoJSON #3031

Closed fzadrazil closed 2 years ago

fzadrazil commented 2 years ago

Bug

Describe the bug When publishing GeoJSON with polygon features, malformed style is created for WFS layer. The layer seems to have default symbolizer rules for all the possible geometry types even if there is just polygons in the layer. No features are displayed in the map as a result.

image

To Reproduce Steps to reproduce the behavior:

  1. Go to the Add data panel and upload a geojson file with polygon features Kraje_simple.zip Now the layer is displayed in the map as expected.
  2. Remove the added layer from the map
  3. Add the same layer as WFS from the catalogue
  4. The layer is not visible in the map
  5. Open the symbolizer and see the default style rules set

Expected behavior The WFS should keep the original symbology.

Additional context Opening the same layer in QGIS Layman plugin shows the same effect, rule-based symbology is applied to the layer with four default symbols (point, line, polygon, raster). Publishing the very same layer from QGIS works fine, the symbology works as expected.

raitisbe commented 2 years ago

Not sure its a bug, because default ol style has these symbols. Dont know where the raster comes from

On Tue, 17 May 2022, 18:16 František Zadražil, @.***> wrote:

Assigned #3031 https://github.com/hslayers/hslayers-ng/issues/3031 to @raitisbe https://github.com/raitisbe.

— Reply to this email directly, view it on GitHub https://github.com/hslayers/hslayers-ng/issues/3031#event-6625447126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADAR6UUIVRDXNHNOPBOW7DVKOZ5PANCNFSM5WFJO77Q . You are receiving this because you were assigned.Message ID: @.***>

fzadrazil commented 2 years ago

Yes, I can understand that those symbols are there, but the raster is strange and the result surely seems like a bug, because the layer is not rendering any features. It does not even help to remove those other styles or change attributes of the polygon style, still not visible until you reset the styling completely. image

FilipLeitner commented 2 years ago

Wasnt able to debug on hsl side yet but found 'raster' named sld rule in layman repo https://github.com/LayerManager/layman/blob/11f7c0400b09b1e4c6ddea0f053d0395d789fe5b/deps/geoserver/sample/geoserver_data/styles/default_raster.sld

raitisbe commented 2 years ago

Whats under rule filters? I remember having some strange filter expressions coming for from qgis for some wfs. Mayube its also the case here?

FilipLeitner commented 2 years ago

Problem lays within layer creation. Default style is parsed into OL style but sld layer param is not set. So its is not pushed into layman a what returns after WFS is added is laymans default SLD