Skip to content

Simple features with ZM dimensions fail to map #482

@kent37

Description

@kent37

Leaflet will not render linestrings with Z or ZM dimensions. Instead it gives an obscure error with an obscure traceback. It would be helpful if leaflet removed or ignored the ZM dimensions or at least gave a helpful error message.

library(leaflet)
library(magrittr)
library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.1.3, proj.4 4.9.3

s1 <- rbind(c(0,3,1),c(0,4,1),c(1,5,1),c(2,5,1))
(ls <- st_linestring(s1))
#> LINESTRING Z (0 3 1, 0 4 1, 1 5 1, 2 5 1)

leaflet(ls) %>% addPolylines()
#> Error in if (length(nms) != n || any(nms == "")) stop("'options' must be a fully named list, or have no names (NULL)"): missing value where TRUE/FALSE needed

# Works
leaflet(st_zm(ls)) %>% addPolylines()

Metadata

Metadata

Assignees

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