DuckDB-Postgis
A Rust Library for writing geospatial/non-geospatial data to Postgis using DuckDB.
Current Release v0.2.5
- Reads in geospatial data file types (Geopackage, Shapefile, GeoJSON, Parquet) and automatically detects the file format using magic numbers and content analysis.
- Reads in non-geospatial data (CSV, Excel) with automatic header detection and error handling.
- Automatically detects coordinate pairs in CSV/Excel files by looking for common naming patterns (e.g., longitude/latitude, x/y, easting/northing) and converts them to geometry.
- Performs CRS transformation on the data if required - ensures the CRS is ESPG:4326 (WGS84) for consistent spatial operations.
- Loads the data into a PostGIS table with a correctly defined geometry column, handling both single and multi-geometry columns.
- Provides a clean interface for Rust applications.
- Uses DuckDB as an intermediate processing engine.
Future Improvements
- Allow users to specify a target CRS instead of defaulting to EPSG:4326
- Add support for more file formats and coordinate systems
- Improve error handling and logging
- Add support for batch processing multiple files
- Expand the range of file formats supported
Example usage
use launch_process_file;