On Mon, Feb 11, 2013 at 9:31 AM, Tom Roche <Tom_Roche@pobox.com> wrote:

>
> Tom Roche Sun, 10 Feb 2013 14:40:05 -0500
> >> $ ls -alh ./METCRO3D_080101
> >> -r--r--r-- 1 me mygroup 5.3G Jan  8 11:32 ./METCRO3D_080101
> >> # extension used below
> >> $ ln -s ./METCRO3D_080101 ./METCRO3D_080101.nc
> ...
> >> raster('./METCRO3D_080101.nc', varname='ZF')
> ...
> >> Error in .local(.Object, ...) :
> >>   `[METCRO3D_080101]' not recognised as a supported file format.
>
> Robert J. Hijmans Sun, 10 Feb 2013 13:53:56 -0800
> > ncdf files are indeed recognized by their extension (".NC",".CDF",
>
> I was able rename the above file and subsequently load it with
> `raster`, but only after copying the above file to my homespace :-(
> which is generally unfeasible due to size.
>
> > I might add further checks that do not depend on the extension.
>
> Or perhaps merely add a flag allowing the user to {assert, vouch for}
> the file's netCDF-ness? Why I ask:
>
> Files such as the above are generated by a production model of long
> standing (~20 years), which moreover generates many other netCDF files
> with the same naming convention ("<8 char description/>_<timestamp/>"
> with no extension). Hence a request by me for a more appropriate
> naming convention seems unlikely to be adopted, and would not help
> work with many years of legacy output. Moreover these outputs are
> usually quite large (i.e., tens of GB or more), and usually generated
> to shared directories with restricted permissions. Hence it would be
> quite desirable to enable current `raster` code to either
>
> * respect the extension of a symlink
>
> * take a runtime flag, e.g. 'format=CDF'
>

That is reasonable. I was thinking of inspecting the file for ncdfness if
gdal does not like it.
For now, the workaround you can use is this function

raster:::.rasterObjectFromCDF(filename, varname='', band=NA,
type='RasterLayer', lvar=3, level=0, warn=TRUE, ...)



> If there is somewhere to make a feature request, please let me know.
>

You just did. You can also make these on R-Forge.


>
> TIA, Tom Roche <Tom_Roche@pobox.com>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

