oceanhackweek / ohw20-proj-species-marine-protected-areas

4 stars 15 forks source link

RShiny: Visualize MPAs on the MPA tab #34

Open microlei opened 3 years ago

microlei commented 3 years ago
microlei commented 3 years ago

Having difficulty rendering some maps. Chile take a really long time and is very sluggish to interact with. USA, Spain and Portugal throw this error:

Error in to_ring.default(x) : Don't know how to get polygon data from object of class XY,MULTIPOINT,sfg

Other issues with country maps: Iceland's metadata is pretty sparse, but main issue is there is no name for each region

btupper commented 3 years ago

The javascript rendering engine may not be trying to simplify the polygons. You might try simplifying on the R side before handing the polygons to Shiny/javascript. Perhaps sf::st_simplify() is with a shake. It's hard to know a priori how long simplification will take. So, we might want to precompute and save simplified MPAs and read from those.