So I assume that not having defined my bounding box was the issue. Thank you so much for the quick reply! This solved my problem. Hanoimap <- Hanoimap + geom_text(data=traps,mapping=aes(x = longitude+.001, y = latitude-.001,label = name))Ĭreated on by the reprex package (v2.0.0) Hanoimap <- Hanoimap + geom_point(data=traps, aes(x = longitude, y = latitude), size = 5) #> Data (c) OpenStreetMap contributors, ODbL 1.0. #> Please cite ggmap if you use it! See citation("ggmap") for details. Try this (notice the boundingbox) : library(ggmap) RecordGraphics(drawGTree(x), list(x = x), getNamespace("grid")) Grid.draw(x$children], recording = FALSE) RecordGraphics(drawGrob(x), list(x = x), getNamespace("grid")) (C_raster, x$raster, x$x, x$y, x$width, x$height, resolveHJust(x$just, x$hjust), resolveVJust(x$just, x$vjust), x$interpolate)ĭrawDetails.rastergrob(x, recording = FALSE) Rror in (C_raster, x$raster, x$x, x$y, x$width, x$height, : Empty raster Hanoimap + geom_text(data=traps,mapping=aes(x = longitude+.001, y = latitude,label = name)) Hanoimap = Hanoimap + geom_point(data=traps, aes(x = longitude, y = latitude), size = 5) Add the labels Hanoimap = ggmap(Hanoi) Add the points layer Hanoi = get_map(location = location, source = "osm", zoom = 3) Draw the map With RxHighlight, you are also able to measure, markup, annotate, conversion and share over 250 different file formats natively, without any need for the authoring software. RxView lets you view, measure and print 250 different file formats natively. Location=c(106,20.5,105.6,21.1) Fetch the map Are you looking for a powerful viewing software for review of plans, drawings and documents. Traps <- ame(name=c("Kim Ma","An Khanh","Gia Quat", "Ngoc Ha", "Cu Khoi N", "Cu Khoi S"), I found a similar post from someone with the same error and they solved by adding "+scale_fill_continuous(guide=FALSE)", that doesn't help me however. But I'm always getting the same error no matter what I try. I am trying to create a open street map of Hanoi and add data points from my data frame to it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |