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

Seth G sethg at geographika.co.uk
Mon Feb 12 12:46:09 PST 2024

Hi Tamas,

Thanks for the feedback. I was unaware of your excellent addition of being able to read styles and apply them to individual features before going through the code, and then reading https://mapserver.org/development/rfc/ms-rfc-61.html
As you say it should be relatively straight forward to apply SLD from a string retrieved from a feature attribute defined in STYLEITEM - I'll add a note to the RFC. 


web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Mon, Feb 12, 2024, at 3:38 PM, Tamas Szekeres wrote:
> Hi Seth,
> That seems to be a great addition, +1 from me.
> I see you don't want to support to read SLD from online sources at this stage, but it would be relatively easy to allow specifying the SLD string directly in the feature attribute, since in some cases it is easier to store the data and the style at the same place. For example when the data is coming from a database table or view, it may be challenging to keep the database and the external files in sync. As soon as we can identify that the style string is SLD (for example it ends with </StyledLayerDescriptor>) we could probably call msSLDApplySLD from msLayerGetFeatureStyle directly (not requiring to read the content from a file at all)
> Best regards,
> Tamas
> Seth G via MapServer-dev <mapserver-dev at lists.osgeo.org> ezt írta (időpont: 2024. febr. 10., Szo, 0:04):
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20240212/5ebc717a/attachment.htm>

More information about the MapServer-dev mailing list