How to keep geospatial data when converting GTiff to PDF?

Viewed 34

I'm working with some custom maps that I've made. They are saved locally as a GTiff and, when drag-dropping them on Google Earth, align beautifully on the map. I now want to convert them to Geospatial PDF and cannot get the geodata to follow to the PDF. Code:

from osgeo import gdal

pdfTarget = 'pdf/output.pdf'
mapSource = 'map_images/input.tif'

# Create PDF file from GeoTIFF map
gdal.Translate(pdfTarget,
                    mapSource,
                    outputSRS='EPSG:4326')

If I change the file ending to .tif in pdfTarget, a GTiff is created and the georeferencing works.

Any help in converting the GTiff to PDF would be greatly appreciated, it doesn't have to be in GDAL.

0 Answers
Related