Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In google map all the labels are rendering well and there are none missing. In my map some times only the point marker is showing and the label is not displaying.

I am asking about "Auto align and AUTO OFFSET" OPTION in geoserver like mapserver.

In this image all the labels are shown in different offset.

enter image description here

What do I have to change in my SLD?

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

You are probably looking for the maxDisplacement vendor option: http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#maxdisplacement

Also have a look at the other options, autoWrap also increases quite a bit the look of a map with long labels

share|improve this answer
    
Thanks a lot friend, Now my map labels working very nice.But friend In some area duplicate labels(shows same lable more than one time) appearing.Note:I am not using "Repeat option".How can i solve it?Please help.. –  Mohammed shafeek Aug 13 '12 at 7:02
    
If you are using a tiled client there is no real way out of it, I'm afraid. If you don't want any duplicate label you'll have to use un-tiled requests. A workaround for polygons is to have the SLD extract the centroid using something like <sld:geometry><ogc:Function name="centroid"><ogc:PropertyName>name_of_your_geometry_column</ogc:PropertyName‌​></ogc:Function><sld:geometry> (the syntax might be slightly off, I did not test it), but the moment you do some labels will disappear because they fall at the borders of tiles –  Andrea Aime Aug 13 '12 at 9:50
add comment

To render label with auto rotation in geoserver, you will have to use the optional element in your SLD definition:

<Rotation>
  6
</Rotation>

In case you want to use attribute value, you can even use PropertyName tag within Rotation tag.

<Rotation>
    <ogc:PropertyName>rotation_field</ogc:PropertyName>
</Rotation>

Since your image is not uploaded properly, I assume your labels are sometimes not visible because of conflictResolution porperty in your SLD definition. You can check out using :

<VendorOption name="conflictResolution">false</VendorOption>

This will force all labels to be drawn even if they overlap each other.

share|improve this answer
    
I am sorry,I am new at this site.Dear I am asking about "Auto align and AUTO OFFSET" OPTION in geoserver like mapserver. Please look at this link "trac.osgeo.org/mapserver/attachment/ticket/4250/autoalign.jpg here all labels are shown in different offset. –  Mohammed shafeek Aug 8 '12 at 12:01
    
Unfortunately your attachment is still invalid. For align use <AnchorPoint> tag and for offset use <Displacement> tag. More detail here –  thelastray Aug 8 '12 at 12:09
1  
Now with the map appearing, I understand what you are looking for. The labels in Google map is zoom based. All labels are not visible at smaller scales in google map. As you go on zooming, more labels appear. You also can achieve this using <MinScaleDenominator> and <MaxScaleDenominator> within your <Rule> tag. –  thelastray Aug 8 '12 at 12:44
add comment

http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/index.html . See the links on the left of the page for even more detailed information is there.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.