{"id":41634532,"url":"https://github.com/phayes/polars_gdal","last_synced_at":"2026-01-24T14:48:08.529Z","repository":{"id":62717440,"uuid":"561635625","full_name":"phayes/polars_gdal","owner":"phayes","description":"Read GDAL compatible file formats into polars / geopolars","archived":false,"fork":false,"pushed_at":"2023-01-11T22:53:54.000Z","size":342,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-29T09:35:24.569Z","etag":null,"topics":["dataframe","gdal","geo","geopolars","geospatial","polars","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phayes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-04T06:06:59.000Z","updated_at":"2024-01-15T19:25:18.000Z","dependencies_parsed_at":"2023-02-09T08:47:08.516Z","dependency_job_id":null,"html_url":"https://github.com/phayes/polars_gdal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phayes/polars_gdal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fpolars_gdal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fpolars_gdal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fpolars_gdal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fpolars_gdal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phayes","download_url":"https://codeload.github.com/phayes/polars_gdal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phayes%2Fpolars_gdal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28730279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataframe","gdal","geo","geopolars","geospatial","polars","rust"],"created_at":"2026-01-24T14:48:08.461Z","updated_at":"2026-01-24T14:48:08.515Z","avatar_url":"https://github.com/phayes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Read and write GDAL-compatible geospatial data into [Polars](https://www.pola.rs) and [GeoPolars](https://github.com/geopolars/geopolars).\n\nSupports reading and writing the following geospatial formats into / from a Polars Dataframe:\n\n1. GeoJSON\n2. ShapeFiles\n3. CSV with lat / lon\n4. FlatGeobuf\n5. KML\n6. GPX\n7. PostGIS (via network)\n8. SpatialLite\n9. ... and [many more](https://gdal.org/drivers/vector/index.html)\n\n\n### Example 1: Dataframe from a file\n```rust # ignore\nuse polars_gdal::df_from_resource;\nlet df = df_from_resource(\"my_shapefile.shp\", None).unwrap();\nprintln!(\"{}\", df);\n```\n\n### Example 2: DataFrame from raw bytes\n```rust # ignore\nuse polars_gdal::df_from_bytes;\n\nlet geojson = r#\"{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"name\":\"foo\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[1,2]}},{\"type\":\"Feature\",\"properties\":{\"name\":\"bar\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[3,4]}}]}\"#.as_bytes();\n\nlet df = df_from_bytes(geojson, None, None).unwrap();\nprintln!(\"{}\", df);\n```\n\n### Example 3: DataFrame from GDAL Layer with filtering query\n```rust # ignore\nuse polars_gdal::{df_from_layer, gdal};\nuse gdal::vector::sql;\n\nlet dataset = gdal::Dataset::open(\"my_shapefile.shp\")?;\nlet query = \"SELECT kind, is_bridge, highway FROM my_shapefile WHERE highway = 'pedestrian'\";\nlet mut result_set = dataset.execute_sql(query, None, sql::Dialect::DEFAULT).unwrap().unwrap();\n\nlet df = df_from_layer(\u0026mut result_set, None).unwrap();\nprintln!(\"{}\", df);\n```\n\n### Example 4: DataFrame from Latitude / Longitude CSV with custom parsing options\n```rust # ignore\nlet mut params = polars_gdal::Params::default();\nlet csv_parsing_options = [\"EMPTY_STRING_AS_NULL=YES\", \"KEEP_GEOM_COLUMNS=NO\", \"X_POSSIBLE_NAMES=Lon*\", \"Y_POSSIBLE_NAMES=Lat*\"];\nparams.open_options = Some(\u0026csv_parsing_options);\n \nlet df = df_from_resource(\"lat_lon_countries.csv\", Some(params)).unwrap();\nprintln!(\"{}\", df);\n```\n\n### Example 5: DataFrame from a PostGIS table\n```rust # ignore\nuse polars_gdal::{df_from_resource, Params};\n\nlet mut params = Params::default();\nparams.layer_name = Some(\"some_table_name\");\n \nlet df = df_from_resource(\"postgresql://user:pass@host/db_name\", Some(params)).unwrap();\nprintln!(\"{}\", df);\n```\n\n### Example 6: GeoJSON bytes from a Dataframe\n```rust # ignore\nuse polars_gdal::{gdal, gdal_bytes_from_df, WriteParams};\n\nlet df: DataFrame = ...;\nlet json_driver = gdal::DriverManager::get_driver_by_name(\"GeoJSON\")?;\nlet geojson_bytes = gdal_bytes_from_df(\u0026df, \u0026json_driver, None)?;\n```\n\n### Example 7: Write a shapefile to disk from a DataFrame\n```rust # ignore\nuse polars_gdal::{gdal, gdal_resource_from_df, WriteParams};\n\nlet df: DataFrame = ...;\nlet shapefile_driver = gdal::DriverManager::get_driver_by_name(\"ESRI Shapefile\")?;\nlet _dataset = gdal_resource_from_df(\u0026df, \u0026shapefile_driver, \"/some/path/on/disk/my_shapefile.shp\", None)?;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphayes%2Fpolars_gdal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphayes%2Fpolars_gdal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphayes%2Fpolars_gdal/lists"}