[Qgis-user] Generate the bearing in the attribute table

Kirk Schmidt kirk at nortekresources.com
Fri Apr 9 07:07:05 PDT 2021


Hi Carlos;

It seems you have the calculation of azimuth figured out.  I would 
generate a new filed in the attribute table and use the field calculator 
to calculate your bearings. If you are comfortable with python, you can 
create a script as well.

If you are using a projected coordinate system, take note that North 
would be actually be grid north and your calculate azimuth would be in 
relation to it.  If you want to reference actual true north, you would 
have to calculate the convergence between true and grid north for your 
project area.  If you want the coordinates referencing magnetic north 
(perhaps for field work), then you would also have to calculate the 
magnetic declination for your project.

     Kirk Schmidt

On 4/8/2021 6:30 PM, Sebastian Gutwein wrote:
> Carlos-
> Interesting problem-
> You might get better responses on stack exchange.
> I have the same confusion as Ujaval. Each side of your polygon will 
> have a different bearing.
> If all you care about is the average angle then you can use this 
> expression  main_angle( $geometry)
> This will return azimuth of the polygon in degrees from north.
> I don't know how to convert this to bearing in QGIS.
>
>
>
> On Thu, Apr 8, 2021 at 3:28 PM carlos h <carloslda256 at gmail.com 
> <mailto:carloslda256 at gmail.com>> wrote:
>
>
>       Hello, for example have this in the attribute table:
>
>     https://ibb.co/wWn4PfM <https://ibb.co/wWn4PfM>
>
>     What I need is to have the bearing in the polygon's attribute table.
>
>       Thanks
>
>     CA
>
>
>
>
>         image.gif
>         El jue, 8 abr 2021 a las 10:49, Ujaval Gandhi
>         (<ujaval at spatialthoughts.com
>         <mailto:ujaval at spatialthoughts.com>>) escribió:
>
>             Can you elaborate with an example? It's not clear what the
>             bearing would be for a polygon.
>             Logo <https://spatialthoughts.com/> 	
>             Ujaval Gandhi
>             Spatial Thoughts
>             mobile: +91-8095684687
>             email: ujaval at spatialthoughts.com
>             <mailto:ujaval at spatialthoughts.com>
>             LinkedIn icon
>             <https://www.linkedin.com/in/spatialthoughts/> Twitter
>             icon <https://twitter.com/spatialthoughts>
>
>
>
>
>
>             On Thu, Apr 8, 2021 at 8:50 PM carlos h
>             <carloslda256 at gmail.com <mailto:carloslda256 at gmail.com>>
>             wrote:
>
>
>                 Hello, nice to write here.
>
>                 How can I generate the bearing in the attribute table
>                 of a polygon? the bearing not in azimuth, but for
>                 example N30E etc
>
>                 Thanks
>
>                 CA
>
>
>                 image.gif
>                 _______________________________________________
>                 Qgis-user mailing list
>                 Qgis-user at lists.osgeo.org
>                 <mailto:Qgis-user at lists.osgeo.org>
>                 List info:
>                 https://lists.osgeo.org/mailman/listinfo/qgis-user
>                 <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>                 Unsubscribe:
>                 https://lists.osgeo.org/mailman/listinfo/qgis-user
>                 <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>
>
>     _______________________________________________
>     Qgis-user mailing list
>     Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
>     List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>     Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
Kirk Schmidt, MScF, BScF, RPF
General Manager
Nortek Resource Solutions Inc.
RR # 1
Thorburn, NS
B0K 1W0
Tel (902) 922.3607
Email: kirk at nortekresources.com
Web: www.nortekresources.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210409/de74faa6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.gif
Type: image/gif
Size: 42 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210409/de74faa6/attachment-0001.gif>


More information about the Qgis-user mailing list