Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have many geoPDFs. I want to turn them into KMZ or KML+JPEG using a python script.

Any suggestions?


share|improve this question
up vote 1 down vote accepted

I don't have a script available, but you could probably write one using the GDAL library. GDAL has input support for geoPDF and output support for JPEG. You would need OGR for the KML output (

share|improve this answer

This code below may help guide some one wanting to convert many geoPDFs to KML-Superoverlay which can then be incorporated as web map overlays using Google Maps API or Google Earth API...

import shlex
import subprocess
from subprocess import Popen, PIPE
import os

def step1_translate( input_file ):
    out = input_file + ".vrt"
    translate_command = "gdal_translate -of VRT %s %s" % (input_file,out)
    translate_args = shlex.split( translate_command )
    p1 = subprocess.Popen( translate_args) # translate
    print p1

def step2_warp( input_file):
    gdalwarp_command = "gdalwarp -of VRT -t_srs EPSG:4326 %s %s" % (output_file,output_file2)
    gdalwarp_args = shlex.split( gdalwarp_command )
    p2 = subprocess.Popen( gdalwarp_args   , stdin=p1.stdout ) #gdalwarp

def step3_tile( input_file, output_file, output_file2 ):
    gdal2tiles_command = "/home/boris/gdal/swig/python/scripts/ -p geodetic -k %s" % output_file2
    gdal2tiles_args = shlex.split( gdal2tiles_command )
    p3 = subprocess.Popen( gdal2tiles_args , stdin=p2.stdout) #gdal2tiles
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.