Home >> Forums >> release and recruited zone from shapefile?

release and recruited zone from shapefile?

Hi,
I would like to know if there is a way to import release/recruitment zones from a shapefile or the only way is to set it up manually? 
thank you in advance

Ichthyop version: 
Ichthyop 3.3alpha
Hydrodynamic dataset: 
MOHID
Operating system: 
Windows 10

Hi Bertrand

I have started to implement the reading of shapefiles in the definition of release/recruitment zones. However, it is not finished yet.

In the time-mean, if you want you can send me your shapefile and I can convert it into the format expected by Ichthyop.

Nicolas

Hi Nicolas,
Thank you for answering. When do you excpet that the reading shapefile option would be operational on Ichthyop? Meanwhile, I attached the shapefile of the release-recruitment polygons I need to use in ichthyop.
Thank you in adavance 

Hi again Bertrand

Can you please provide additional informations about your shapefile?

- Are all the zones release zones?

- Should the release be at the surface or over a water layer (if so, what are the depth levels of the layer)?

Thanks

Nicolas

Hi Nicolas,
Thank you so much for your help. So, I would like:
- one recruitment file (with all the zones as recruitment zones and all activated)
- one release file (with all the zones as release zones but I will activate only one release zone for each simulation).
I also assume that the convert file (shapefile to ichthyop like file) you will send can be edited later with the ichthyop GUI or manually by text editor? If yes, I just need one of the file that I mention above. 
Thanks again 
 

Hi again Bertrand

You will find enclosed ~600 xml files.

Each file contains:

- All your zones set as recruitment zone

- One of these zone set as release zone

(I suppose you are making connectivity studies?)

I also join the python script which I have used.

Please let me know if it works as you expect

Nicolas

Attachments: 

Hi Nicolas,
Thank you, all the polygons seem to be there and at the right place. Nevertheless, I would like to know how the script asign the index number to the polygons (based on coordinates?). Because the shapefile have a table of atributes with a specific polygon order and this order is no more respect in the transformed xml files. 
Thank you in advance

Hi Bertran

Is the index you speak about the record with values "19556, 19081, 19035, 19036, 19037, 19199, etc"?

The sorting was made depending on the order in which it is stored in the shape file. But if you want, I can re-make the shapefile by replacing the index 0, 1, etc. by the proper indexes 19556, 19081, 19035

Nicolas

Hi Nicolas,
The problem was that I sent you the wrong shapefile (the attribute table was not edited). But yes, it would be very nice that the zone name (e.g. 'recruitment index 0') correspond to the attribute table name and ID (e.g. 'recruitment Isla Contoy offshore 1'). Because it will be easier for me to have control on simulations and realize connectivity matrix analysis. 
Thank you in advance

Attachments: 

Hi Bertrand

I will have a look at it asap (I am busy at this time). But I need one more information: would you like one big file with all the zones (each zone set as both recruitment and release), or one file per release zone (as I did previously)?

Nicolas

Hi Nicolas,
Thank you for your support, one big file would be nice (but with all the release zone desactivated and the recruitment zones activated). 
Thank you in advance

Hi again Nicolas,
I was trying to make a matlab code (basing on your python code) to transformed shapefile into ichthyop like file (one big file with all release and recruitment polygons, asociated with id and names). The structure I obtain seem identical to the files your sent me, but I can't open it in ichthyop. When you have time, could you please check it and tell me what is wrong...
I attached you the matlab code (the shapefile is the last one I sent you) and the xml file I obtain. 
Thank you in advance

Attachments: 

Hi Bertrand

I think the error might be due to the line_inshore repeated twice instead of once:

    fprintf(fid, '      <line_inshore>0.0</line_inshore>\n');
    fprintf(fid, '      <line_inshore>0.0</line_inshore>\n');
 

It should be:

    fprintf(fid, '      <line_inshore>0.0</line_inshore>\n');
    fprintf(fid, '      <line_inshore>0.0</line_offshore>\n');

I enclose the modified Python script and my xml file, which seems to work.

Nicolas

Attachments: 

Hi Nicolas,
Thank you very much for your time. The matlab code works well and Ichthyop can read it !
Best regards