sertit.vectors.read¶
- read(path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], crs: Optional[Any] = None, archive_regex: Optional[str] = None) geopandas.geodataframe.GeoDataFrame [source]¶
Read any vector: - if KML: sets correctly the drivers and open layered KML (you may need ogr2ogr to make it work !) - if archive (only zip or tar), use a regex to look for the vector inside the archive.
You can use this [site](https://regexr.com/) to build your regex.
if GML: manages the empty errors
>>> # Usual >>> path = 'D:\path\to\vector.geojson' >>> vectors.read(path, crs=WGS84) Name ... geometry 0 Sentinel-1 Image Overlay ... POLYGON ((0.85336 42.24660, -2.32032 42.65493,... >>> # Archive >>> arch_path = 'D:\path\to\zip.zip' >>> vectors.read(arch_path, archive_regex=".*map-overlay\.kml") Name ... geometry 0 Sentinel-1 Image Overlay ... POLYGON ((0.85336 42.24660, -2.32032 42.65493,...
- Parameters
- Returns
Read vector as a GeoDataFrame
- Return type
gpd.GeoDataFrame