2/2/2024 0 Comments Netlogo gis![]() ![]() You can of course use this for real world raster data, but you need to shift the entire data so that you have your origin on your bottom-left, or you can use the GIS-Extension. Oddly, if your world is to small, there will be no error message but just a portion of the raster model presented in NetLogo.Īgain this workflow is fine as long as your model is abstract. for a 50 x 50 Raster map with cellsize 1, maxpxcor and maxpycor should be 49). Be sure also to set the NetLogo world with origins at the bottom-left, and use as maxpxcor and maxpycor the maxX and maxY of your Raster minus the cellsize (e.g. With mapValue being a numerical property of the patch which I am interested in. So I use this in my setup procedure putting something like: The procedure is adapted from what Railsback and Grimm have written in their forthcoming book on ABM which is simply GREAT and I advise to everybody.Īsk patch next-X next-Y Loading GIS data In this part of the model, after declaring the gisextension which is included by default in standard installations of NetLogo. txt you’ll see something like this:ģ)Read the text file in NetLogo. Box 6.2 NetLogo's GIS extension NetLogo's GIS extension provides support for reading both vector data (in the form of ESRI shapefiles) and raster data (in. Write.table(x,”data.txt”,sep=”\t”,col.names=FALSE,row.names=FALSE) I'm hoping I can limit the 'agents' to these polygons and base the number of them off of my population data. #write the output into a text file with tab separator, without putting any column name I'm working on a simple virus model in NETlogo, and attempting to integrate spatial data. #export the data value ( ) as the third column of the ame The extension provides primitives for importing vector GIS data (in the form of ESRI shapefiles) and raster GIS data (in the form of ESRI ascii grid files) into NetLogo. #Shift the coordinate by half the cell size #Extrapolate the coordinates of the cell centroid Now if you create a map in GRASS with cellsize 1 and extent max x and max y at 1 you will have only 1 cell.Ġ)Set up a GRASS region with 0,0 origin on the bottom-left.ġ)Create a raster model in GRASS and import in R as a SpatialGridDataFrame (via maptools or spgrass6 you can of course also create a model in R directly)Ģ)Export as text file using the following code (where “data” is the SpatialGridDataFrame): Thus in reality the absolute extent of the world is -0.5 to +1.5, with the actual cell size maintained to 1. This means that a world with max-pxcor and max-pycor set to 1 have actually four cells, with the coordinate of their centroids at 0,0 0,1 1,1 and 1,0. There is only one problem for this: NetLogo identifies the integer coordinates at its centroid and not on the bottom-left corner. What I want is to use a GIS (GRASS in my case) to create artificial landscape with some given statistical or geostatistical proprieties that I can import in NetLogo. 1 First, go to the NetLogo User Manual section on the GIS extension. I’ve been working mainly on abstract ABM, and I really don’t need all that bells and whistles, and besides I’ve had some problems when trying to handle the relation between the real coordinate system and NetLogo own system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |