Hi, I would like to convert the loaded GADM.jl country polygon file to GeoJSON.jl so that I can plot this using GeoMakie.jl. I am aware that MeshViz.jl supports well the GADM.jl, but I would like to customize the plot and hence I want to use GeoMakie.jl. From the examples in GeoMakie.jl and the GeoPlots of BeautifulMakie, most of them load GeoJSON file from some links hosting the file, and this is what I follow at the moment. Example
using CairoMakie
using Colors
using GeoMakie
using GeoJSON
using Downloads
ph_geojson = "https://raw.githubusercontent.com/faeldon/philippines-json-maps/master/geojson/country/lowres/country.0.001.json";
phmap = Downloads.download(ph_geojson);
geo = GeoJSON.read(read(phmap, String));
geo
function plotPH()
fig = Figure(resolution = (1050, 800), fontsize = 22);
ax = GeoAxis(fig[1, 1], dest="+proj=gall +lon_0=150 +lat_0=10",
lonlims=(100, 200), latlims=(-5, 60), coastlines=true,
coastline_attributes=(color=:black, linewidth=0.35, fill=:black))
poly!(ax, geo, color=colorant"#85754e",
strokecolor = :black, strokewidth = 0.35)
colsize!(fig.layout, 1, Aspect(1, 2.0))
fig
end
I would like to change the code above and use the shapefile from GADM.jl for plotting the country above. Is it possible? I know I can get the coordinates of the country as follows:
using GADM
ph = GADM.coordinates("PHL")
But I don’t know how to proceed to convert this to GeoJSON file and plot it like the one above.
I should emphasize though that I am not a Geographer, and I apologize for my basic understanding.