Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodes parameter is not needed in the following function? #19

Open
bsnyh opened this issue Aug 9, 2019 · 1 comment
Open

nodes parameter is not needed in the following function? #19

bsnyh opened this issue Aug 9, 2019 · 1 comment

Comments

@bsnyh
Copy link

bsnyh commented Aug 9, 2019

Hi, just a tiny question. I was wondering, the parameter nodes::Dict{Int,T} is not needed in the following function, right?

function get_edges(nodes::Dict{Int,T},roadways::Vector{OpenStreetMapX.Way}) where T<:Union{OpenStreetMapX.ENU,OpenStreetMapX.ECEF}
    oneway_roads = map(OpenStreetMapX.oneway,roadways)
    reverse_roads = map(OpenStreetMapX.reverseway,roadways)
	classes = OpenStreetMapX.classify_roadways(roadways)
    edges = Dict{Tuple{Int,Int},Int}()
    for i = 1:length(roadways)                 # fix a roadway index i
        for j = 2:length(roadways[i].nodes)    # fix a node index j
            n0 = roadways[i].nodes[j-1]
            n1 = roadways[i].nodes[j]
            start = n0 * !reverse_roads[i] + n1 * reverse_roads[i]
            fin = n0 * reverse_roads[i] + n1 * !reverse_roads[i]
			edges[(start,fin)] = classes[roadways[i].id]
            oneway_roads[i] || (edges[(fin,start)] = classes[roadways[i].id])
        end
    end
	return collect(keys(edges)), collect(values(edges))
end

One more question, I was just wondering, is a documentation for this OpenStreetMapX package necessary / needed? If so, I probably can write one I guess.

@pszufe
Copy link
Owner

pszufe commented Aug 9, 2019

Yes, the parameter is not needed. This is another leftover from code cleanup.

Regarding the documentation - you are welcome to contribute. I can support you with technical issues.
There is quite a lot of documentation that can be also moved from https://openstreetmapjl.readthedocs.io/en/stable/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants