pszufe / OpenStreetMapX.jl

OpenStreetMap (*.osm) support for Julia 1.0 and up
MIT License
118 stars 24 forks source link

IS possible to save to file Mapa Data Object? #37

Open psilvao opened 3 years ago

psilvao commented 3 years ago

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

pszufe commented 3 years ago

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.