![]() #NETLOGO BREEDS PATCH#min/max-pxcor/pycor are the minimum and maximum patch coordinates, not the minimum and maximum turtle coordinates. I know the GIS extension documentation recommends gis:set-world-envelope (list min-pxcor max-pxcor min-pycor max-pycor), but I have to wonder if it's actually correct. It looks like the farther from the origin, the worse the discrepancy is, like the error is radiating out from the origin. Nice screen shot, thanks for providing that, it makes the problem easy to grasp. Gis:set-world-envelope (list min-pxcor max-pxcor min-pycor max-pycor) Set hr-dataset gis:load-dataset "C:/Program Files (x86)/NetLogo 5.0.4/homerange-rgdal.shp" #NETLOGO BREEDS DRIVER#R:eval "writeOGR(homerange, '.', 'homerange-rgdal', overwrite_layer = TRUE, driver = 'ESRI Shapefile')" R:eval "homerange <- mcp(spdf, percent = 100)" R:eval "spdf <- SpatialPointsDataFrame(turtles, turtles)" R:eval "turtles <- rbind(turtles, turtle)" R:eval (word "turtle <- ame(turtle, Name = '" Name "')") merge the Name, X- and Y-lists of all females to one big ame The whole code is pretty long so I've attached some snippets below that are most relevant. Does anybody know if I'm doing something wrong or if it is error inherent to exporting and then importing a shapefile for which no projection exists? Any help here would be great because having them align would solve several issues, including the previous post. I've tried gis:set-world-envelope (list min-pxcor max-pxcor min-pycor max-pycor) but to no avail. The attached image shows this, where the blue outlines are from the imported shapefile. All works well except that the imported shapefile does not align perfectly with the original polygons. The process of creating the MCP, exporting, and importing is done at each time step because the territory updates each tick. That is, I can use gis:intersecting to give a variable to those patches that fall within the GIS-imported polygons. My rationale for this is related to this question I posted before (NetLogo - applying values to patches within polygons). ![]() I then import the GIS file back into NetLogo using the GIS extension. I then use the R extension in NetLogo to create a minimum convex polygon (MCP) surrounding each territory and export those polygons as a shapefile. I've got a NetLogo model in which each animal occupies a "territory", wherein all patches that belong to the animal are the same color as the animal. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |