Add dot-density function

Pending: documentation
This commit is contained in:
Javier Goizueta
2016-02-18 19:16:08 +01:00
parent a5d20c2ccf
commit 1aa72cea85
4 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
WITH g AS (
SELECT ST_Buffer(ST_SetSRID(ST_MakePoint(0,0),4326)::geometry, 1000)::geometry AS g
),
points AS(
SELECT (
ST_Dump(
cdb_crankshaft.cdb_dot_density(g.g, 100)
)
).geom AS p FROM g
)
SELECT count(*), sum(CASE WHEN ST_Contains(g,p) THEN 1 ELSE 0 END) FROM points, g