Skip to content

Polygons with getmap() and rnaturalearth data #23

Description

@andrew-MET

When trying to extract polygons using rnaturalearth data as the map database, an error is thrown. It appears to be the function maps::map.clip.poly() that is throwing the error.

library(meteogrid)
library(rnaturalearth)
dom <- Make.domain(clonlat = c(17.5, 53), nxny = 100, dxdy = 50000)

# paths work fine
map <- getmap(dom, map.database = countries110)
plot(map, type = "l")

# Polygons throw an error
map <- getmap(dom, map.database = countries110, fill = TRUE)
#> Error in rep(nam, times = dd$npoly): invalid 'times' argument

Created on 2025-09-26 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions