diff --git a/martin/src/pg/config.rs b/martin/src/pg/config.rs index 85df68e91..ee5ea0db1 100644 --- a/martin/src/pg/config.rs +++ b/martin/src/pg/config.rs @@ -82,6 +82,12 @@ pub struct PgCfgPublishType { #[serde(skip_serializing_if = "Option::is_none")] #[serde(alias = "id_column")] pub id_columns: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub clip_geom: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub buffer: Option, } impl PgConfig { diff --git a/martin/src/pg/configurator.rs b/martin/src/pg/configurator.rs index f4290a54a..dffbe992b 100755 --- a/martin/src/pg/configurator.rs +++ b/martin/src/pg/configurator.rs @@ -1,3 +1,4 @@ +use std::borrow::BorrowMut; use std::cmp::Ordering; use std::collections::HashSet; @@ -28,6 +29,8 @@ pub struct PgBuilderAuto { source_id_format: String, schemas: Option>, id_columns: Option>, + clip_geom: Option, + buffer: Option, } #[derive(Debug)] @@ -146,6 +149,8 @@ impl PgBuilder { }; db_inf.srid = srid; update_id_column(&id2, &mut db_inf, auto_tables); + db_inf.borrow_mut().buffer = auto_tables.buffer; + db_inf.borrow_mut().clip_geom = auto_tables.clip_geom; info!("Discovered source {id2} from {}", summary(&db_inf)); pending.push(table_to_query( id2, @@ -317,6 +322,8 @@ fn new_auto_publish(config: &PgConfig, is_function: bool) -> Option Option default(merge_opt_hs(&a.from_schemas, &None)), BoolOrObject::Bool(false) => None, @@ -420,6 +443,8 @@ mod tests { source_id_format: source_id_format.to_string(), schemas: schemas.map(|s| s.iter().map(|s| (*s).to_string()).collect()), id_columns: None, + clip_geom: None, + buffer: None, }) } diff --git a/martin/src/pg/table_source.rs b/martin/src/pg/table_source.rs index 38fb11618..52bd5a04e 100644 --- a/martin/src/pg/table_source.rs +++ b/martin/src/pg/table_source.rs @@ -55,8 +55,8 @@ pub async fn query_available_tables(pool: &PgPool) -> Result