Python convert KML to image file

1k views Asked by At

Looking for some guidance on how to convert a KML file to an image file showing simple polygons of the GPS data held in the file? I've been looking at ways to do this via python using mapnik and simplekml but I'm unsure if this is the correct usage of the tools.

Ideally, I just want a simple way to produce polygons from a KML file

Any advice very welcome

1

There are 1 answers

0
Grimlockz On

Manage to get a crud script working using geopandas

    import geopandas as gpd
import matplotlib.pyplot as plt
gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'


# Filepath to KML file
fp = "history.kml"

polys = gpd.read_file(fp, driver='KML')
print(polys)
polys.plot()
plt.savefig('test.jpg')