Is the angle given the mathematical  angle Ie with 0 running along the x-axis 
and 90 runing North on the y-axis? If so you can correct for this by 
subtracting it from 450 then if the angle is greater than 360 you can subtract 
360 from it.

Eg: if the angle is 30 deg from the horizontal the final angle is (450 -30)-360 
= 60


-----Original Message-----
From: yaras_phoenix via Geoserver-users 
[mailto:geoserver-users@lists.sourceforge.net]
Sent: Wednesday, 18 December 2019 2:21 AM
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] startAngle and EndAngle values incorrect

Hello!

Geoserver 2.15.2

I need to create a style with arrows on the start and end points of the line 
with orientation of the corresponding segment of the line. I took a TTF 
wingdings 3 symbol and used startPoint, endPoint, startAngle and endAngle 
functions to render points and make rotation. Here's my style:

<?xml version="1.0" encoding="UTF-8"?>

<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld";
xmlns:sld="http://www.opengis.net/sld";
xmlns:gml="http://www.opengis.net/gml";
xmlns:ogc="http://www.opengis.net/ogc"; version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>line</sld:Name>
    <sld:UserStyle>
      <sld:Name>ЛЭП высокого напряжения</sld:Name>
      <sld:FeatureTypeStyle>
        <sld:Name>GEO_HVL</sld:Name>
        <sld:Rule>
          <sld:Name>ЛЭП высокого напряжения</sld:Name>
          <sld:LineSymbolizer>
           <sld:Stroke>
             <sld:CssParameter name="stroke">#FF0000</sld:CssParameter>
           </sld:Stroke>
          </sld:LineSymbolizer>
          <sld:PointSymbolizer>
            <Geometry>
               <ogc:Function name="endPoint">
                  <ogc:PropertyName>geometry</ogc:PropertyName>
               </ogc:Function>
            </Geometry>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>ttf://Wingdings
3#U+F068</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">#FF0000</sld:CssParameter>
                </sld:Fill>
              </sld:Mark>
              <sld:AnchorPoint>
                <sld:AnchorPointX>0.5</sld:AnchorPointX>
                <sld:AnchorPointY>0</sld:AnchorPointY>
              </sld:AnchorPoint>
               <sld:Rotation>
                 <ogc:Function name="endAngle">
                  <ogc:PropertyName>geometry</ogc:PropertyName>
               </ogc:Function>
                  </sld:Rotation>
              <sld:Size>30.0</sld:Size>
            </sld:Graphic>
          </sld:PointSymbolizer>
          <sld:PointSymbolizer>
            <Geometry>
               <ogc:Function name="startPoint">
                  <ogc:PropertyName>geometry</ogc:PropertyName>
               </ogc:Function>
            </Geometry>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>ttf://Wingdings
3#U+F068</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">#FF0000</sld:CssParameter>
                </sld:Fill>
              </sld:Mark>
              <sld:AnchorPoint>
                <sld:AnchorPointX>0.5</sld:AnchorPointX>
                <sld:AnchorPointY>0</sld:AnchorPointY>
              </sld:AnchorPoint>
               <sld:Rotation>
                 <ogc:Function name="startAngle">
                  <ogc:PropertyName>geometry</ogc:PropertyName>
               </ogc:Function>
                  </sld:Rotation>
              <sld:Size>30.0</sld:Size>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
</sld:StyledLayerDescriptor>

I expected the arrows to be oriented on the line segments but here's what I've 
got:
<http://osgeo-org.1560.x6.nabble.com/file/t385725/Capture.png>

I wondered if turning the arrows 90 degrees CW and CCW would solve the 
problem...but no:
<http://osgeo-org.1560.x6.nabble.com/file/t385725/Capture2.png>

Different behaviour on different objects.

What am I doing wrong?




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

________________________________

CONFIDENTIALITY NOTICE AND DISCLAIMER
The information in this transmission may be confidential and/or protected by 
legal professional privilege, and is intended only for the person or persons to 
whom it is addressed. If you are not such a person, you are warned that any 
disclosure, copying or dissemination of the information is unauthorised. If you 
have received the transmission in error, please immediately contact this office 
by telephone, fax or email, to inform us of the error and to enable 
arrangements to be made for the destruction of the transmission, or its return 
at our cost. No liability is accepted for any unauthorised use of the 
information contained in this transmission.

_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to