So, currently I have successfully compiled the program (with RInside) for plotting coordinates on the static maps of Google (on Qt).
Now, I have to plot the coordinates on the map as they are received from the GPS.
Is it possible somehow to display the newly plotted points on the png "on the fly"?
I mean I don't wish to read the png from the harddisk every time I receive a new point.
From here: http://cran.r-project.org/web/packages/png/png.pdf
This package provides an easy and simple way to read,write and display bitmap images stored in the PNG format. It can read and write both files and in-memory raw vectors.
Can this be of any help?
#include <RInside.h>
#include <Rcpp.h>
#include <iostream>
int main (int argc, char *argv[])
{
std :: cout << "\nThank-SO :-)\n";
RInside R (argc, argv);
std :: string txtA = "library(RgoogleMaps)";
std :: string txtB = "png(filename='Rg.png', width=480, height=480)";
std :: string txtC = "lat = c(40.702147,40.718217,40.711614)";
std :: string txtD = "lon = c(-74.012318,-74.015794,-73.998284)";
std :: string txtE = "center = c(mean(lat), mean(lon))";
std :: string txtF = "zoom <- min(MaxZoom(range(lat), range(lon)))";
std :: string txtG = "MyMap <- GetMap(center=center, zoom=zoom, markers='&40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc', destfile='My.png')";
std :: string txtH = "tmp <- PlotOnStaticMap(MyMap,lat=c(40.702147,40.711614,40.718217),lon=c(-74.015794,-74.012318,-73.998284),cex=1.5,pch=20,col=c('red', 'blue', 'green'),add=F)";
std :: string txtI = "dev.off()";
R.parseEvalQ (txtA);
R.parseEvalQ (txtB);
R.parseEvalQ (txtC);
R.parseEvalQ (txtD);
R.parseEvalQ (txtE);
R.parseEvalQ (txtF);
R.parseEvalQ (txtG);
R.parseEvalQ (txtH);
R.parseEvalQ (txtI);
return 0;
}
This is the C++
code written with RInside
.