Re,I would like to add that the University of Washington eScience Institutehas written lessons on Vector Data Processing using Python Tools.In the lesson on geopandas (https://geohackweek.github.io/vector/04-geopandas-intro/ ), you will find the use of a shapefile that describes all word oceans as 7 major entities.This file, named oceans.shp, has been created by the UW for ocean acidification studies.It can be downloaded with a wget as following:$ wget -N https://github.com/geohackweek/vector/raw/gh- pages/docker/data/oceans.{dbf, prj,qpj,shp,shx} Then by applying the gdal_rasterize command, you get a netCDF file.$ gdal_rasterize -of netcdf -a ID -te -180 -90 180 90 -tr 0.5 0.5 oceans.shp oceans.ncyou can then work with ferret:$ ferretyes? use oceans.ncyes? shade/pal=thirty_by_levels/lev=1d band1 ; go land Hope that will help.PatrickDe: "Patrick Brockmann" <patrick.brockmann@xxxxxxxxx.fr >
À: "ferret users" <ferret_users@xxxxxxxx>
Cc: "saurabh rathore" <rohitsrb2020@xxxxxxxxx>
Envoyé: Mercredi 24 Mai 2017 23:56:32
Objet: Re: [ferret_users] Re: regarding ocean basin mask / create mask from GIS shapefiles with gdal_rasterizeHi ferreters,NetCDF mask files can be created from GIS shapefiles with the gdal_rasterize command.This command creates very quickly a raster image from a vector layer and issmart enough to generate also a netcdf file.So the different steps will be:1) Identify a shapefile from a referenced source.For example, http://www.marineregions.org/downloads.php#iho for the Sea Areas defined by the International Hydrographic Organization.2) Inspect the downloaded shapefile file with a GIS software like gqis to identify the attribute you want to export.(show attribute table interface as described in https://docs.qgis.org/2.18/en/docs/user_manual/working_with_ )vector/attribute_table.html 3) Use the gdal_rasterize command line as following:$ gdal_rasterize -of netcdf -a ID -te -180 -90 180 90 -tr 0.5 0.5 World_Seas.shp IHO_Sea_Areas.nc--> will create a global netCDF file from the ID attribute at 0.5 resolution, the output variable will be named 'band1'Then open the netCDF file from ferret:yes? use IHO_Sea_Areas.nc
yes? shade/pal=thirty_by_levels/lev=1d band1 ; go land The version used is:$ gdal_rasterize --version
GDAL 1.11.3, released 2015/09/16RegardsPatrick--
Data Analysis and Visualization Engineer
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--