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

Add new graph type (compatible with LightGraphs) with additional geospatial fields? #2

Open
vlandau opened this issue Dec 24, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@vlandau
Copy link
Member

vlandau commented Dec 24, 2020

Add either lat/lon coordinates for vertices, or entire geometries, as well as info on projections? Not sure what this should look like.

Maybe something like this:

mutable struct SpatialWeightedGraph
    graph::AbstractSimpleWeightedGraph
    geometries::Vector{AbstractGeometry}
end

This would enable easy mapping of of paths or cost distances to geographic space/geometries.

Then add methods for all of the LightGraphs/SimpleWeightedGraphs functions, e.g.:

has_edge(a::SpatialWeightedGraph, b, c) = has_edge(a.graph, b, c)

The alternative is for the user to store this information elsewhere and make sure it remains properly sorted. That asks more of the user and may introduce more opportunities for user error.

@vlandau vlandau changed the title Add new graph type (compatible with LightGraphs) with additional geospatial fields Add new graph type (compatible with LightGraphs) with additional geospatial fields? Dec 24, 2020
@vlandau vlandau added the enhancement New feature or request label Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant