Olá Pedro, Se calhar convém começares por aqui: http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/index.html. A documentação é bastante boa. Para construires o SLD à tua medida, para o exemplo que pedes, podes pegar no FeatureTypeStyle aqui http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/points.html#point-with-styled-label. Faz uma cópia de um dos styles já existentes na configuração do Geoserver (o "point" por exemplo) e edita lá substituindo o elemnto FeatureTypeStyle. O exemplo proposto "point-with-styled-label" tem de funcionar.
Mendes. 2011/11/24 Pedro Costa <[email protected]> > Pessoal ninguém tem um exemplo de um sld para o geoserver que funcione em > que de para escolher o campo do label, o seu tamanho, e a cor e forma do > ponto? (é para uma geometria de pontos) > > Obrigado > > Com os melhores cumprimentos, > > Pedro Costa > Geógrafo > Especializado em Sistemas de Informação Geográfica e Ordenamento do Território > > > > Em 23-11-2011 13:59, Pedro Mendes escreveu: > > Sugiro que isoles as situações: despista primeiro o TxtSymbolizer e depois > o PointSymbolizer. > Não é costume ver estas FeatureTypeName, SemanticTypeIdentifier > e SemanticTypeIdentifier em exemplos de SLD no Geoserver. Sei que não são > obrigatórias. Exeperimenta retira-las. > > Segue um exemplo de userstyle com um textsymbolizer que funciona: > > <TextSymbolizer> > <Label> > <ogc:PropertyName>UM_ATRIBUTO_DA_FEATURE</ogc:PropertyName> > </Label> > <Font> > <CssParameter name="font-family">Bitstream Vera Sans</CssParameter> > <CssParameter name="font-size"> > <ogc:Literal>6</ogc:Literal> > </CssParameter> > <CssParameter name="font-style">Normal</CssParameter> > <CssParameter name="font-weight">Normal</CssParameter> > </Font> > <LabelPlacement> > <PointPlacement> > <AnchorPoint> > <AnchorPointX>0.5</AnchorPointX> > <AnchorPointY>0.5</AnchorPointY> > </AnchorPoint> > </PointPlacement> > </LabelPlacement> > <Halo> > <Radius> > <ogc:Literal>1</ogc:Literal> > </Radius> > <Fill> > <CssParameter name="fill">#FFFFFF</CssParameter> > <CssParameter name="fill-opacity">0.85</CssParameter> > </Fill> > </Halo> > <Fill> > <CssParameter name="fill"> > <ogc:PropertyName>COLOR</ogc:PropertyName> > </CssParameter> > </Fill> > <VendorOption name="spaceAround">-1</VendorOption> > </TextSymbolizer> > > > 2011/11/23 Pedro Costa <[email protected]> > >> Não funcionou. ATé porque também tentei alterar o tamanho da mark que >> também tem <ogc:Literal> e não muda nada... >> >> >> MAis sugestões? >> >> Obrigado >> >> >> >> >> >> >> >> >> On 23-11-2011 12:25, Pedro Mendes wrote: >> >> Experimenta colocar tudo o que for valores númericos dentro de um >> elemento <ogc:Literal>. Como tens feito para a Rotation e outros. >> >> 2011/11/23 Pedro Costa <[email protected]> >> >>> >>> >>> Então aqui vai: >>> >>> >>> ml version="1.0" encoding="UTF-8"?> >>> <sld:StyledLayerDescriptor >>> xmlns="http://www.opengis.net/sld"<http://www.opengis.net/sld>xmlns:sld= >>> "http://www.opengis.net/sld" <http://www.opengis.net/sld> xmlns:ogc= >>> "http://www.opengis.net/ogc" <http://www.opengis.net/ogc> xmlns:gml= >>> "http://www.opengis.net/gml" <http://www.opengis.net/gml>version="1.0.0"> >>> <sld:UserLayer> >>> <sld:LayerFeatureConstraints> >>> <sld:FeatureTypeConstraint/> >>> </sld:LayerFeatureConstraints> >>> <sld:UserStyle> >>> <sld:Name>Default Styler</sld:Name> >>> <sld:Title/> >>> <sld:IsDefault>1</sld:IsDefault> >>> <sld:FeatureTypeStyle> >>> <sld:Name>simple</sld:Name> >>> <sld:FeatureTypeName>Feature</sld:FeatureTypeName> >>> >>> <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier> >>> >>> <sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier> >>> <sld:Rule> >>> <sld:PointSymbolizer> >>> <sld:Graphic> >>> <sld:Mark> >>> <sld:Fill> >>> <sld:CssParameter >>> name="fill">#FFFF00</sld:CssParameter> >>> </sld:Fill> >>> </sld:Mark> >>> <sld:Size> >>> <ogc:Literal>6.0</ogc:Literal> >>> </sld:Size> >>> </sld:Graphic> >>> </sld:PointSymbolizer> >>> <sld:TextSymbolizer> >>> <sld:Label> >>> <ogc:PropertyName>codi</ogc:PropertyName> >>> </sld:Label> >>> <sld:Font> >>> <sld:CssParameter >>> name="font-family">Arial</sld:CssParameter> >>> >>> <sld:CssParameter >>> name="font-size">10</sld:CssParameter> >>> <sld:CssParameter >>> name="font-style">normal</sld:CssParameter> >>> <sld:CssParameter >>> name="font-weight">bold</sld:CssParameter> >>> </sld:Font> >>> <sld:LabelPlacement> >>> <sld:PointPlacement> >>> <sld:AnchorPoint> >>> <sld:AnchorPointX> >>> <ogc:Literal>0.0</ogc:Literal> >>> </sld:AnchorPointX> >>> <sld:AnchorPointY> >>> <ogc:Literal>0.0</ogc:Literal> >>> </sld:AnchorPointY> >>> </sld:AnchorPoint> >>> <sld:Rotation> >>> <ogc:Literal>0.0</ogc:Literal> >>> </sld:Rotation> >>> </sld:PointPlacement> >>> </sld:LabelPlacement> >>> <sld:Fill> >>> <sld:CssParameter >>> name="fill">#000000</sld:CssParameter> >>> </sld:Fill> >>> <sld:VendorOption >>> name="spaceAround">2</sld:VendorOption> >>> </sld:TextSymbolizer> >>> </sld:Rule> >>> </sld:FeatureTypeStyle> >>> </sld:UserStyle> >>> </sld:UserLayer> >>> </sld:StyledLayerDescriptor> >>> >>> >>> Nota: Fiz o sld com o udig. >>> OS: Ubuntu (geobox) >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> On 23-11-2011 12:05, Pedro Mendes wrote: >>> >>> Olá Pedro, >>> >>> Coloca aqui o SLD inteiro, para ser mais facil avaliar o que poderá >>> estar mal. >>> >>> Mendes. >>> >>> 2011/11/23 Pedro Costa <[email protected]> >>> >>>> Pessoal, >>>> >>>> POdem ajudar no seguinte, eu tenho uns layers com uns estilos no >>>> geoserver mas não consigo mudar o tamanho dos labels, já fui no sld edior e >>>> mudei para metade do tamanho e continua igual. >>>> >>>> Original >>>> >>>> <sld:CssParameter name="font-size">10</sld:CssParameter> >>>> >>>> >>>> Mudei para >>>> >>>> <sld:CssParameter name="font-size">5</sld:CssParameter> >>>> >>>> ALguém sabe qual é o problema? >>>> >>>> Obrigado >>>> _______________________________________________ >>>> Portugal mailing list >>>> [email protected] >>>> http://lists.osgeo.org/mailman/listinfo/portugal >>>> >>> >>> >>> >>> _______________________________________________ >>> Portugal mailing >>> [email protected]http://lists.osgeo.org/mailman/listinfo/portugal >>> >>> >>> >>> _______________________________________________ >>> Portugal mailing list >>> [email protected] >>> http://lists.osgeo.org/mailman/listinfo/portugal >>> >>> >> >> >> _______________________________________________ >> Portugal mailing >> [email protected]http://lists.osgeo.org/mailman/listinfo/portugal >> >> >> >> _______________________________________________ >> Portugal mailing list >> [email protected] >> http://lists.osgeo.org/mailman/listinfo/portugal >> >> > > > _______________________________________________ > Portugal mailing > [email protected]http://lists.osgeo.org/mailman/listinfo/portugal > > > _______________________________________________ > Portugal mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/portugal > >
_______________________________________________ Portugal mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/portugal
