shp to topojson conversion : no output - dictionary

Topojson's doc states:
You can specify ESRI shapefiles as input:
topojson -o output.json input.shp
My .shp file is valid, npm and topojson are installed, and I'am in the input file's directory (cd). This topojson command simply doesn't work on my side, no output, nor feedback produced.
How do you convert shp into topojson on your side ?
which topojson gives /usr/local/bin/topojson
which ogr2ogr gives /usr/bin/ogr2ogr
On ubuntu 13.04, but I think my issue is not related to ubuntu.

Nodesjs was corrupted, I had to remove, clean up, then reinstall nodejs & topojson. See this overflow

Related

Doxygen doesn't generate Qt compressed help file

I tried generating a Qt compressed help file thanks to this article: http://blog.qt.io/blog/2014/08/13/qt-weekly-17-linking-qt-classes-in-documentation-generated-with-doxygen/
Unfortunately, no qhc file is generated as specified.
I notice this error in the output log:
sh: epstopdf: command not found
error: Problems running epstopdf. Check your TeX installation!
Is this article out of date?

How can I preview .Rd documentation files in R?

I would like to be able to open up an .Rd documentation file and preview it in R.
For example, I can create a data documentation file using promptData:
df <- data.frame(var1=1:5,var2=6:10)
promptData(df,filename = "df_doc.Rd")
which will produce a documentation file "df_doc.Rd" in the working directory.
In order to preview this file, I can open it up in the RStudio editor and then hit "Preview", which will open up df_doc properly formatted in the Help window. However, I'd like to be able to do that with code rather than having to open up the file and hit the Preview button in the RStudio GUI. Something like a preview("df_doc.Rd") function.
I'm aware that there are ways to 'install' the documentation files so R knows where to find them. But I'm writing some code that will generate these files automatically and preview them (hopefully without having to load in the dev tools that install the documentation files), so I'm specifically hoping to be able to preview these directly from file. Is that possible?
Man, the documentation for this one was pretty well hidden! To be fair, "Rd" isn't exactly Googleable, nor is documentation about documentation. But I managed to scrounge it up.
What I've been looking for is the
previewRd('df_doc.Rd')
command in the rstudioapi library. Unfortunately, this only works in RStudio, so if I want it to be generally usable I'll need to write HTML directly instead of Rd and open that in a browser.
According to 'Writing R Extensions', run:
R CMD Rdconv -t html filename.Rd > filename.html
in the command line. See also:
R CMD Rd2pdf --help
In R: system("R CMD Rdconv -t html filename.Rd > filename.html | chromium-browser")

R script to check if my zip folder is corrupt

There is a python testzip() module to check if a zip file is corrupt in python. However i want to know it's parallel in R as well.
How to check if a zip folder is corrupt by writing a small script in R ?

How can I read gzip compressed grib files in R?

