# Loading vector data to Gridspace in Agents.jl

**URL:** <https://discourse.julialang.org/t/loading-vector-data-to-gridspace-in-agents-jl/106459>\
**Category:** Geo\
**Tags:** question, agentsjl\
**Created:** [November 20, 2023, 12:04pm UTC](https://discourse.julialang.org/t/loading-vector-data-to-gridspace-in-agents-jl/106459 "2023-11-20T12:04:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![imantha](https://avatars.discourse-cdn.com/v4/letter/i/6a8cbe/32.png) [@imantha](https://discourse.julialang.org/u/imantha)\
**Post date:** [November 20, 2023, 12:04pm UTC](https://discourse.julialang.org/t/loading-vector-data-to-gridspace-in-agents-jl/106459/1 "2023-11-20T12:04:10Z")

</div>

Hi,  
I am wondering whether there is a way in Agents.jl to load vector data (using perhaps `.shpfile`) to something like Grid space. Or is this possbile with open street map space?

For context, what I am trying to do is make an ABM for covid where agents will be in a particular region (postal code) and will interact with other agents and infrastructure in other regions.

![sing_postalcode](https://global.discourse-cdn.com/julialang/original/3X/d/9/d92eda9ede8adf83921ebb84674583c3989b8a66.png)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [November 20, 2023, 12:08pm UTC](https://discourse.julialang.org/t/loading-vector-data-to-gridspace-in-agents-jl/106459/2 "2023-11-20T12:08:50Z")

</div>

I don’t know about Agents.jl but you can easily load the shapefile with [GeoIO.jl](https://github.com/JuliaEarth/GeoIO.jl), and call the [Rasterize](https://juliaearth.github.io/GeoStatsDocs/stable/transforms.html#Rasterize) transform to create the grid, which you can save back to disk and load with Agents.jl (if it already supports grid formats).

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [November 20, 2023, 1:13pm UTC](https://discourse.julialang.org/t/loading-vector-data-to-gridspace-in-agents-jl/106459/3 "2023-11-20T13:13:58Z")

</div>

If the relative size of each of the counties is what matters, I wouldn’t even use a grid space; I would use a GraphSpace. Each node is a county. The larger the county the more agents stored in the particular node.
