[Geoserver-users] Query about labels and SLD

Dear All

I apologise for bothering you all again! But I have another query.

I have just created a SLD file for creating labels based on points which
have a label(text) field. The labels consist of street names and house
numbers and hence are designed to be at font size 10 at about scale 1:1250.

I have two queries:

1. Is it possible to create scale dependent labels? I can't see how and I
have used the following element
<MaxScaleDenominator>2000</MaxScaleDenominator> within the <rule> element so
that the labels disappear as the map is zoomed out and hence do not become
too large. Has anyone got suggestions about other methods of dealing with
this?

2. I cannot see what the difference is between the <AnchorPoint> and
<Displacement> elements within the <PointPlacement> element (see below). I
suspect that there is a subtle difference but I am currently missing it!

Kind Regards and Many Thanks to all of you have replied to my posts today.

John
Manchester, UK

----------------------------------------------------------------------------
----------------------------------------------

<PointPlacement>
  <AnchorPoint>
  <AnchorPointX>0.5</AnchorPointX>
  <AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>0.5</DisplacementX>
<DisplacementY>0.5</DisplacementY>
</Displacement>
<Rotation>
<ogc:PropertyName>angle1</ogc:PropertyName>
</Rotation>
</PointPlacement>

There is no way to directly and dynamically effect the size of the label based on the scale. The only thing you can do is set several zoom scales that render different sized labels.

As for Anchor Point and Displacement the difference is this:
1) Anchor Points are relative to the label. The value is the percentage of the label where the center is 0,0 (center of the label). If you use the value 1,0 that will set the center of the label to the far right, middle Y coordinate. If you use -1,0 that will set the center of the label to the far left, middle Y coordinate. etc...
2) The displacement will then effect the label some more, after the anchor point is calculated. Its unit is in Pixels. So if you use 5,10, it will shift the label right 5 pixels and up 10 pixels, after the anchor point has been places.

I hope that helps.

Brent Owens
(The Open Planning Project)

John Roberts wrote:

Dear All

I apologise for bothering you all again! But I have another query.

I have just created a SLD file for creating labels based on points which
have a label(text) field. The labels consist of street names and house
numbers and hence are designed to be at font size 10 at about scale 1:1250.

I have two queries:

1. Is it possible to create scale dependent labels? I can't see how and I
have used the following element
<MaxScaleDenominator>2000</MaxScaleDenominator> within the <rule> element so
that the labels disappear as the map is zoomed out and hence do not become
too large. Has anyone got suggestions about other methods of dealing with
this?

2. I cannot see what the difference is between the <AnchorPoint> and
<Displacement> elements within the <PointPlacement> element (see below). I
suspect that there is a subtle difference but I am currently missing it!

Kind Regards and Many Thanks to all of you have replied to my posts today.

John
Manchester, UK

----------------------------------------------------------------------------
----------------------------------------------

<PointPlacement>
  <AnchorPoint>
  <AnchorPointX>0.5</AnchorPointX>
  <AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>0.5</DisplacementX>
<DisplacementY>0.5</DisplacementY>
</Displacement>
<Rotation>
<ogc:PropertyName>angle1</ogc:PropertyName>
</Rotation>
</PointPlacement>

-------------------------------------------------------------------------
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=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users