Open michael-prange opened 2 years ago
Yes! This can be easily added.
Object MapData
has a field roadways
that has a Vector
with road descriptions.
For an example consider the sample map:
mx = get_map_data(joinpath(dirname(pathof(OpenStreetMapX)),"..","test/data/reno_east3.osm"),use_cache=false)
The first roadway has the following nodes:
julia> mx.roadways[1].nodes
4-element Vector{Int64}:
2441017888
2441017878
2441017870
2975020216
The name of the roadway (here Pyramid Way) can be found in the tags field:
julia> mx.roadways[1].tags
Dict{String, String} with 11 entries:
"oneway" => "yes"
"lanes" => "1"
"surface" => "asphalt"
"name" => "Pyramid Way"
"horse" => "no"
"lit" => "yes"
"highway" => "secondary"
"turn:lanes" => "left"
"source" => "Bing"
"foot" => "no"
"bicycle" => "no"
Hence all you need to do is to iterate along roadways
, take the first node, get it location and than do the plotting.
Thanks. I will work on a function that adds road names to a map.
Sent from my iPad
On Feb 11, 2022, at 11:54, Przemysław Szufel @.***> wrote:
Yes! This can be easily added.
Object MapData has a field roadways that has a Vector with road descriptions.
For an example consider the sample map:
mx = get_map_data(joinpath(dirname(pathof(OpenStreetMapX)),"..","test/data/reno_east3.osm"),use_cache=false) The first roadway has the following nodes:
julia> mx.roadways[1].nodes 4-element Vector{Int64}: 2441017888 2441017878 2441017870 2975020216 The name of the roadway (here Pyramid Way) can be found in the tags field:
julia> mx.roadways[1].tags Dict{String, String} with 11 entries: "oneway" => "yes" "lanes" => "1" "surface" => "asphalt" "name" => "Pyramid Way" "horse" => "no" "lit" => "yes" "highway" => "secondary" "turn:lanes" => "left" "source" => "Bing" "foot" => "no" "bicycle" => "no" Hence all you need to do is to iterate along roadways, take the first node, get it location and than do the plotting.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.
Is there an easy way to extend the code to allow streets to be labeled?