OpenStreetMapX.jl icon indicating copy to clipboard operation
OpenStreetMapX.jl copied to clipboard

IS possible to save to file Mapa Data Object?

Open psilvao opened this issue 4 years ago • 1 comments

Hi , greetings from Chile, I was looking at your work and it caught my attention, but is it possible to save the Map Data Object in a file? I would like to generate a sequence of scenarios with your api.

I was reviewing, and from what I can detect you use the api https://leafletjs.com/, if you can tell me, please, where, there I could generate a file with the associated javascript and save it as a file.

Regards, Pablo

psilvao avatar Dec 21 '20 04:12 psilvao

Hi, you can save any Julia object by using the serialization API

using Serialization
serialize("myfle.jld", mapdata)

Another good option is BJSON.jl

Regarding visualisations in the tutorials I use Python's folium library that provides leafletjs integration for Jupyter Notebooks https://github.com/python-visualization/folium I do not know how easily can be saved as pure JavaScript - I am not doing any type of web development. Anyway this is the question for the folium folks.

Just note that OpenStreetMapXPlot.jl is also providing an API for map plotting and saving the plot as a static image file.

pszufe avatar Dec 22 '20 00:12 pszufe