[gdal-dev] Reading a NetCDF file with python (not recognised as a supported dataset name

Rutger kassies at gmail.com
Mon Jun 11 07:27:52 PDT 2012


Hey,

I installed the latest OSGeo4W version (as mentioned in the quickstart at
the website: http://download.osgeo.org/osgeo4w/osgeo4w-setup.exe). 
During installation i unchecked every package except GDAL. The OSGeo4W shell
mentions "GDAL 1.9.1, released 2012/05/16" as the version.

I should have off course removed the subdataset when opening, my bad. The
error message changes from:
/ERROR 4: `NETCDF:trmm.nc:soil_moisture_x' does not exist in the file
system,
and is not recognised as a supported dataset name./

to:
/ERROR 4: `trmm.nc' not recognised as a supported file format./

It maybe rules out that the subdataset reference is the issue, but opening
the actual file is.

I also tried loading the netCDF-driver in Python, this returns a 'None'. In
the OSGeo4W shell i started python and did:
/D:\>python
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
>>> driver = gdal.GetDriverByName('netCDF')
>>> print driver
None
>>> driver = gdal.GetDriverByName('Gtiff')
>>> print driver
<osgeo.gdal.Driver; proxy of <Swig Object of type 'GDALDriverShadow *' at
0x00D680F8> >
>>>/

I dont know if reading and writing is done by the same driver. Is there a
way to test which GDAL version/installation my Python 2.7.2 imports. I only
have the Python bindings for 1.9.1 installed. But i probably have other GDAL
installations which ship with other programs (like QGIS).

Thanks again!


Regards,




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Reading-a-NetCDF-file-with-python-not-recognised-as-a-supported-dataset-name-tp4979943p4980406.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list