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

Argument vec in vec2mat #2

Open
bniebuhr opened this issue Mar 19, 2024 · 1 comment
Open

Argument vec in vec2mat #2

bniebuhr opened this issue Mar 19, 2024 · 1 comment

Comments

@bniebuhr
Copy link
Contributor

Just thinking we should not describe the argument vect in the function vec2mat as a vector, since (in R) I guess this is a matrix? What is the best way to describe it between R and Julia terminologies?

@ninbrm
Copy link
Member

ninbrm commented Mar 19, 2024

There are two functions: (1) mat2rast and (2) vec2mat, which can be nested/piped to produce a raster from a vector. (1) mat2rast takes a matrix (corresponding to the grid) and converts it to a spatial raster simply by setting the extent and projection, most ConScape functions in Julia can return a matrix. (2) vec2mat projects a vector of node values onto the grid (or matrix).

Internally, ConScape.jl uses an aspatial network representation for most computations. It is the Grid-structure that stores the link between the nodes on the network and their location in space on a spatial grid. ConScape can handle both grid networks (most of our use-cases so far) and general networks. Node values on the grid can be represented as a matrix or as a raster, whereas for the general network the node values are represented as a vector. Most functions can return a matrix, if nodes have only a single value. However, when nodes have multiple values (such as pair-wise distances between nodes), then the matrix of such pairwise distances is returned, and a single column (or row) can be converted to a matrix (and raster) to obtain a distance map corresponding to that specific target (or source) node.

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