From: Raif S. N. <ra...@fo...> - 2007-01-31 21:23:55
|
hello all, thank you Brent, Chris and Andrea for your prompt reply. Brent, i shall give this a go with GeoServer 1.4.0 if it works it will answ= er=20 my 'put-style' part of the question. if i encounter any problems i'll take= =20 you on your offer and will ask for help! how about getting an SLD xml file; is there a ?request=3Dgetstyles&layers= =3Dfoo...=20 equivalent? On Thursday 01 February 2007 03:05, Brent Owens wrote: > Hi Raif, > Sorry just saw the email this morning. We do have a pseudo putStyles > method. Here is the breakdown of how to use it: > > Send a POST request to your server instance using this url: > localhost:8080/geoserver/wms?request=3Dputstyles > (replace 'localhost' with your server address) > Then the body just has to be the SLD file. > Make sure that the SLD has a NamedLayer where the <Name> is equal to the > feature type you want to set the style for. Then in the NamedLayer tag > make sure there is a <UserStyle> that has the name of the style you want > to use. > > Here is a snippit from our basic SLD editor that builds the SLD file > before it sends it off: > XML =3D '<?xml version=3D"1.0" encoding=3D"UTF-8"?>'+"\n"; > XML +=3D '<StyledLayerDescriptor version=3D"1.0.0"'+"\n"; > XML +=3D ' xmlns:gml=3D"http://www.opengis.net/gml"'+"\n"; > XML +=3D ' xmlns:ogc=3D"http://www.opengis.net/ogc"'+"\n"; > XML +=3D ' xmlns=3D"http://www.opengis.net/sld">'+"\n"; > XML +=3D ' <NamedLayer>'+"\n"; > XML +=3D ' <Name>'+featureType+'</Name>'+"\n"; > XML +=3D ' <UserStyle>'+"\n"; > XML +=3D ' <Name>'+featureType+'_style</Name>'+"\n"; > XML +=3D ' <Title>geoserver style</Title>'+"\n"; > XML +=3D ' <Abstract>Generated by GeoServer</Abstract>'+"\= n"; > XML +=3D ' <FeatureTypeStyle>'+"\n"; > XML +=3D ' <Rule>'+"\n"; > ... > ... > ... > > Be warned that the put styles request is not very robust and was > designed just for the sld editor, but it wouldn't be hard to improve it > and I could point you at the code and walk you through how to improve it > if you would like. It is definitely something that would be nice to have. > > Feel free to ask me if you need any more help. > cheers, > > Brent Owens > (The Open Planning Project) > > Chris Holmes wrote: > > Brent was the one who coded it up, and I was hoping he'd answer, but > > let's ping him directly. > > > > Brent, could you point Raif at how to programmatically put a style in > > to GeoServer? Maybe a code snippet from your basic SLD editor? > > > > Chris > > > > Andrea Aime wrote: > >> Raif S. Naffah ha scritto: > >>> hello all, > >>> > >>> is there a way to programmatically send and receive SLD files to > >>> GeoServer; e.g. access, and may be replace, the style named > >>> 'population' (which seems to be defined in popshade.sld in the > >>> folder $GEOSERVER_WEBAPP/conf/styles) used by the 'topp:states' layer? > >> > >> As far as I know, we do lack a GetStyle, we do have a prototype > >> PutStyles but they told me it's not compliant with the SLD WMS > >> extensions, and its not documented anywhere, neither... > >> Maybe my colleagues know more, let's wait and see what they can say > >> about this. > >> > >> Cheers > >> Andrea > >> > >> ----------------------------------------------------------------------= =2D- > >>- > >> > >> Take Surveys. Earn Cash. Influence the Future of IT > >> Join SourceForge.net's Techsay panel and you'll get the chance to > >> share your > >> opinions on IT & business topics through brief surveys - and earn cash > >> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID= =3DDEVDE > >>V > >> > >> _______________________________________________ > >> Geoserver-users mailing list > >> Geo...@li... > >> https://lists.sourceforge.net/lists/listinfo/geoserver-users =2D-=20 cheers; rsn |