# \[ANN\] SpatialGraphs.jl - Types and constructors for spatially referenced graphs

**URL:** https://discourse.julialang.org/t/ann-spatialgraphs-jl-types-and-constructors-for-spatially-referenced-graphs/71912
**Category:** Package Announcements
**Tags:** package
**Created:** [November 22, 2021, 8:30pm UTC](https://discourse.julialang.org/t/ann-spatialgraphs-jl-types-and-constructors-for-spatially-referenced-graphs/71912 "2021-11-22T20:30:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vlandau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vlandau/32/8986_2.png) [@vlandau](https://discourse.julialang.org/u/vlandau)
#### Post date: [November 22, 2021, 8:30pm UTC](https://discourse.julialang.org/t/ann-spatialgraphs-jl-types-and-constructors-for-spatially-referenced-graphs/71912/1 "2021-11-22T20:30:42Z")

</div>

## SpatialGraphs.jl

SpatialGraphs.jl establishes types and constructors for spatially referenced graphs, (e.g. where graph vertices correspond to pixels in a [raster](https://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/what-is-raster-data.htm)). The parent abstract type is an `AbstractSpatialGraph` , which is itself an `AbstractGraph`. SpatialGraphs.jl fully implements the Graphs.jl interface, so I’m hoping it will be useful for things like landscape connectivity and hydrology modeling since it extends the wealth of functions that Graphs.jl implements. It’s on track to be released on Thursday following the mandatory 3-day waiting period for new package registration.

Right now, SpatialGraphs.jl only supports raster-backed graphs, but I am planning to add support for vector/geometry-backed graphs as well (where nodes correspond to geometries).

GitHub Repo: [GitHub - Circuitscape/SpatialGraphs.jl: Types and constructors for spatially referenced graphs.](https://github.com/Circuitscape/SpatialGraphs.jl)

Docs: [About · SpatialGraphs.jl](https://docs.circuitscape.org/SpatialGraphs.jl/latest/)

A connectivity corridor modeled using SpatialGraphs.jl and Graphs.jl (see [the example](https://docs.circuitscape.org/SpatialGraphs.jl/latest/examples/) in the docs for more info):

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/f/5fe68cab289c781859cd2482b4259226c04a0edc.png)

---

<div class="post-metadata">

### Author: ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)
#### Post date: [November 23, 2021, 9:46pm UTC](https://discourse.julialang.org/t/ann-spatialgraphs-jl-types-and-constructors-for-spatially-referenced-graphs/71912/2 "2021-11-23T21:46:56Z")

</div>

What does this need to work on vector graphs? Just curious, because I could probably move an old project I did i R a couple of years ago. Geo tools in Julia have advanced a lot lately and it could be fun to see if I can switch it. I’ll take a look at the code when I have time.

---

<div class="post-metadata">

### Author: ![vlandau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vlandau/32/8986_2.png) [@vlandau](https://discourse.julialang.org/u/vlandau)
#### Post date: [November 23, 2021, 10:59pm UTC](https://discourse.julialang.org/t/ann-spatialgraphs-jl-types-and-constructors-for-spatially-referenced-graphs/71912/3 "2021-11-23T22:59:51Z")

</div>

I think it doesn’t need too much. I may just use a MetaGraph for vector-backed graphs (each vertex could have a property for its corresponding geometry?). That way other attributes could also be included in the graph and utilized for defining edges, filtering, etc.

---

<div class="post-metadata">

### Author: ![vlandau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vlandau/32/8986_2.png) [@vlandau](https://discourse.julialang.org/u/vlandau)
#### Post date: [November 23, 2021, 11:19pm UTC](https://discourse.julialang.org/t/ann-spatialgraphs-jl-types-and-constructors-for-spatially-referenced-graphs/71912/4 "2021-11-23T23:19:47Z")

</div>

So the main work required will be to have a type that enforces that the MetaGraph has a property for “geometry”, and to create associated constructor and utility functions.
