From 2bbb72f47f6b8794ab71feba483c3a29b18ba457 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:36:07 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- fmtm_splitter/fmtm_algorithm.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fmtm_splitter/fmtm_algorithm.sql b/fmtm_splitter/fmtm_algorithm.sql index e94f19c..a19bf5d 100644 --- a/fmtm_splitter/fmtm_algorithm.sql +++ b/fmtm_splitter/fmtm_algorithm.sql @@ -243,7 +243,7 @@ CREATE TABLE clusteredbuildings AS ( *, ST_CLUSTERKMEANS( b.geom, - CAST((b.numfeatures / %(num_buildings)s) + 1 AS integer) + CAST((b.numfeatures / b.%(num_buildings)s) + 1 AS integer) ) OVER (PARTITION BY b.polyid) AS cid @@ -377,7 +377,7 @@ CREATE TABLE taskpolygons AS ( FROM taskpolygonsnoindex AS tpni ); -ALTER TABLE taskpolygons ADD PRIMARY KEY(taskid); +ALTER TABLE taskpolygons ADD PRIMARY KEY (taskid); SELECT POPULATE_GEOMETRY_COLUMNS('public.taskpolygons'::regclass); CREATE INDEX taskpolygons_idx ON taskpolygons @@ -457,10 +457,10 @@ FROM ( 'properties', JSONB_BUILD_OBJECT( 'building_count', ( SELECT COUNT(b.id) - FROM buildings b - WHERE ST_Contains(t.geom, b.geom) + FROM buildings AS b + WHERE ST_CONTAINS(t.geom, b.geom) ) ) ) AS feature - FROM taskpolygons t -) AS features; \ No newline at end of file + FROM taskpolygons AS t +) AS features;