I had a geodataframe having 4 columns (viz. name, time, description, geometry fiels). I am trying to export the geodataframe to ESRI Shapefile but it is throwing following error:
DriverSupportError: ESRI Shapefile does not support datetime fields
. The following is the code which I am using:
import geopandas as gpd
gdf = gpd.GeoDataFrame()
gdf['name'] = name_list
gdf['time'] = time_list
gdf['time'] = gdf['time'].dt.tz_localize(None)
gdf['description'] = description_list
gdf = gpd.GeoDataFrame(gdf,geometry=geometry_list)
gdf.crs = "epsg:4326"
# schema = gpd.io.file.infer_schema(gdf)
# print(schema)
gdf.to_file(r'C:\Users\Ashish\Desktop\Ground_Truth\test.shp', driver='ESRI Shapefile')
The "print(schema)" command shows the following:
{'geometry': 'Point', 'properties': OrderedDict([('name', 'str'), ('time', 'datetime'), ('description', 'str')])}
GeoPandas version is '0.9.0'
,
Fiona version is '1.8.19'