Open remi-braun opened 1 month ago
Hi, how did you install geopandas and pyogrio? In my installation from conda-forge, the snippet above works. Can you also show thew output of pyogrio.list_drivers()
?
import pyogrio
pyogrio.list_drivers()
The install is done via pip in a Docker (without conda) on Debian 11
The drivers are:
{'PCIDSK': 'rw', 'PDS4': 'rw', 'VICAR': 'rw', 'PDF': 'rw', 'MBTiles': 'rw', 'EEDA': 'r', 'OGCAPI': 'r', 'ESRI Shapefile': 'rw', 'MapInfo File': 'rw', 'UK .NTF': 'r', 'LVBAG': 'r', 'OGR_SDTS': 'r', 'S57': 'rw', 'DGN': 'rw', 'OGR_VRT': 'r', 'Memory': 'rw', 'CSV': 'rw', 'GML': 'rw', 'GPX': 'rw', 'KML': 'rw', 'GeoJSON': 'rw', 'GeoJSONSeq': 'rw', 'ESRIJSON': 'r', 'TopoJSON': 'r', 'OGR_GMT': 'rw', 'GPKG': 'rw', 'SQLite': 'rw', 'WAsP': 'rw', 'OpenFileGDB': 'rw', 'DXF': 'rw', 'FlatGeobuf': 'rw', 'Geoconcept': 'rw', 'GeoRSS': 'rw', 'VFK': 'r', 'PGDUMP': 'rw', 'OSM': 'r', 'GPSBabel': 'rw', 'OGR_PDS': 'r', 'WFS': 'r', 'OAPIF': 'r', 'EDIGEO': 'r', 'SVG': 'r', 'Idrisi': 'r', 'ODS': 'rw', 'XLSX': 'rw', 'Elasticsearch': 'rw', 'Carto': 'rw', 'AmigoCloud': 'rw', 'SXF': 'r', 'Selafin': 'rw', 'JML': 'rw', 'PLSCENES': 'r', 'CSW': 'r', 'VDV': 'rw', 'MVT': 'rw', 'NGW': 'rw', 'MapML': 'rw', 'GTFS': 'r', 'PMTiles': 'rw', 'JSONFG': 'rw', 'TIGER': 'r', 'AVCBin': 'r', 'AVCE00': 'r', 'HTTP': 'r'}
KML files are read fine, only KMZ files fail
I think that the reason is that the PyPI wheels contain the KML driver while the conda-forge contain LIBKML driver.
Is there a workaround to replicate the conda behaviour natively with pypi?
You can normally prepend the filename with "/vsizip/" to use the virtual filesystem feature of GDAL to do the unzipping.
I wonder if there is something wrong with the test file you uploaded... because for another .kmz this workaround works, but not for your test file.
import geopandas as gpd
print(gpd.read_file(r"/vsizip/C:/Temp/example.kmz"))
This file has been part of the test suite for years and worked :'(
I have other KMZ that fails too, so maybe there is an issue inside that is weird?
Unfortunately, the /vsizip/
workaround fails too for me
This file has been part of the test suite for years and worked :'(
Hmm... indeed, I can open it without problems in e.g. QGIS, so apparently the "KML" driver doesn't only limit the support to uncompressed .kml files but also to a subset of them... so it seems you'll really need the "LIBKML" driver.
GeoPandas 1.0+ is not able to read KMZ files with pyogrio's engine, when setting
engine=fiona
works:With fiona:
With pyogrio:
Here is the file: AOI_kmz.zip
Versions: