Raster map versus alternative

I recently found this Crime page in the center of Houston , which I am interested in playing. This is my first experience in teaching mapping in R and therefore lacks the vocabulary and understanding necessary to make appropriate decisions.

At the end of the page, David Cale states:

The last question may be useful. When creating these views, you might be tempted to use the map raster file itself as a background. This method can be used to make cartographic graphs much faster than the methods described above. However, this method has one very important drawback, which, if not handled properly, can destroy the whole purpose of using the card.

  • In very simple English, what is the difference between a raster file approach and its approach?
  • Does the RgoogleMaps package have the ability to create these types of high-quality maps, as shown on the page that I linked above, which calls the google map in R?

I ask, not because I lack information, but vice versa. There are too many, and I want to make the right decision about the approach to prosecution, so as not to waste time on outdated or ineffective methods.

Feel free to go through any readings that you think will benefit me.

Thank you in advance for your guidance.

+4
source share
1 answer

Basically, you had two options during the creation of this plot:

  • draw a map as a layer using geom_tile , where each image pixel is displayed on the x, y axis (slow but accurate)

  • Add a background image to the plot as a purely β€œcosmetic” annotation. This method is faster because you can use grid.raster , which draws images more efficiently, but the image is not limited to the axes of the plotting area. In other words, you must manually adjust the limits of the x and y axes to ensure that the image matches the actual positions on the graph.

Now I suggest you look at the new annotation_raster in ggplot2 v. 0.9.0 It should have the advantage of faster and more compact output files and still fit the graph data space. I believe that this function, as well as geom_raster and annotation_map did not exist when David made these stories.

+5
source

Source: https://habr.com/ru/post/1396118/


All Articles