Graph Types in SpatialGraphs.jl
At this time, only raster-based graph types have been developed (and vertex locations are stored in a Rasters.Raster), but there are plans to eventually implement graph types for vector data as well.
Abstract Types
The overarching type in SpatialGraphs.jl is the AbstractSpatialGraph. All AbstractSpatialGraph subtypes contain a field called graph, which is itself an AbstractGraph.
SpatialGraphs.AbstractSpatialGraph — TypeAbstractSpatialGraph{T}An abstract type representing a spatially referenced graph.
An AbstractSpatialGraph must contain the following field:
graph::AbstractGraph
The AbstractRasterGraph type is a subtype of AbstractSpatialGraph. All AbstractRasterGraph subtypes contain a field called vertex_raster, which is a Rasters.Raster that describes the spatial locations for the vertices in the graph. If your graph has 10 vertices, then the corresponding vertex_raster must have 10 unique values, starting at 1 (which corresponds to the first vertex in the graph) and going up to 10 (which corresponds to the tenth vertex in the graph). To find the location of a given graph vertex, n, you simply identify the pixel(s) with a value of n. For pixels/elements in vertex_raster for which there shouldn't be a graph vertex, use a value of 0.
SpatialGraphs.AbstractRasterGraph — TypeAbstractRasterGraph{T}An abstract type representing a spatially referenced graph, with graph vertices corresponding to pixels in a raster.
An AbstractRasterGraph must contain the following fields:
graph::AbstractGraphvertex_raster::Raster
AbstractRasterGraph Subtypes
SpatialGraphs.jl has raster graph types for undirected, directed, unweighted, and weighted graphs, each detailed below.
SpatialGraphs.RasterGraph — TypeRasterGraph{T}A composite type for a spatially referenced graph. Vertices are spatially referenced based on a raster.
SpatialGraphs.RasterDiGraph — TypeRasterDiGraph{T}A composite type for a spatially referenced directed graph. Vertices are spatially referenced based on a raster.
SpatialGraphs.WeightedRasterGraph — TypeWeightedRasterGraph{T}A composite type for a spatially referenced weighted graph. Vertices are spatially referenced based on a raster.
SpatialGraphs.WeightedRasterDiGraph — TypeWeightedRasterDiGraph{T}A composite type for a spatially referenced, weighted, directed graph. Vertices are spatially referenced based on a raster.