I am trying to use the OSM module og Agents.jl to download maps from openstreetmaps. With the following MWE
using Agents
map_path = OSM.download_osm_network(:place_name;
place_name = "Trondheim",
network_type = :drive,
save_to_file_location = "trondheim.json"
)
I get the error
ERROR: LoadError: HTTP.ConnectError for url = `https://nominatim.openstreetmap.org/search?polygon_geojson=1&format=json&dedupe=0&q=Trondheim&limit=5`: OpenSSL.OpenSSLError("unable to get local issuer certificate")
Top of the call stack (it was very long…):
caused by: OpenSSL.OpenSSLError("unable to get local issuer certificate")
Stacktrace:
[1] macro expansion
@ C:\Users\magnusl\.julia\packages\OpenSSL\2SUGA\src\ssl.jl:532 [inlined]
[2] macro expansion
@ .\lock.jl:273 [inlined]
[3] connect(ssl::OpenSSL.SSLStream; require_ssl_verification::Bool)
@ OpenSSL C:\Users\magnusl\.julia\packages\OpenSSL\2SUGA\src\ssl.jl:525
[4] connect
@ C:\Users\magnusl\.julia\packages\OpenSSL\2SUGA\src\ssl.jl:509 [inlined]
[5] #sslconnection#19
@ C:\Users\magnusl\.julia\packages\HTTP\ShTJs\src\Connections.jl:599 [inlined]
[6] sslconnection
@ C:\Users\magnusl\.julia\packages\HTTP\ShTJs\src\Connections.jl:589 [inlined]
[7] getconnection(::Type{…}, host::SubString{…}, port::SubString{…}; kw::@Kwargs{…})
@ HTTP.Connections C:\Users\magnusl\.julia\packages\HTTP\ShTJs\src\Connections.jl:586
...
I am not very knowledgable about ssl or how Julia handles this so any pointers would be appreciated.
Nothing wrong with your code. The problem is the external OSM server overloaded; wait a few minute and rerun the code. Once you get the file successfull, keep and reuse it in later runs instead of calling download_osm_network each time.
julia> map_path = OSM.download_osm_network(:place_name;
place_name = "Trondheim",
network_type= :drive,
save_to_file_location= "trondheim.json")
[ Info: Using Polygon for Trondheim, Trøndelag, Norge
[ Info: Overpass server is available for download
[ Info: Downloaded osm network data from ["place_name: Trondheim"] in json format
[ Info: Saved osm network data to disk: trondheim.json
Dict{String, Any} with 4 entries:
"elements" => Any[Dict{String, Any}("id"=>0, "tags"=>Dict{String, Any}("nodes"=>"67965", "total"=>"74925", "ways"=>"6886", "relations"=>"74"), "type"=>"count"), Dic…
"generator" => "Overpass API 0.7.62.10 2d4cfc48"
"version" => 0.6
"osm3s" => Dict{String, Any}("timestamp_osm_base"=>"2026-02-20T16:07:57Z", "copyright"=>"The data included in this document is from www.openstreetmap.org. The da…
Thanks for the reply
If I use a new version of Julia (1.12.5) and install Agents.jl (v6.2.10) downloading the maps works fine as you show above. However, if I try to install CairoMakie and OSMMakie to run the zombie example from Agents.jl documentation in this environment, CairoMakie fails to compile after adding OSMMakie with the errror
ERROR: LoadError: FieldError: type Core.TypeName has no field `mt` ...
When adding OSMMakie, CairoMakie (and some other packages) is downgraded from v0.13.10 ⇒ v0.12.18. Maybe this is the cause of the error?
I found that using Julia v1.11.5 and then installing CairoMakie, OSMMakie and Agents (+Pkg.update()) resulted in working environment that would run the zombie example without any problems.
When I then tried to run the code from the initial post(OSM.download_osm_network()) in this environment i get the same error as in the inital post. The only difference relevant difference I have found in the manifest is that the Julia 1.12.5 environment uses MbedTLS_jll v2.28.1010 while the Julia 1.11.5 environment uses MbedTLS_jll v2.28.6. I have no idea if this is relevant.
My current plan for a workaround is to use the 1.12.5 environment to download maps and do most of the work and then switch to 1.11.5 if I need to plot with CairoMakie/OSMMakie. This might be cumbersome in the long run, though…
Use Agents #main branch for now, and preface all functionality of OSM with OSM. such as OSM.test_map() and OSM.plan_route!. You need to be using LightOSM for functionality to come online. Everything is working for v7 to release but docs take too long to build. Final thing to resolve, but this wll happen friday and sunday.
Thank you for the heads up. Adding from the current main (]add Agents.jl#main) branch yielded no precompilation errors with CairoMakie and OSMMakie. When first running the zombie example (downloaded from main branch on github) I got this error
ERROR: LoadError: Function not implemented for model of type StandardABM with space type OpenStreetMapSpace{OSMGraph{Int32, Int64, Float64}}.
But when adding OSM. in front of move_along_route!, is_stationary and plan_route! (as mentioned in the changelog) in the example everything ran hunky dory. Thanks for all the help. (Maybe update the example before release? Should I put an issue about this on github?)
The code in the intial post also executed succesfully (after adding using LightOSM)