[postgis-users] raster2pgsql command expansion issue?
jcpayne at uw.edu
Thu Aug 3 16:02:47 PDT 2017
I have been attempting to load a stack of rasters into PostGIS from a set of netcdf files.
I can load the files *individually* perfectly well. This works:
raster2pgsql -s 4326 -I -C -F -t 256x256 NETCDF:”/myPath/myFile.nc”:var myTable | psql (etc.) #SUCCEEDS (“var” is the netcdf variable of interest)
…but if I try to process *all* the files in the directory, using a wildcard, the “NETCDF:file:var” expression apparently doesn’t expand properly and it fails (I’ve tried it with quotes and that fails too).
raster2pgsql -s 4326 -I -C -F -t 256x256 NETCDF:/myPath/*.nc:var myTable | psql (etc.) #FAILS
raster2pgsql -s 4326 -I -C -F -t 256x256 NETCDF:”/myPath/*.nc”:var myTable | psql (etc.) #FAILS
I’ve figured out a workaround using a bash script to append files one at a time, but it’s sort of annoying that the one-liner fails when it seems to be so close to working. It seems like it might just be a bash expansion problem—does anyone know for sure?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the postgis-users