What is the ratio of plotly marker size to the area of a plotly geoplot?

205 Views Asked by At

geoplot with constant marker size

data table

I have data of wild fires in the US with co-ordinates and their respective size in ACRES. So far I have been able to plot this with a constant marker size, say equal to 1. The problem is, some of the forest fires span across 10000+ acres and I therefore cannot use the columns for fire_size as the marker size. I also want the size of the marker to be proportional to the area and I want to match this onto the map/geoplot, so bigger fires look bigger on the map and their size accurately matches. If someone knew what size area of US land corresponds to a marker size of say 1 I would be able to convert the ACRES correctly onto the geoplot. I have done this in R so far. Here is my code and I have attached a picture online.

coords = read_csv("us_fires_coords.csv")

geo_properties = list(
  scope = 'usa',
  projection = list(type = 'albers usa'),
  showland = TRUE,
  showsubunits = FALSE,
  landcolor = toRGB('gray10'),
  showlakes = TRUE,
  lakecolor = toRGB('white')
)

coords_map = plot_geo(coords %>% sample_n(10000),
                      lat = ~LATITUDE,
                      lon = ~LONGITUDE,
                      marker = list(size = 2, color = "#DC143C", opacity = 0.25)) %>%
  add_markers(hoverinfo = "none") %>%
  config(displayModeBar = FALSE) %>%
  layout(geo = geo_properties) 

coords_map

1

There are 1 best solutions below

0
On

There is no way to control the size of a marker in pixels such that it is scaled in some known way to equivalent-acres on the underlying map, unfortunately. The mapping between map-pixels and acres depends on variables like the size of the figure, the zoom-level, the margins etc, whereas the pixel-size of a marker is a simple computation from the data, and the markers don't zoom/shrink in lockstep with the map.