Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50ec6dddf6 | ||
|
|
0ebe9babeb | ||
|
|
4fad32d5f2 |
7
NEWS.md
7
NEWS.md
@@ -1,3 +1,10 @@
|
||||
1.3.2 (2017-03-02)
|
||||
|
||||
__Bugfixes__
|
||||
|
||||
* Accept "prenormalized" as well as "predenominated" to bypass normalization.
|
||||
This fixes issues with Camshaft.
|
||||
|
||||
1.3.1 (2017-02-16)
|
||||
|
||||
__Improvements__
|
||||
|
||||
2189
release/observatory--1.3.2.sql
Normal file
2189
release/observatory--1.3.2.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
comment = 'CartoDB Observatory backend extension'
|
||||
default_version = '1.3.1'
|
||||
default_version = '1.3.2'
|
||||
requires = 'postgis'
|
||||
superuser = true
|
||||
schema = cdb_observatory
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
comment = 'CartoDB Observatory backend extension'
|
||||
default_version = '1.3.1'
|
||||
default_version = '1.3.2'
|
||||
requires = 'postgis'
|
||||
superuser = true
|
||||
schema = cdb_observatory
|
||||
|
||||
@@ -309,7 +309,7 @@ BEGIN
|
||||
map_type := 'areaNormalized';
|
||||
ELSIF normalize ILIKE 'denom%' THEN
|
||||
map_type := 'denominated';
|
||||
ELSIF normalize ILIKE 'predenom%' THEN
|
||||
ELSIF normalize ILIKE 'pre%' THEN
|
||||
map_type := 'predenominated';
|
||||
ELSE
|
||||
-- defaults: area normalization for point if it's possible and none for
|
||||
@@ -633,7 +633,7 @@ BEGIN
|
||||
-- median/average measures with universe
|
||||
WHEN LOWER(numer_aggregate) IN ('median', 'average') AND
|
||||
denom_reltype ILIKE 'universe' AND
|
||||
(normalization IS NULL OR LOWER(normalization) LIKE 'predenominated')
|
||||
(normalization IS NULL OR LOWER(normalization) LIKE 'pre%')
|
||||
THEN ' CASE ' ||
|
||||
-- predenominated point-in-poly or user polygon is the same as OBS- polygon
|
||||
' WHEN ST_GeometryType(cdb_observatory.FIRST(_geoms.geom)) = ''ST_Point'' ' ||
|
||||
@@ -665,7 +665,7 @@ BEGIN
|
||||
'END '
|
||||
-- prenormalized for summable measures. point or summable only!
|
||||
WHEN numer_aggregate ILIKE 'sum' AND
|
||||
(normalization IS NULL OR LOWER(normalization) LIKE 'predenom%')
|
||||
(normalization IS NULL OR LOWER(normalization) LIKE 'pre%')
|
||||
THEN ' CASE ' ||
|
||||
-- predenominated point-in-poly or user polygon is the same as OBS- polygon
|
||||
' WHEN ST_GeometryType(cdb_observatory.FIRST(_geoms.geom)) = ''ST_Point'' ' ||
|
||||
|
||||
@@ -171,9 +171,15 @@ t|t|t
|
||||
id|data_polygon_measure_area|nullcol
|
||||
t|t|t
|
||||
(1 row)
|
||||
id|data_point_measure_prenormalized|nullcol
|
||||
t|t|t
|
||||
(1 row)
|
||||
id|data_point_measure_predenominated|nullcol
|
||||
t|t|t
|
||||
(1 row)
|
||||
id|data_polygon_measure_prenormalized|nullcol
|
||||
t|t|t
|
||||
(1 row)
|
||||
id|data_polygon_measure_predenominated|nullcol
|
||||
t|t|t
|
||||
(1 row)
|
||||
|
||||
@@ -466,6 +466,19 @@ SELECT id = 1 id,
|
||||
data->1 IS NULL nullcol
|
||||
FROM data;
|
||||
|
||||
-- OBS_GetData/OBS_GetMeta by point geom with one standard measure predenom
|
||||
-- called "prednormalized"
|
||||
WITH
|
||||
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||
'[{"numer_id": "us.census.acs.B01003001", "normalization": "prenormalized"}]') meta),
|
||||
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||
ARRAY[(cdb_observatory._TestPoint(), 1)::geomval],
|
||||
(SELECT meta FROM meta)))
|
||||
SELECT id = 1 id,
|
||||
abs((data->0->>'value')::Numeric - 1900) / 1900 < 0.001 data_point_measure_prenormalized,
|
||||
data->1 IS NULL nullcol
|
||||
FROM data;
|
||||
|
||||
-- OBS_GetData/OBS_GetMeta by point geom with one standard measure predenom
|
||||
WITH
|
||||
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||
@@ -478,6 +491,19 @@ SELECT id = 1 id,
|
||||
data->1 IS NULL nullcol
|
||||
FROM data;
|
||||
|
||||
-- OBS_GetData/OBS_GetMeta by polygon geom with one standard measure predenom
|
||||
-- called "prenormalized"
|
||||
WITH
|
||||
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||
'[{"numer_id": "us.census.acs.B01003001", "normalization": "prenormalized"}]') meta),
|
||||
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||
(SELECT meta FROM meta)))
|
||||
SELECT id = 1 id,
|
||||
abs((data->0->>'value')::Numeric - 12327) / 12327 < 0.001 data_polygon_measure_prenormalized,
|
||||
data->1 IS NULL nullcol
|
||||
FROM data;
|
||||
|
||||
-- OBS_GetData/OBS_GetMeta by polygon geom with one standard measure predenom
|
||||
WITH
|
||||
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||
|
||||
Reference in New Issue
Block a user