PlotlyJS.jl
PlotlyJS.jl copied to clipboard
Arbitrary Shapefile Visualization
I am stuck on the PlotlyJS equivalent of the following example found here on the Plots.jl
page:
using PlotRecipes, Shapefile
dir = "https://github.com/nvkelso/natural-earth-vector/raw/master/110m_physical/"
fn = "ne_110m_land.shp"
run(`wget $dir/$fn -P /tmp/`)
shp = open("/tmp/$fn") do fd
read(fd, Shapefile.Handle)
end
plot(shp)
I tried out the following mapbox example here
mapbox_access_token = "pk.eyJ1IjoiY2hlbHNlYXBsb3RseSIsImEiOiJjaXFqeXVzdDkwMHFrZnRtOGtlMGtwcGs4In0.SLidkdBMEap9POJGIe1eGw"
data = scattermapbox(
lat=[45.5017], lon=[-73.5673], text=["Montreal"],
mode="markers", marker_size=14,
)
layout = Layout(
autosize=true, hovermode="closest",
mapbox=attr(
accesstoken=mapbox_access_token,
bearing=0,
center_lat=45, center_lon=-73,
pitch=0,
zoom=5
)
)
plot([data], layout)
and the maps/plots via mapbox look great, but I wouldn't say they look sleek, or at least not as sleek as some of the examples here.
My goal is to visualize (and plot over) the zip code shapefile here on the Census Bureau website.
This is definitely something on my TODO list as I look at county level data quite often.
The only issue is that I don't have the time to do this all by myself right now.
Would you be interested in collaborating with me on a pull request for implementing this feature?
Certainly happy to help- with the caveat that I don't have any prior experience working with these file types.
Ahh ok.
I've never used a shape file either, so I think it would take some exploring. I don't think I will be able to do that exploration any time soon. My best hunch for what to do here would be the see what is implemented in this PR: https://github.com/plotly/plotly.py/pull/929