geostyler / geostyler-mapfile-parser

GeoStyler Style Parser implementation for MapServer Mapfiles
BSD 2-Clause "Simplified" License
7 stars 5 forks source link

write mapserver mapfile support #252

Open pvgenuchten opened 8 months ago

pvgenuchten commented 8 months ago

seems geostyler currently does not support writing (grid styles) to mapfiles

we would love to see support for writing mapserver (grid) style elements by geostyler

npx geostyler-cli --output grid.map grid-5class.qml

would render

  CLASSITEM "[pixel]"
  CLASS
    EXPRESSION "0"
    STYLE
      COLOR 0 0 0
    END
  END
  CLASS
    EXPRESSION ([pixel] >= 64 AND [pixel] < 128)
    STYLE
      COLOR 255 0 0
    END
  END
  CLASS
    NAME "near white"
    EXPRESSION ([red] > 200 AND [green] > 200 AND [blue] > 200)
    STYLE
      COLOR 0 255 0
    END
  END
  CLASS
    EXPRESSION /*1/
    STYLE
      COLOR 0 0 255
    END
  END
mwjsanders commented 3 months ago

I agree with @pvgenuchten that this would be a nice feature to have

pvgenuchten commented 3 months ago

Be aware that mapserver recently added support to use sld to configure layer style, so maybe this issue is not relevant anymore

mwjsanders commented 3 months ago

I see there is support for SLD styling on GetMap requests, but you cannot use sld styling information in you mapfile configuration.

jansule commented 3 months ago

@geographika could you take a look at this? You are probably the one with the biggest knowledge here.

geographika commented 3 months ago

@mwjsanders @jansule - SLD support in Mapfiles has been added to the main branch and will be available in the upcoming 8.2 release - see https://mapserver.org/development/rfc/ms-rfc-138.html

It will allow the following syntax to be used:

LAYER
  STYLEITEM "sld://mysldfile.xml"
  ...
END

In theory, this would replace a need to write to Mapfile format, and allow focus on the translation to SLD for MapServer. GeoStyler could write the SLD file and add a reference to this to a LAYER.

mwjsanders commented 3 months ago

Thanks for the heads up @geographika !! This would make our life so much more easier ;)

KaiVolland commented 1 month ago

@geographika do you think it still would make sense to add support for the grid styles to this parser? If not feel free to close this issue.

Arnebius commented 1 month ago

I still support developing the capability to export styles such as SLD to MapFile.