3

I want to show oneway directions of streets using SLD in geoserver. I follow this instruction but i still have a problem with directions of arrows. Most of all arrows get south to north and west to east direction. The arrows don't follow the direction of the lines. How to solve this issue?

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"
  xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <NamedLayer>
    <Name>oneway_ir</Name>
    <UserStyle>
      <Title>A gold line style</Title>
      
      <FeatureTypeStyle>
       
       <Rule>
               <MaxScaleDenominator>2000000</MaxScaleDenominator>
      <TextSymbolizer>
        <Label>
          <ogc:Literal>&#x2192;</ogc:Literal>
        </Label>
        <Font>
          <CssParameter name="font-family">Lucida Sans</CssParameter>
          <CssParameter name="font-size">18</CssParameter>
        </Font>
        <Fill>
          <CssParameter name="fill">#000000</CssParameter>
        </Fill>
         <VendorOption name="followLine">true</VendorOption>
        
      </TextSymbolizer>
            
    </Rule>
    
          </FeatureTypeStyle>
        </UserStyle>
      </NamedLayer>
    </StyledLayerDescriptor>

enter image description here

4
  • OK, I don't see the issue - those arrows are following the lines as expected.
    – Ian Turton
    Jan 19, 2021 at 13:14
  • @IanTurton i tested the direction with the correct direction. arrows are not following the lines
    – BBG_GIS
    Jan 19, 2021 at 13:18
  • are you sure the lines are digitised in the "correct" direction?
    – Ian Turton
    Jan 19, 2021 at 13:22
  • @IanTurton yes. I'm sure. I tested the direction of the lines in ArcGIS.
    – BBG_GIS
    Jan 19, 2021 at 14:03

1 Answer 1

5

Labels that might be looking "downwards" are automatically flipped to keep them readable. You can turn that off using the "forceLeftToRight" vendor option:

https://docs.geoserver.org/latest/en/user/styling/sld/reference/labeling.html#forcelefttoright

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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