[Thread Prev][Thread Next][Index]

Re: [ferret_users] Re: regarding ocean basin mask / create mask from GIS shapefiles with gdal_rasterize



Thank you James and Patrick. Both the suggestions are promising. Thanks a lot. I will try both the methods.
regards, saurabh

On Thu, May 25, 2017 at 8:35 AM, Patrick Brockmann <patrick.brockmann@xxxxxxxxxxxx> wrote:
Re,

I would like to add that the University of Washington eScience Institute
has written lessons on Vector Data Processing using Python Tools.

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:


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.nc

you can then work with ferret:
$ ferret
yes? use oceans.nc
yes? shade/pal=thirty_by_levels/lev=1d band1 ; go land




Hope that will help.
Patrick


De: "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_rasterize

Hi 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 is
smart enough to generate also a netcdf file.

So the different steps will be:

1) Identify a shapefile from a referenced source.
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.

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/16


Regards
Patrick
--
Data Analysis and Visualization Engineer
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--




--


REGARDS

Saurabh Rathore
Research Scholar (PhD.)
Centre For Oceans, Rivers, Atmosphere & Land Science Technology
Indian Institute Of Technology, Kharagpur
contact :- 91- 8345984434

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement