Skip to content

Commit 043aa73

Browse files
committedFeb 27, 2020
fix mapping of composites of composites
1 parent 569509b commit 043aa73

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎R/map.R

+6-3
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,23 @@ map.ppi <- function(x, map, param, alpha = 0.7, xlim, ylim,
216216
# these declarations prevent generation of NOTE "no visible binding for
217217
# global variable" during package Check
218218
lon <- lat <- y <- z <- NA
219+
# extract unique radar locations
220+
latlon_radar <- unique(data.frame(lat=c(x$geo$lat), lon=c(x$geo$lon)))
219221
# symbols for the radar position
220222
# dummy is a hack to be able to include the ggplot2 color scale,
221223
# radarpoint is the actual plotting of radar positions.
222224
dummy <- geom_point(aes(x = lon, y = lat, colour = z),
223225
size = 0,
224226
data = data.frame(
225-
lon = x$geo$lon,
226-
lat = x$geo$lat,
227+
lon = latlon_radar$lon,
228+
lat = latlon_radar$lat,
227229
z = 0
228230
)
229231
)
230232
radarpoint <- geom_point(aes(x = lon, y = lat),
231233
colour = radar_color,
232234
size = radar_size,
233-
data = data.frame(lon = x$geo$lon, lat = x$geo$lat)
235+
data = data.frame(lon = latlon_radar$lon, lat = latlon_radar$lat)
234236
)
235237
# bounding box
236238
bboxlatlon <- attributes(map)$geo$bbox
@@ -248,4 +250,5 @@ map.ppi <- function(x, map, param, alpha = 0.7, xlim, ylim,
248250
scale_y_continuous(limits = ylim, expand = c(0, 0))
249251
)
250252
suppressWarnings(mymap)
253+
251254
}

0 commit comments

Comments
 (0)