You should be able to plot the ArchGDAL geometries directly, the objects you have in parsed_geoms. You could also have PostGIS return the geometries as WKB (well known binary) instead of well known text, which is faster and easier to parse.
It’s also way more efficient, due to the way Makie works, to plot all polygons at once:
df.parsed_geoms = (x -> ismissing(x) ? missing : ArchGDAL.fromWKT(x)).(df.geom)
dropmissing!(df, :parsed_geoms)
# ... other processing
poly(
df.parsed_geoms;
color = df.pop_bins,
colormap = custom_colors,
colorrange = (1, length(custom_colors)),
highclip = custom_colors[end],
lowclip = custom_colors[begin]
)
If you want to get coordinates from geometry, you should also look into GeoInterface.jl which is a common interface across all Julia geospatial IO packages.
Your code to get the coordinates of one ring would then look like:
import GeoInterface as GI
multi_poly = ... # something
poly = GI.getgeom(multi_poly, 1)
ring = GI.getring(poly, 1) # or GI.getexterior(poly) or GI.gethole(poly, i #= in 1:GI.nhole(poly)=#)
coords = [(GI.x(p), GI.y(p) for p in GI.getpoint(ring)]