MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / single_column

Method single_column

nodedb-spatial/src/geo_meta.rs:48–72  ·  view source on GitHub ↗

Create metadata for a single geometry column.

(
        column_name: &str,
        geometry_types: Vec<String>,
        bbox: Option<[f64; 4]>,
    )

Source from the content-addressed store, hash-verified

46impl 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> {

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected