[MapServer-dev] RFC 138 - Reference SLD files in Mapfiles

Even Rouault even.rouault at spatialys.com
Fri Feb 9 15:27:15 PST 2024


Hi Seth,

Looks good. +1

Small details and questions:

- "If multiple NamedLayers are contained in the SLD file only the first 
will be used." : perhaps emit a warning/debug message when there are 
more than 1 NamedLayer?

- I was wondering about the scenario where someone would have a single 
SLD with named layers A and B, and the mapfile would have also layers A 
and B. In that situation, I guess we would want the A <--> A and B <--> 
B matching.  Perhaps the logic could be "if a SLD has several 
NamedLayer, then try to find one whose name matches the MapServer LAYER 
name, and if not just pick up the first one"?  I'm not too strong about 
that though.

- I was also wondering how much necessary it was to have the empty CLASS 
END block. Perhaps it could be implied if STYLEITEM 
"sld://mysldfile.xml"  is found? Would be a bit more user friendly (and 
what would happen if CLASS is there but not empty? should we allow that?)

- If the user issues a GetStyle WMS layer... I guess they won't get the 
original SLD from the STYLEIDEM, but one that will have be generated 
from MapServer styling objects ? As the SLD -> MapServer styling could 
be lossy, perhaps that could be noted in the user doc.

Even

Le 10/02/2024 à 00:03, Seth G via MapServer-dev a écrit :
> Hi all,
>
> I've added a new RFC - MS RFC 138: Reference SLD files in Mapfiles at https://mapserver.org/development/rfc/ms-rfc-138.html
> This would allow SLD files to be referenced in a Mapfile using the STYLEITEM (similar to how JS files are referenced):
>
>      LAYER
>        STYLEITEM "sld://mysldfile.xml" # uses SHAPEPATH and if not set then relative path to the Mapfile or absolute path
>        CLASS # define an empty CLASS here
>        END
>      END
>
> It will make it easier to export Mapfiles from other application such as QGIS, and to share styles e.g. between MapServer and GeoServer. More details are in the RFC.
> Feedback and comments appreciated.
>
> I'll start with my +1,
>
> Seth
>
> --
> web:https://geographika.net & https://mapserverstudio.net
> twitter: @geographika
> _______________________________________________
> MapServer-dev mailing list
> MapServer-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the MapServer-dev mailing list