Slight optimization of gridded clustering
This commit is contained in:
parent
564ab75d2d
commit
c8a1ef6f68
@ -193,14 +193,14 @@ AS $$
|
|||||||
aggr_attributes := '';
|
aggr_attributes := '';
|
||||||
|
|
||||||
EXECUTE Format('DROP TABLE IF EXISTS %s CASCADE;', overview_rel);
|
EXECUTE Format('DROP TABLE IF EXISTS %s CASCADE;', overview_rel);
|
||||||
|
|
||||||
EXECUTE Format('
|
EXECUTE Format('
|
||||||
CREATE TABLE %3$s AS
|
CREATE TABLE %3$s AS
|
||||||
WITH clusters AS (
|
WITH clusters AS (
|
||||||
SELECT
|
SELECT
|
||||||
first_value(f.cartodb_id) OVER (
|
first_value(f.cartodb_id) OVER (
|
||||||
PARTITION BY
|
PARTITION BY
|
||||||
ST_SnapToGrid(f.the_geom_webmercator, 0, 0, %2$s, %2$s)
|
Floor(ST_X(f.the_geom_webmercator)/%2$s)::int,
|
||||||
|
Floor(ST_Y(f.the_geom_webmercator)/%2$s)::int
|
||||||
) AS cartodb_id,
|
) AS cartodb_id,
|
||||||
%4$s
|
%4$s
|
||||||
the_geom,
|
the_geom,
|
||||||
|
Loading…
Reference in New Issue
Block a user