NetCDF file in GdalRasterLayer

Topics: Data Access, SharpMap v0.9 / v1.x, WinForms Controls
Sep 17, 2013 at 7:44 AM
Hello!
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 + "20130802.nc");
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??
Coordinator
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:

TEXT

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

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

Image
https://www.dropbox.com/s/i4l8vio4alf9jxv/Snapshot004.jpg
I found the NETCDF file contains three layers, and I would like to the "analysed_sst" data.

Image
https://www.dropbox.com/s/2s2761228dpawy3/Snapshot005.jpg
Assign the coordinate system wgs84

Image
https://www.dropbox.com/s/ynr0iatprr7jxsp/Snapshot006.jpg
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 + "20130802.nc");
It doesn't show any wrong message, but it plot nothing.
I check the layer_DEM information in VS2012, it come with strange value,
https://www.dropbox.com/s/u4ci28cqe6cp7v3/Snapshot007.jpg
Image

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

Could you help me to solve it?
Coordinator
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
Coordinator
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.
Coordinator
Sep 19, 2013 at 7:30 PM
Could you check if wrapping the netcdf in a virtual raster helps?