Hi, this is a tutorial on how to import and export Vector dataset in Netlogo. It could be helpful when you want to study a specific area, and you have the data in ArcGIS, for example a shapefile. In this post, you will learn how to import the data into Netlogo and run simulations with it, as well as how to export the data back to ArcGIS for further analysis. Note that this tutorial is for Vector data, if you are interested in using Raster dataset in Netlogo, please check my post on the Urban Growth Model. In this post, I will talk about how I developed a Schelling segregation model using the map of Washington DC. The model and data are available here: Netlogo has a GIS extension that allows us to read data files from GIS and copy the values to patches or turtles for simulation. I am using the following lines to load the Vector data into Netlogo. Note that by loading the shapefile, you will also load the attributes in the .dbf file and the projection information in the .prj file. Next, I drew the map on the display. To do that, I am using the following lines. In these lines I go through each vector-feature (each polygon), change the drawing color according to the SOC attribute, and then fill the polygon with the corresponding color. In the last two lines, I use gis:draw to draw the boundary of polygon data using white color. In Netlogo, we can not ask a polygon to perform anything. Therefore, in order to study the area, we need to copy the attributes into patches. To do that, I loop through each polygon and copy the color attribute to the patch at its centroid. In this way, I am using one patch to represent one polygon. Mind that you may need to have a larger size of Netlogo map, so that two centroids will not lay on the same patch. Since this is a segregation model, I have also found the neighbors of all polygons. ArcGIS has a tool called Polygon Neighbors. For each polygon, the tool finds all the polygons that have coincident edges with it, and reports the information in a table. I exported this file to a text file and deleted all the headers and labeling numbers. Then, I use the following lines to ask each patch that represents a polygon to read the file and set neighbors. After running the simulation, how do we export the final map into ArcGIS for further analysis? So far the GIS extension does not allow us to modify or create a vector dataset. My idea is to write the information into a text file, open it in ArcGIS, save it as a .dbf file, and replace the original .dbf file. Here are the codes I used to do that. The color information is stored in the patches that represent polygons. Therefore, I loop through those patches and ask them to write down their ID and then color. Note that more attributes could be easily included in the table if necessary. It does take an extra step to use this attribute table in ArcGIS. Simply open the text file in ArcGIS, save as .dbf, and replace the original one (remember to make a copy). Source.