This article describes the procedure for reading KML files into EarthAI Notebook.
This assumes that a KML file of interest is located locally in the Notebook environment. There are two steps to read this into a GeoDataFrame. The first utilizes the Python library Fiona to enable a driver for reading KML file formats. The second reads the file into a GeoDataFrame.
import geopandas as gpd
import fiona
gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'
df = gpd.read_file('<filename>.kml', driver='KML')
You can confirm that df has been read in as a GeoDateFrame by running:
type(df)
Comments
0 comments
Please sign in to leave a comment.