Importing GIS shape file in NetLogo

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Importing GIS shape file in NetLogo

NetLogo-Users mailing list
Hi All,
 

 I am trying to upload a .shp file into NetLogo as below. I created a button "load" in order to be able to run the code and load the .shp file which is a map generated with ArcMap GIS. However, there is an error I get and I an unable to find a solution to the problem. I am really new to NetLogo and your help is much appreciated. Thank you in advance.
 

 extensions [ gis ]
 

 to load
   
   ca
   let view gis:load-dataset "/Applications/NetLogo 5.3.1_Map.shp"
   gis:set-world-envelope gis:envelope-of view
   foreach gis:feature-list-of view
   [
     gis:set-drawing-color white
     gis:draw ? 1.0
   ]
 end
 

 and this is the error I get
 

 Extension exception: shapefile /Applications/NetLogo 5.3.1_Map.shp not found
 error while observer running GIS:LOAD-DATASET
   called by procedure LOAD
   called by Button 'load'
 

Reply | Threaded
Open this post in threaded view
|

Re: Importing GIS shape file in NetLogo

NetLogo-Users mailing list
Maybe you try following this post:


http://stackoverflow.com/questions/32955515/netlogo-shapefile-versus-raster


Also, try moving the shape and your model to a different folder.


Thales


On Tue, Apr 26, 2016 at 5:37 PM, [hidden email] [netlogo-users] <
[hidden email]> wrote:


>
>
> Hi All,
>
>
> I am trying to upload a .shp file into NetLogo as below. I created a
> button "load" in order to be able to run the code and load the .shp file
> which is a map generated with ArcMap GIS. However, there is an error I get
> and I an unable to find a solution to the problem. I am really new to
> NetLogo and your help is much appreciated. Thank you in advance.

>
>
> extensions [ gis ]
>
>
> to load
>
>
>
>   ca
>
>   let view gis:load-dataset "/Applications/NetLogo 5.3.1_Map.shp"
>
>   gis:set-world-envelope gis:envelope-of view
>
>   foreach gis:feature-list-of view
>
>   [
>
>     gis:set-drawing-color white
>
>     gis:draw ? 1.0
>
>   ]
>
> end
>
>
> and this is the error I get
>
>
> Extension exception: shapefile /Applications/NetLogo 5.3.1_Map.shp not
> found
>
> error while observer running GIS:LOAD-DATASET
>
>   called by procedure LOAD
>
>   called by Button 'load'
>
>
>
>






--
*Thales A. P. West*
Ph.D. Candidate
School of Natural Resources and Environment
University of Florida
www.thaleswest.weebly.com
Reply | Threaded
Open this post in threaded view
|

RE: [EXTERNAL] [netlogo-users] Importing GIS shape file in NetLogo

NetLogo-Users mailing list
In reply to this post by NetLogo-Users mailing list
I think you have a typo in your code.






The line






let view gis:load-dataset "/Applications/NetLogo 5.3.1_Map.shp"






Should point to the actual file. Is your map in the /applications folder? If not, copy the path name exactly and put it in quotes.






Best,


Todd






________________________________
From: [hidden email] [[hidden email]]
Sent: Tuesday, April 26, 2016 4:37 PM
To: [hidden email]
Subject: [EXTERNAL] [netlogo-users] Importing GIS shape file in NetLogo






Hi All,




I am trying to upload a .shp file into NetLogo as below. I created a button "load" in order to be able to run the code and load the .shp file which is a map generated with ArcMap GIS. However, there is an error I get and I an unable to find a solution to the problem. I am really new to NetLogo and your help is much appreciated. Thank you in advance.




extensions [ gis ]




to load






  ca


  let view gis:load-dataset "/Applications/NetLogo 5.3.1_Map.shp"


  gis:set-world-envelope gis:envelope-of view


  foreach gis:feature-list-of view


  [


    gis:set-drawing-color white


    gis:draw ? 1.0



  ]


end




and this is the error I get




Extension exception: shapefile /Applications/NetLogo 5.3.1_Map.shp not found


error while observe r running GIS:LOAD-DATASET


  called by procedure LOAD


  called by Button 'load'






Reply | Threaded
Open this post in threaded view
|

Re: Importing GIS shape file in NetLogo

NetLogo-Users mailing list
In reply to this post by NetLogo-Users mailing list
Thank you Todd and Thales! I managed to do it eventually.

 Octavian
Reply | Threaded
Open this post in threaded view
|

Re: Importing GIS shape file in NetLogo

Jozef
Hi Octavian,

I am currently struggling with the same issue here. Could you maybe let me
know what you did to fix it?

Best,

Jozef



--
Sent from: http://netlogo-users.18673.x6.nabble.com/