[Geoserver-users] SLD Point and Textsymbolizer

Hi together.

I tried to set the font of the textsymbolizer to e sans-serif font. But it
still is a serif font. And the other problem is, that I want to set a bigger
size for the icons on my map. Hope you can Help me with this issue.

Here are the two snippets:

<Rule>
          <Name>Recycling max 10000</Name>
        <ogc:Filter>
            <ogc:PropertyIsEqualTo>
  
<ogc:PropertyName>typ</ogc:PropertyName>
  
<ogc:Literal>recycling</ogc:Literal>
            </ogc:PropertyIsEqualTo>
      </ogc:Filter>
      <MaxScaleDenominator>10000</MaxScaleDenominator>
          <PointSymbolizer>
            <Graphic>
        <ExternalGraphic>
          <OnlineResource xlink:type="simple"
xlink:href="mapnik/recycling.p.16.png"/>
          <Format>image/png</Format>
        </ExternalGraphic>
            </Graphic>
      <Size>20.0</Size>
          </PointSymbolizer>
        </Rule>

<Rule>
        <Name>City maxscale 50000000</Name>
  
<MaxScaleDenominator>50000000</MaxScaleDenominator>
  
<MinScaleDenominator>10000000</MinScaleDenominator>
        <ogc:Filter>
          <ogc:PropertyIsEqualTo>
  
<ogc:PropertyName>typ</ogc:PropertyName>
          <ogc:Literal>city</ogc:Literal>
          </ogc:PropertyIsEqualTo>
        </ogc:Filter>
        <TextSymbolizer>
        <Label>
          <ogc:PropertyName>name</ogc:PropertyName>
        </Label>
        <Font>
          <CssParameter
name="font-size">9</CssParameter>
          <CssParameter
name="font-family">Sans-Serif</CssParameter>
          <CssParameter
name="font-color">#eeeeee</CssParameter>
        </Font>
        </TextSymbolizer>
      </Rule>

Fabio Renggli ha scritto:

Hi together.

I tried to set the font of the textsymbolizer to e sans-serif font. But it
still is a serif font.

GeoServer uses font names that are available to the java runtime.
Probably Serif is a valid font name, whilst Sans-Serif is not.
If you're on Windows, try Arial, that should work.
On Linux, a sans serif font is typically just called "Sans"

And the other problem is, that I want to set a bigger
size for the icons on my map. Hope you can Help me with this issue.

For this one I believe you're stumbling into the same (or similar)
issue as:
http://jira.codehaus.org/browse/GEOS-3061

Mind, resizing on the fly rasters is not a good idea quality wise,
GeoServer is not photoshop, the resized raster will look blurry.
Better to use SVG icons if you can, or to resize your images just
once with a professional tool using the best algorithm you can
find (it will still look blurry, but should look better than
what GeoServer does once I fix the issue above, as
GS will use a bilinear rescale).

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Andrea Aime ha scritto:

Fabio Renggli ha scritto:

Hi together.

I tried to set the font of the textsymbolizer to e sans-serif font. But it
still is a serif font.

GeoServer uses font names that are available to the java runtime.
Probably Serif is a valid font name, whilst Sans-Serif is not.
If you're on Windows, try Arial, that should work.
On Linux, a sans serif font is typically just called "Sans"

And the other problem is, that I want to set a bigger
size for the icons on my map. Hope you can Help me with this issue.

For this one I believe you're stumbling into the same (or similar)
issue as:
http://jira.codehaus.org/browse/GEOS-3061

Nope, I just tested that one again and it affects fills only.
I've just checked with the attached SLD and for me resizing
in point symbolizers works fine, see attached SLD.

Have no idea why it would not work for you, thought the usage
or relative paths looks suspicious (but that should affect loading
the raster, not resizing it).

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

grass_fill.png

pgrass.sld (1.11 KB)