-6

From here:http://cran.r-project.org/web/packages/ggmap/ggmap.pdf

ggmap plots the raster object produced by get_map.

From here:http://cran.r-project.org/web/packages/ggmap/ggmap.pdf

get_map is a smart function which queries the Google Maps, OpenStreetMap, or Stamen Maps server for a map at a certain location at a certain spatial zoom. it is a wrapper for get_googlemap

From: http://qwt.sourceforge.net/class_qwt_raster_data.html

QwtRasterData defines an interface to any type of raster data

So, following way the data resultant from get_googlemap is saved in a rda file.

mapImageData <- get_googlemap (c (lon=-74.0087986666667, lat=40.7106593333333), zoom=15)
save (mapImageData, file="savedMap.rda")

Question:
Is it logical for me to think that savedMap.rda file here contains the raster data, therefore it can be displayed in QwtRasterData widget of Qt?

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411

1 Answers1

1

QwtRasterData is an abstract class that defines an interface to gridded data for display in the Qwt framework.

There exists a subclass, QwtMatrixRasterData that lets you create raster objects with actual values in them from a QVector of doubles using the setValueMatrix method.

You could write another subclass QwtRdaRasterData that defines the methods of the parent class to read data from a .rda object containing a saved object. It would have to know about the way that the object is saved, and read in the .rda file and store it in C++ objects.

You didn't think that just because the docs said "any type of raster data" that it meant "every type of raster data" did you?

Spacedman
  • 92,590
  • 12
  • 140
  • 224
  • You need to write a "translator" which provides a mapping between the different systems and representations. Qwt knows nothing about R, R knows nothing about Qwt. – Dirk Eddelbuettel Jul 27 '12 at 10:29
  • That works because svg is a standard / portable format (and even there I needed some polish and filtering) whereas rda is an internal R format nothing else uses. Hence the need for a mapping / translator I mentioned in my first answer. – Dirk Eddelbuettel Jul 27 '12 at 10:38
  • Is there any chance you could write up somewhere what it is you are trying to do, overall? You are clearly running into a number of roadblocks (about two per day!) which makes me think you are going about something the wrong way. Could you write a blog posting with the big picture? (Yes, I know I keep going on about it! The picture suddenly got even bigger when you mentioned Qwt...). – Spacedman Jul 27 '12 at 14:14
  • Yes, but why are you displaying on a Qt widget? Are you writing a Qt standalone program now? Maybe you can get the map data and do the plotting all in C++ with Qt rather than R. Why are you using R? Are you doing this for a project for other people, or is it just you? Maybe you'd be better off using a GIS package for this? – Spacedman Jul 27 '12 at 14:28
  • @AnishaKaul It seems to me you need some professional (commercial) support on this project. It shouldn't be hard to find the contact details for any of the people that have tried to help you until now. – Andrie Jul 27 '12 at 15:13
  • 2
    The fact that all your questions end up in extended discussions mean that StackOverflow is not the place for them. Its mostly for questions about programming problems with well-defined solutions. Your questions have deep architectural issues. – Spacedman Jul 27 '12 at 16:23
  • Its an almost-FAQ - the documentation for R's binary save format is the source code. If you want to transfer R objects to a different system use a different format - dump() or dput() perhaps, or CSV files. Now, how come we've got here from your original question? – Spacedman Jul 27 '12 at 19:56