![]() Designing The Modelįor this task, you'll want to select an area that you have data for and than can be represented in a relatively small number of pixels (i.e. Take a look at each of these examples and I recommend saving your own copy of them with comments. This is a rather interesting example but I think creating rasters can be better done in a GIS application. The "GIS Gradient Example" shows how to access the values within rasters, create new rasters, and move turtles based on raster values. The "GIS General Examples" shows how to load and render various types of GIS data into the NetLogo interface. In NetLogo, to to "Models Library -> Code Examples -> GIS". There are only a couple of examples available for the GIS extension. You can detect these in NetLogo with: if ((gx = 0)) and ((gy = 0)) if this is true, the values gx and gy are valid The GIS Examples This occurs with values generated on computers, for instance when zero is divided by zero (0/0). Note that here we are using "let" to create the variables instead of "set" for variables that are already defined. You can also get values based on a turtles position as in the code below: let h gis:raster-sample raster self "raster" is the name of the variable containing the raster and "gx" is the variable to be set to the pixel value. ![]() I have not explored accessing vector data within NetLogo but the code below will access the raster values where "x y" is the horizontal and vertical location of the desired pixel. Note that the loading of shapefiles and raster files is similar but the command "draw" is used to render vector data (shapefiles) and "paint" is used to render rasters into the view. Gis:set-world-envelope gis:envelope-of elevation Set elevation gis:load-dataset "data/local-elevation.asc" The code below will load three raster files and then display each one based on a different button press. Set countries-dataset gis:load-dataset "C:/ProjectsModeling/NetLogo/cntyoutl/CNTYOUTL.SHP" The code below load a shapefile on setup and then display it when the "display-countries" button is pressed. The GIS extension for NetLogo allows you to load and display GIS information in ASCII Grid files and shapefiles. In this lab you will use the GIS extensions to NetLogo to create a spatially-explicit model in an existing landscape. It does not store any personal data.Lab: Spatially-Explicit Agent Based Model Using NetLogo GIS Extensions The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. The cookie is used to store the user consent for the cookies in the category "Performance". This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. The cookies is used to store the user consent for the cookies in the category "Necessary". The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". The cookie is used to store the user consent for the cookies in the category "Analytics". ![]() These cookies ensure basic functionalities and security features of the website, anonymously. Necessary cookies are absolutely essential for the website to function properly.
0 Comments
Leave a Reply. |