diff --git a/configs/tegola.toml b/configs/tegola.toml index 7ccd368..ce6c03a 100644 --- a/configs/tegola.toml +++ b/configs/tegola.toml @@ -20,6 +20,13 @@ srid = 4326 # The default srid for this provider. If not provided it id_fieldname = "id" sql = "SELECT ST_AsMVTGeom(location, !BBOX!) AS geometry, id, unit, number_, street, postal_code FROM address WHERE location && !BBOX!" + [[providers.layers]] + name = "feature-pool" + geometry_fieldname = "location" + geometry_type="point" + id_fieldname = "id" + sql = "SELECT ST_AsMVTGeom(f.location, !BBOX!) AS location, fp.condition AS condition, f.id AS id, 'pool' AS type, a.number_ AS address_number, a.street AS address_street, a.locality AS address_locality, a.region AS address_region, a.country AS address_country, a.postal_code AS address_postal_code FROM feature f INNER JOIN feature_pool fp ON f.id = fp.feature_id INNER JOIN site s ON s.id = f.site_id INNER JOIN address a ON a.id = s.address_id WHERE f.location && !BBOX! !PARAM_FEATURE_ORGANIZATION_ID!" + [[providers.layers]] name = "fileupload-pool" geometry_fieldname = "geometry" @@ -55,6 +62,13 @@ srid = 4326 # The default srid for this provider. If not provided it id_fieldname = "id" sql = "SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, id, cell, count_, resolution FROM h3_aggregation WHERE type_ = 'ServiceRequest' AND geometry && !BBOX! !PARAM_ORGANIZATION_ID!" + [[providers.layers]] + name = "signal-point" + geometry_fieldname = "location" + geometry_type="point" + id_fieldname = "id" + sql = "SELECT ST_AsMVTGeom(location, !BBOX!) AS location, id, type_, created FROM signal WHERE GeometryType(location) = 'POINT' AND location && !BBOX! !PARAM_ORGANIZATION_ID!" + [[providers.layers]] name = "trap" geometry_fieldname = "geometry" @@ -73,21 +87,21 @@ srid = 4326 # The default srid for this provider. If not provided it geometry_fieldname = "location" geometry_type="point" id_fieldname = "id" - sql = "SELECT address_raw, created, id, ST_AsMVTGeom(location, !BBOX!) AS location, public_id, status, table_name FROM publicreport.report_location WHERE location && !BBOX!" + sql = "SELECT address_raw, created, id, ST_AsMVTGeom(location, !BBOX!) AS location, public_id, report_type AS type, status FROM publicreport.report WHERE location && !BBOX!" [[providers.layers]] name = "nuisance_location" geometry_fieldname = "location" geometry_type="point" id_fieldname = "id" - sql = "SELECT address_raw, created, id, ST_AsMVTGeom(location, !BBOX!) AS location, public_id, status FROM publicreport.report_location WHERE table_name = 'nuisance' AND location && !BBOX!" + sql = "SELECT address_raw, created, id, ST_AsMVTGeom(location, !BBOX!) AS location, public_id, status FROM publicreport.report WHERE report_type = 'nuisance' AND location && !BBOX!" [[providers.layers]] name = "water_location" geometry_fieldname = "location" geometry_type="point" id_fieldname = "id" - sql = "SELECT address_raw, created, id, ST_AsMVTGeom(location, !BBOX!) AS location, public_id, status FROM publicreport.report_location WHERE table_name = 'water' AND location && !BBOX!" + sql = "SELECT address_raw, created, id, ST_AsMVTGeom(location, !BBOX!) AS location, public_id, status FROM publicreport.report WHERE report_type = 'water' AND location && !BBOX!" [[maps]] name = "rmo" @@ -115,6 +129,9 @@ center = [-119.175, 36.24, 11.0] # set the center of the map so the user is auto [[maps.layers]] provider_layer = "nidus.address" + [[maps.layers]] + provider_layer = "nidus.feature-pool" + [[maps.layers]] provider_layer = "nidus.fileupload-pool" @@ -130,6 +147,9 @@ center = [-119.175, 36.24, 11.0] # set the center of the map so the user is auto [[maps.layers]] provider_layer = "nidus.service-area-bounds" + [[maps.layers]] + provider_layer = "nidus.signal-point" + [[maps.layers]] provider_layer = "nidus.trap" @@ -154,6 +174,13 @@ center = [-119.175, 36.24, 11.0] # set the center of the map so the user is auto sql = "AND organization_id = ?" default_sql = " " + [[maps.params]] + name = "feature_organization_id" + token = "!PARAM_FEATURE_ORGANIZATION_ID!" + type = "int" + sql = "AND f.organization_id = ?" + default_sql = " " + [[maps.params]] name = "file_organization_id" token = "!PARAM_FILE_ORGANIZATION_ID!" diff --git a/flake.lock b/flake.lock index 6129492..0befb62 100644 --- a/flake.lock +++ b/flake.lock @@ -316,17 +316,17 @@ "proj": "proj" }, "locked": { - "lastModified": 1773244212, - "narHash": "sha256-FGR1UOfgsYXsurRSzSNkiLzvW+s+ck3LmLbcLfGr5OE=", + "lastModified": 1774033630, + "narHash": "sha256-n9p1B7YHpJibZekX/QxkNXFo1htXGvf0fZfiuBlk1iE=", "owner": "Gleipnir-Technology", "repo": "nidus-sync", - "rev": "edcb48f84f49d44bbff3e1bb83c4182db932f4e7", + "rev": "23fdfc5a987c8f6f44e1a7956edb0503df484aa9", "type": "github" }, "original": { "owner": "Gleipnir-Technology", "repo": "nidus-sync", - "rev": "edcb48f84f49d44bbff3e1bb83c4182db932f4e7", + "rev": "23fdfc5a987c8f6f44e1a7956edb0503df484aa9", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 5b04b2f..6cb80c4 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,7 @@ type = "github"; owner = "Gleipnir-Technology"; repo = "nidus-sync"; - rev = "edcb48f84f49d44bbff3e1bb83c4182db932f4e7"; + rev = "23fdfc5a987c8f6f44e1a7956edb0503df484aa9"; }; nixos-facter-modules.url = "github:numtide/nixos-facter-modules"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";