Create CovJSON files from common scientific data formats(e.g NetCDF)
If you already have netCDF4 and hdf5 installed, open up a command line and type the following:
$ pip install pycovjson
If not, you will need to download conda for your operating system, details of how to do this can be found here. After you have installed conda, type the following in the command line:
$ conda install netcdf4 $ pip install pycovjson
Command line interface:
pycovjson-convert accepts 6 parameters, and can be run as followed
$ pycovjson-convert -i *name of input file(NetCDF)* -o *name of output file* -v *variable* [-t] [-s] *tile shape as list*
On running the script, a CoverageJSON file will be generated.
pycovjson-viewer accepts up to 2 parameters:
$ pycovjson-viewer [*-v display variable information only*] on running will display information about the input file.
To be use in conjunction with pycovjson-convert.
$ pycovjson-viewer *name of netCDF file* $ pycovjson-convert -i melodies_landcover.nc -o coverage.json -v land_cover
Once pycovjson is installed, type the following at the top of your code:
Once imported you can then use the convert function within your projects.
pycovjson.convert('polcoms.nc', 'coverage.covjson', [sst])
This will generate a file called coverage.covjson in the directory where the script is located.
Currently only NetCDF is supported, but only the reader function would need to be changed, as the pycovjson loads data into python data structures before writing to CovJSON.
The project roadmap can be found here.