rmapview

Mapview displays only one polygon instead of many with different colors


I have this shapefile which you can download from here.

I'm trying to create a mapview map with:


    library(sf)
    library(mapview) 
    subs <- read_sf("cheyenne-kimball-all-owners.shp")
    
    m <- mapview(subs, zcol = "acres")

Only one polygon is being displayed instead of many. What is wrong? enter image description here


Solution

  • Every row seems to be that same shape, but some have a little bit cut out. So your plot is showing all of them on top of each other. Picking some at random:

    par(mfrow=c(2,2))
    plot(subs$geometry[1])
    plot(subs$geometry[29])
    plot(subs$geometry[129])
    plot(subs$geometry[329])
    

    enter image description here

    If that's not what you expect then go back to whoever you got the data from and take it up with them, if you created it and its not what you expect then you need to fixup your processing pipeline.