satorbis_kit.esri_gdb module¶
- class satorbis_kit.esri_gdb.ESriGDB(input_path: str | Path | None = None, output_gdb: str | Path | None = None, aws_access_key_id: str | None = None, aws_secret_access_key: str | None = None, input_gdf: geopandas.GeoDataFrame | None = None)[source]¶
Bases:
objectA package for converting GeoParquet files (from local or S3) to ESRI File Geodatabase format.
Supports multiple input types: - Single GeoParquet file (local or S3) - CSV file containing paths to multiple parquet files - Direct GeoDataFrame input
- process() int[source]¶
Process the input data and convert it to ESRI File Geodatabase format.
Supports multiple input types: - Single parquet file (local or S3) - CSV file with parquet paths - Direct GeoDataFrame
Groups data by class_name and geometry type, creating separate layers in the output geodatabase for each combination.
- Returns:
Number of layers created
- satorbis_kit.esri_gdb.parquet_to_gdb(input_path: str | Path | None = None, output_gdb: str | Path | None = None, aws_access_key_id: str | None = None, aws_secret_access_key: str | None = None, input_gdf: geopandas.GeoDataFrame | None = None) int[source]¶
Convert GeoParquet file(s) or GeoDataFrame to ESRI File Geodatabase format.
This is a simple wrapper function that handles the entire conversion process. For advanced usage, use the ESriGDB class directly.
- Parameters:
input_path – Input source. Can be: - Local parquet path: “/path/to/file.parquet” or Path object - S3 parquet path: “s3://bucket-name/path/to/file.parquet” - CSV file path: “/path/to/paths.csv” (CSV should contain parquet paths in first column) - None if using input_gdf parameter
output_gdb – Path to output ESRI File Geodatabase (.gdb file). Can be string or Path object.
aws_access_key_id – Optional AWS access key ID. If not provided, will use AWS_ACCESS_KEY_ID environment variable.
aws_secret_access_key – Optional AWS secret access key. If not provided, will use AWS_SECRET_ACCESS_KEY environment variable.
input_gdf – Optional GeoDataFrame to use directly. If provided, input_path will be ignored.
- Returns:
Number of layers created in the geodatabase
Examples
>>> from satorbis_kit import parquet_to_gdb >>> import geopandas as gpd >>> >>> # Local file >>> layers = parquet_to_gdb( ... input_path="/path/to/file.parquet", ... output_gdb="/path/to/output.gdb" ... ) >>> >>> # S3 file >>> layers = parquet_to_gdb( ... input_path="s3://bucket/path/to/file.parquet", ... output_gdb="/path/to/output.gdb", ... aws_access_key_id="your-key", ... aws_secret_access_key="your-secret" ... ) >>> >>> # CSV with multiple parquet paths >>> layers = parquet_to_gdb( ... input_path="/path/to/paths.csv", ... output_gdb="/path/to/output.gdb" ... ) >>> >>> # Direct GeoDataFrame >>> gdf = gpd.read_parquet("/path/to/file.parquet") >>> layers = parquet_to_gdb( ... input_gdf=gdf, ... output_gdb="/path/to/output.gdb" ... )