1

I'm plotting ACS data (counts of low-income children) for each county across the entire U.S. I don't have any markers, just a county shapefile and a value for each county in a popup.

Unsurprisingly this is too large for browsers to handle. I've seen some similar questions here that deal with clustering, but since I have nothing to cluster I'm starting a new question.

I've tried breaking it up into 4 regional maps, but even those are too much.

Is there some way to lower the footprint, but still have all the county specific data?

I'm using R to generate the map, so R-specific responses are helpful but not necessary.

1 Answer 1

1

The solution is found in r package rmapshaper.

Apply the function rmapshaper::ms_simplify() to the result of tigris::geo_join() (the merged Large SpatialPolygonsDataFrame that is the combination of shapefile and data for each geography).

For my initial merge file that was 685 MB, the result was 17.6 MB. Voila!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.