NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi, I would like to know if it is possible to obtain information on the orientation of the streets when downloading an .osm file. That is, when opening the 'lines' file in QGIS (from the .osm file) there is a column that indicates if street A has a south-north direction, street B northeast-southwest, etc (or something similar). I was checking webpages that use info from OSM - as, which are really interesting but I want to use this information to solve a Vehicle routing problem (many package delivery points from a warehouse) and they are not useful in a case like this.

asked 20 May '21, 05:08

puertodormido's gravatar image

accept rate: 0%

I want to note that what I'm trying to get is the orientation and the direction in what the vehicles are allowed to move.

(20 May '21, 10:15) puertodormido

you can use Qgis field calculator:

round((atan( (yat(0) - yat( -1 ))/(xat(0) - xat( -1 ))))/$pi * 180)

This will return angle of line in degrees at its termini.

permanent link

answered 20 May '21, 10:08

Cascafico's gravatar image

accept rate: 0%

Thanks. I did not explain myself completely. What I want is the direction in what vehicles are allowed to move.

(20 May '21, 10:16) puertodormido

Vehicles can generally only travel in the same direction as the linear road, so the above angle would give you that information. Maybe you need to tell us more about what your end goal is?

(20 May '21, 17:36) alester

Well, we have twoway (no tag or oneway=yes) and oneway (oneway=yes or oneway=-1) roads in OSM.

(20 May '21, 19:38) TZorn

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 20 May '21, 05:08

question was seen: 874 times

last updated: 20 May '21, 19:38

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum