I have a Django web app that produces a couple different PDFs. One just displays tabular data, but another one needs to display geometries out of a PostGIS database, along with tabular data. In my web search attempts, all I can find are solutions that use ArcGIS (ArcPy) or QGIS (PyQGIS). I would like to avoid having to install additional software (not to mention licensing ArcGIS), and was wondering if there is a purely Python solution that is available? If there are solutions that utilize GeoDjango or GeoPandas, I haven't been able to find them.
1 Answer
This may not be "pure python", and the available documentation is not great, but if you can install GDAL (which has Python bindings) there is a Geospatial PDF driver that you could use within a Django backend (see: https://gdal.org/drivers/vector/pdf.html and https://gdal.org/drivers/raster/pdf.html).
The best example code for its use might be what you can glean from the tests... https://github.com/OSGeo/gdal/blob/master/autotest/gdrivers/pdf.py