Create metadata for a single geometry column.
(
column_name: &str,
geometry_types: Vec<String>,
bbox: Option<[f64; 4]>,
)
| 46 | impl GeoParquetMetadata { |
| 47 | /// Create metadata for a single geometry column. |
| 48 | pub fn single_column( |
| 49 | column_name: &str, |
| 50 | geometry_types: Vec<String>, |
| 51 | bbox: Option<[f64; 4]>, |
| 52 | ) -> Self { |
| 53 | let mut columns = HashMap::new(); |
| 54 | columns.insert( |
| 55 | column_name.to_string(), |
| 56 | GeoParquetColumnMeta { |
| 57 | encoding: "WKB".to_string(), |
| 58 | geometry_types, |
| 59 | crs: serde_json::json!({ |
| 60 | "type": "GeographicCRS", |
| 61 | "name": "WGS 84", |
| 62 | "id": { "authority": "EPSG", "code": 4326 } |
| 63 | }), |
| 64 | bbox, |
| 65 | }, |
| 66 | ); |
| 67 | Self { |
| 68 | version: "1.1.0".to_string(), |
| 69 | primary_column: column_name.to_string(), |
| 70 | columns, |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | /// Serialize to JSON string for Parquet file metadata. |
| 75 | pub fn to_json(&self) -> Result<String, sonic_rs::Error> { |