1

I have a shapefile of el Congo River Basin dy area. Attributes information is just area. Actually I want create a mask with ones in the river basin and ceros outside to just used later in IDL or matlab a mask of the Congo. How can I built a proper mask file (1 inside the congo, o outside) using this shapefile in Arcgis or QGIS ?

I downloaded here: http://hydrosheds.cr.usgs.gov/datadownload.php?reqdata=30bass a shp from the rivers basin of Africa, I selected the congo river basin and I need to convert the whole Africa or just the selected area to a mask of netcdf like a basemap to use later in IDl normally is a matrix of 1 inside the river basin and ceros outside. Thansk !!!!

1 Answer 1

1

You'll need to convert your shapefile to a raster format, (adding a new field and setting the value to 1), but txt or NetCDF is not necessary if you then use IDL or Matlab : a tif file (for example) would be fine. IDL reads TIFF directly and you can use imread in Matlab.

In ArcGIS : Feature to raster

In QGIS : Rasterize

Note that you can then convert to NetCDF using gdal_translate (also accessible from QGIS with Raster menu - Conversion - Translate (Convert format)) or Raster to NetCDF in ArcGIS. I would not use a txt even if the conversion is possible in ArcGIS (raster to ascii) and in QGIS, because there are many txt format and I don't know which one to use.

4
  • Thank you !!! but I just need a matrix of 0 and 1 thus I can use it as basemap for a model that runs in IDL but it need to be in .nc or .txt Commented Jun 4, 2015 at 14:10
  • you can create the netcdf with gdal_translate as I mentioned in my answer.
    – radouxju
    Commented Jun 4, 2015 at 14:45
  • should I first rasterize ? Commented Jun 4, 2015 at 14:46
  • yes : first you rasterize and the you convert to netCDF.
    – radouxju
    Commented Jun 4, 2015 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.