I am trying to open MUlti-sensor precipitation data from eumetsat in R. I can get these data only using GZIP compression method and data format type is GRIB. When I download data I get tar file.
How can I open these data in R?
I tried to use code
> untar("1098496-1of1")
but got error message
Error in gzfile(path.expand(tarfile), "rb") : cannot open the connection
In addition: Warning message:
In gzfile(path.expand(tarfile), "rb") :
cannot open compressed file '1098496-1of1', probable reason 'No such file or directory'
but I when I use next code:
> dir.create("rainfalldataeumetstatR")
> getwd()
[1] "C:/Users/st/Documents"
> untar("1098496-1of1.tar")
> untar("1098496-1of1.tar", files="rainfalldataeumetstatR")
> list.files("rainfalldataeumetstatR")
I don't get some files in my directory and get answer:
character(0)
May be that error appears because files in tar zip are gz archives?
I, too, have grappled with opening GRIB files in R. You have several problems and can tackle them one by one.
For the untar and gzip issues, work from the command line. I don't know how the tar package is built/packaged from Eumetsat; does it create a directory and put all the data files in that directory? In that case, put the tarball in a top-level data directory and then
tar xvf tar_file_name
cd (to the directory that was just created)
gunzip *.gz
Note down the full path name of the files you will want to open for later use.
Are the files in GRIB1 or GRIB2? If in GRIB1, you need to install wgrib. If in GRIB2, you need to install wgrib2. Both are available from NCEP.
You can download them from:
http://www.cpc.ncep.noaa.gov/products/wesley/
In R, 3.1 and later, you install the rNOMADS package 2.0.1 and later.
NOAA National Operational Model Archive and Distribution System (NOMADS) distributes global grid data in GRIB format (currently in GRIB2).
rNOMADS helps you open GRIB1 and GRIB2 data in R by calling wgrib or wgrib2 to decode the binary GRIB data and pipe it (in csv format) for R to read in.
Open up R, load up rNOMADS, and then call the ReadGrib routine using the full path name of your data file in "data_file_name". This is not the way described in the rNOMADS documentation, but it works.
Installing wgrib and wgrib2 is the only hard part and it may not even be that hard, depending on your system. I'm writing tutorials on how to install wgrib, wgrib2 and use rNOMADS with local data files. When I am done, they will be posted here:
http://rda.ucar.edu/datasets/ds083.2/#!software
Now for some bad news:
You need to open each file sequentially. But, you can extract and save the subfields you need, and then read in the next datafile, overwriting the large data structure into which you read the previous file. If that is too much of a PITA, have you considered using the GRADS tool for displaying GRIB data?
There is no native way to read grib files into R. Use wgrib or wgrib2 depending on whether your file is in grib or grib2 format. I am the package manager for rNOMADS - and trust me, we tried to figure out a simple R way, and ended up dropping it. Maybe the folks at NCEP will do it someday, but it's out of our skill range.
Personally I untar my files using cygwin also because the wgrib package in cygwin will allow you to get an inventory file so you can tell R what data is contained in each layer. Under the assumption the data is grib1 r can read it directly. Grib2 requires wgrib2 on your machine, RNomads is working on that challenge.
Alright I recently found a great website that shows how to install wgrib so that it can run in R in conjunction with rNOMADS.
https://bovineaerospace.wordpress.com/2015/04/26/how-to-install-rnomads-with-grib-file-support-on-windows/#comments

Convert grib to netcdf file

Is there a way to convert a grib file into a NetCDF format on Windows?
I use a software named tkdegrib but it catches one argument by one argument whereas I want all my grib's arguments in the same file.
Unfortunately, I can't use Linux.
I would use Unidata's NetCDF-Java library.
It reads GRIB and GRIB2 files (as well as many others), and can write NetCDF files. And since it's Java, you don't have to build anything, and it works on all platforms. There is a ToolsUI application that you can use if you want a GUI, but more likely you want to do it from the command line using something like this:
java -Xmx512m -classpath netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset -in infile.grib2 -out outfile.nc
Good luck!
1. Climate data operators
If you have Windows 10 installed, it is now very easy to simply install ubuntu directly under windows as a subsystem (no wineserver or cygwin required), and then you can install CDO very easily with
sudo apt install cdo
once done you can do:
cdo -f nc copy file.grb file.nc
2. ECCODES
ECMWF has developed a new package called eccodes which includes command line operators for this kind of task. This is the preferred method if you have grib data with more than one time axis such as S2S output, where you have the time of the forecast start and the forecast step and possibly even the hindcast start date. In those cases CDO fails.
You can install it under windows using this guide:
https://confluence.ecmwf.int/pages/viewpage.action?pageId=70949236
Or easily on the linux subsystem with sudo apt-get (on MAC OSX you can install with: brew install eccodes).
Then from the subsystem command line you can simply type:
grib_to_netcdf -o out.nc in.grb
There is GDAL utility gdalwarp, which can convert grib dataset into netCDF dataset.
The command for conversion is
gdalwarp -overwrite -to SRC_METHOD=NO_GEOTRANSFORM -t_srs EPSG:4326 input.grb -of netCDF output.nc
For more options of this utility can be searched on this link.

Resources