I currently have an EPSG:4326 - WGS 84 MultiPolygon shape in QGIS.
I need to make a path planning tool to cross the lake above. In which case I need to convert this shapefile into a raster (from which I can make black and white 1 - lake, 0 - not lake), but I also need the lat / lon coordinates of each pixel, so that I can set the waypoints that the path planner finds.
How can I generate three arrays:
- Boolean 1/0 for each pixel deciding whether it is water or not.
- Matrix containing the latitudes of each pixel.
- Matrix containing the longitudes of each pixel.
gdal_rasterize
program. I do not have a working code to share but have tested it in command line. You can create a GeoTIFF file and save lat/lon from GeoTIFF in separate files if you need. The description is available here: [gdal.org/programs/gdal_rasterize.html][1] Alternatively, if you are already using QGIS, it has GDAL/OGR included in it - so you need to figure out how you can usegdal_rasterize
from QGIS. Or, use Python, import GDAL/OGR and use thegdal_rasterize
module. [1]: gdal.org/programs/gdal_rasterize.html