[mapserver-users] generating sld from a mapfile

James Crone james.crone at ed.ac.uk
Wed Sep 10 07:07:40 EDT 2008


Hi,

I`ve got a mapfile that I want to generate an SLD from. When I use 
python mapscript and generateSLD as so:

import mapscript

myLayerNames = ["Land_Area",
"Foreshore",
"Glaciers"]

myMapFile = mapscript.mapObj('D:/Globalmap.map')

for myLayerName in myLayerNames:
    myLayer = myMapFile.getLayerByName(myLayerName)   
  
    mySLD = myLayer.generateSLD()

    print mySLD

the generateSLD call just seems to return empty xml fragments in the 
form of:

<StyledLayerDescriptor version="1.0.0" 
xmlns="http://www.opengis.net/sld" 
xmlns:gml="http://www.opengis.net/gml" 
xmlns:ogc="http://www.opengis.net/ogc" 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.opengis.net/sld 
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">

how (assuming it is possible) do I get the style properties from the 
mapfile to be written to the sld?

James

-- 
James Crone

Geo Data and Research Services
EDINA
Causewayside House,
160 Causewayside,
Edinburgh,
Scotland,
United Kingdom
EH9 1PR

tel: +44 (0)131 651 1859
http://edina.ac.uk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Are you looking for help or information about "geo" related resources?
Try Go-Geo! http://www.gogeo.ac.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the mapserver-users mailing list