This project has moved and is read-only. For the latest updates, please go here.

NetCDF file in GdalRasterLayer

Topics: Data Access, SharpMap v0.9 / v1.x, WinForms Controls
Sep 17, 2013 at 7:44 AM
I have a NOAA Sea surface temperature rather file (*.nc). It contains three layers for different meaning,
I would like to raster the data in sharpmap V1.0.
Is there any way to use GdalRasterLayer function to raster the assigned layer on map?
I can read the data in QGIS and my sharpmap (with GDAL). In my code, the way I use GdalRasterLayer with NetCDF file like
SharpMap.Layers.GdalRasterLayer layer_DEM = new SharpMap.Layers.GdalRasterLayer("analysed_sst", relativePath + "");
note: analysed_sst is one of the NetCDF file's layer

sharpmap can open the NetCDF file, but the data, such as envelope, projection..etc, are wrong.

How could I use the correct command to do this??
Sep 17, 2013 at 8:40 AM
I'm not aware that you have to do special things with NetCDF files. Please, if you feel there is sth wrong, raise an issue and provide a sample.
Sep 17, 2013 at 9:12 AM
Edited Sep 17, 2013 at 9:14 AM
Dear FObermaier,
Here comes my setps:

First I download I NETCDF file via noaa website:


After unzip the file, I got a NETCDF file and rename it as

To check the data first, I opened the NETCDF file in QGIS

I found the NETCDF file contains three layers, and I would like to the "analysed_sst" data.

Assign the coordinate system wgs84

Finally, I got the rather pic.

Then I would like to get the same result in sharpmap. and I use the GdalRasterLayer method:
SharpMap.Layers.GdalRasterLayer layer_DEM = new SharpMap.Layers.GdalRasterLayer("analysed_sst", relativePath + "");
It doesn't show any wrong message, but it plot nothing.
I check the layer_DEM information in VS2012, it come with strange value,

I think sharpmap can open the file but get wrong message from it.

Could you help me to solve it?
Sep 18, 2013 at 10:35 AM
It seems like GdalRasterLayer does not read the bounds from the netcdf file.
Could you try to create a worldfile based on the information provided by the netcdf. Maybe Gdal picks that up
Sep 19, 2013 at 2:16 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 19, 2013 at 7:30 PM
Could you check if wrapping the netcdf in a virtual raster helps?