Use tow shapefile to create one specie

14 views
Skip to first unread message

Etienne DELAY

unread,
Sep 22, 2017, 3:51:33 AM9/22/17
to GAMA
Hi
I have 2 shapefiles (both containing points) and I would like to use both of them to populate my species. So, I want to add `additional_wp_shapefile` to my `ponds` species.


global {
   
/** Insert the global definitions, variables and actions here */
   
// Hyrdolic zones where agents
    file hydrolique_shapefile
<- file("../includes/region_hydrique/regions_hydrique.shp");
    file ponds_shapefile
<- file("../includes/mares/Mare.shp");
    file additional_wp_shapefile
<- file("../includes/mares/water_point_nasegeo.shp");
    file ndvi1980
<- file("../includes/ndvi_ferlo/gimms198201_32628.tif"); // Vertical 250 km Horizontal 450km mais plus 350km
   
    geometry shape
<- envelope(ndvi1980); // defined the agent size world
   
// If I use grid the envelope need to be the grid
   
int nb_faction <- 20 min: 10 max: 1000 parameter: true; //How many camp we initialize
   
int perception_distance <- int(8 #km); // distance to target food
   
   
    init
{
        active_cells
<- cells where (string(each.ndvi) != "NaN");
        create region_hydro
from:hydrolique_shapefile with:[id::int(read("id"))];
        create ponds
from:ponds_shapefile; // I would like to had
     
}
 
}

E.

Patrick Taillandier

unread,
Sep 22, 2017, 3:57:36 AM9/22/17
to gama-p...@googlegroups.com
Hi,

You can just use it to create ponds agents:

    init{
        active_cells 
<- cells where (string(each.ndvi) != "NaN");
        create region_hydro 
from:hydrolique_shapefile with:[id::int(read("id"))];
        create ponds 
from:ponds_shapefile; // I would like to had 
        create ponds from:additional_wp_shapefile ; // I would like to had 
     
}

Cheers,

Patrick

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at https://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

Alexis Drogoul (IRD)

unread,
Sep 22, 2017, 3:58:33 AM9/22/17
to GAMA
Hi Etienne,

You could probably use something like:

create ponds from:ponds_shapefile + additional_wp_shapefile;

as the two containers are simply lists of geometrical shapes + geospatial information. Tell me if this works (it should, but I dont remember having tested it).

Alexis



Representative of IRD in Vietnam and Philippines 
http://en.vietnam.ird.fr  
Senior Researcher, co-director, UMI UMMISCO 209, IRD & UPMC, France. http://ummisco.fr  & ICTLab, USTH, Hanoi, Vietnam http://ictlab.usth.edu.vn 

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

Etienne DELAY

unread,
Sep 22, 2017, 4:05:26 AM9/22/17
to GAMA
Whooo both solution are working !

Thank you !

E.
Reply all
Reply to author
Forward
0 new messages