Merge branch 'fix-hardcoded-getcategory-geom' into release-v-1.0.2-preview
This commit is contained in:
commit
6ce0e5a8d9
@ -470,11 +470,11 @@ BEGIN
|
|||||||
ELSE
|
ELSE
|
||||||
-- favor the category with the most area
|
-- favor the category with the most area
|
||||||
EXECUTE format(
|
EXECUTE format(
|
||||||
'SELECT %I category, SUM(overlap_fraction) category_share
|
'SELECT data.%I category, SUM(overlap_fraction) category_share
|
||||||
FROM observatory.%I data, (
|
FROM observatory.%I data, (
|
||||||
SELECT ST_Area(
|
SELECT ST_Area(
|
||||||
ST_Intersection(%L, a.%I)
|
ST_Intersection(%L, a.%I)
|
||||||
) / ST_Area(%L) AS overlap_fraction, %I geomref
|
) / ST_Area(%L) AS overlap_fraction, a.%I geomref
|
||||||
FROM observatory.%I as a
|
FROM observatory.%I as a
|
||||||
WHERE %L && a.%I) _overlaps
|
WHERE %L && a.%I) _overlaps
|
||||||
WHERE data.%I = _overlaps.geomref
|
WHERE data.%I = _overlaps.geomref
|
||||||
|
Loading…
Reference in New Issue
Block a user