GithubHelp home page GithubHelp logo

circuitscape / spatialgraphs-old Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 3.0 47 KB

Archive of early development of SpatialGraphs.jl -- preserved because it is a dependency for other work

License: MIT License

Julia 100.00%

spatialgraphs-old's Introduction

SpatialGraphs.jl

Build Status
Build Status Build status codecov

Functions to create graphs from gridded geospatial data to enable things like least cost path and corridor analysis as well as other graph metrics.

spatialgraphs-old's People

Contributors

vlandau avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spatialgraphs-old's Issues

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

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.

Allow a graph vertex to take up more than one pixel

Right now, an underlying assumption is for each pixel in a raster to be a unique graph vertex, but this may not fit all use cases. Allow a single vertex to "occupy" multiple raster pixels in geographic space.

The lift shouldn't be too hard, but need to test that it works, particularly in converting paths or pathstates back to rasters.

Another consideration would be converting paths to lines. Right now path(s)_to_linestring(s) require a nodemap with unique node indices for every pixel. Maybe these functions just aren't offered in this case.

Add docstrings for exported functions

src/graphs.jl

  • construct_nodemap
  • construct_graph

src/paths.jl

  • least_cost_path
  • least_cost_path
  • path_to_array
  • path_to_cartesian_coords
  • random_lcps
  • pathstate_to_array
  • pathstate_to_geoarray
  • path_to_linestring
  • paths_to_linestrings
  • path_to_array
  • path_to_geoarray

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.