Just to explain the title for those unfamiliar: a Shapefile is a common file format for vectorized geospatial data. I wonder if someone can help me figure out how to rasterize Shapefiles in Julia?
There are several relevant packages: GDAL.jl is the most promising since it includes a function
GDAL.rasterize() that should do exactly what I want. However, I can’t seem to decipher the C-syntax of the arguments and probably need to see it in use. Other possible options include ArchGDAL.jl and Shapefile.jl but the path forward with these is even less clear to me.
Here’s a sample smallish Shapefile from GADM.org if someone wants to give it a try (4 MB download):
It contains three shapefiles of Argentina with polygons representing the entire country (
gadm36_ARG_0.shp) and two levels of more detailed subregions (
gadm36_ARG_2.shp). It would be extremely helpful if someone could show me how to produce a raster representation of the country-level file, or at least lead me in the right direction. In my actual application I need to represent all the subregions with their own integer values, but hopefully I can figure out that step myself. (Also the shapefile is global and over 1 GB in size.)