I am trying visualize some specific countries with GeoMakie.jl.
I 've seen Examples · GeoMakie.jl and I tried to do something similar:
begin # Acquire data ger_states = Downloads.download("https://raw.githubusercontent.com/isellsoap/deutschlandGeoJSON/main/2_bundeslaender/4_niedrig.geo.json") geoger = GeoJSON.read(read(ger_states, String)) fra_states = Downloads.download("https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/regions.geojson") geofra = GeoJSON.read(read(fra_states, String)) fig = Figure() ga = GeoAxis(fig[1, 1]; source = "+proj=longlat +datum=WGS84", dest = "+proj=lcc +lon_0=2 +lat_1=10 lat_2=20", lonlims=(12, 13), latlims = (30, 44), title="Simulation topology", coastlines=true) poly!(ga, geoger; strokewidth = 1, color=:lightblue) poly!(ga, geofra; strokewidth = 1, color=:royalblue) datalims!(ga) save("gerfratop.pdf", fig) fig end
It would be great if you could help me refine this figure a bit. Following are my problems:
- My biggest problem is that this figure is 43MB. As a result, it’s not very usable. Is there a way to reduce the size to the KB range ? Maybe somehow sample the found
geometryin the json files ?
- The details of the coastlines are too coarse. How can I increase it to make it much the shapefiles used ? Also the coastlines shouldn’t escape the frame.
- How can I paint the sea ?
- Bottom right the latitude text is cut in half and it’s a bit ugly.
- How can I also add lakes, and a sketch of the neighboring countries borders (without the inner states). Do I need to find the corresponding shapefile for each one of them, or can it be automated (similar to the coastilines, which uses the Natural Earth dataset) ? I tried doing
worldCountries = GeoJSON.read(read(Downloads.download("https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json"), String)) poly!(ga, worldCountries; color= :grey)
…but it didn’t ended up as desired:
The style I am aiming to achieve is something similar to the following but for both France and Germany (ignore the overlaid graph).
Thanks a lot in advance !
Julia v1.8.5 and GeoMakie 0.5.0