I'm trying to create a shapefile [2D polygon type] with a Geodataframe, that result from a SQL made to a Oracle Spatial database. The SQL and the Geodataframe creation runs without errors, but when I try to use the GeoDataframe[.to_file] function, returns a few errors in the command:
geoparc.to_file('.../out/export.shp', driver='ESRI Shapefile')
Am I missing any parameters for the geometry type in .to file function?
How can I set the geometry type in the .to_file function?
geometry data type:
print(type(geoparc.geometry[0]))
= class 'cx_Oracle.LOB'>
print(geoparc.geometry[0]) =
POLYGON ((225117.58 411950.12, 225057.26803977 411941.365038031, 225058.343749989 411940.968749974, 225057.812500075 411939.468749988))
command:
geoparc.to_file('.../out/export.shp', driver='ESRI Shapefile')
Errors: geoparc.to_file('.../out/export.shp', driver='ESRI Shapefile');
...Python\Python35-32\lib\site-packages\geopandas\geodataframe.py", line 413, in to_file to_file(self, filename, driver, schema, **kwargs);
...Python\Python35-32\lib\site-packages\geopandas\io\file.py", line 106, in to_file schema = infer_schema(df);
...Python\Python35-32\lib\site-packages\geopandas\io\file.py", line 143, in infer_schema raise ValueError("Geometry column cannot contain mutiple " ValueError: Geometry column cannot contain mutiple geometry types when writing to file.