updating getGeometry* to getBoundary*
This commit is contained in:
parent
6230e52d98
commit
d5e67b9fe1
@ -4,7 +4,7 @@
|
|||||||
-- First, the Spanish Census, and so on
|
-- First, the Spanish Census, and so on
|
||||||
|
|
||||||
|
|
||||||
-- OBS_GetGeometry
|
-- OBS_GetBoundary
|
||||||
--
|
--
|
||||||
-- Returns the boundary polygon(s) that overlap with the input point geometry.
|
-- Returns the boundary polygon(s) that overlap with the input point geometry.
|
||||||
-- From an input point geometry, find the boundary which intersects with the
|
-- From an input point geometry, find the boundary which intersects with the
|
||||||
@ -21,7 +21,7 @@
|
|||||||
-- resolution requested with boundary_id, and time_span
|
-- resolution requested with boundary_id, and time_span
|
||||||
--
|
--
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetGeometry(
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundary(
|
||||||
geom geometry(Geometry, 4326),
|
geom geometry(Geometry, 4326),
|
||||||
boundary_id text,
|
boundary_id text,
|
||||||
time_span text DEFAULT NULL)
|
time_span text DEFAULT NULL)
|
||||||
@ -84,7 +84,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
-- OBS_GetGeometryId
|
-- OBS_GetBoundaryId
|
||||||
--
|
--
|
||||||
-- retrieves the boundary identifier (e.g., '36047' = Kings County/Brooklyn, NY)
|
-- retrieves the boundary identifier (e.g., '36047' = Kings County/Brooklyn, NY)
|
||||||
-- corresponding to the location geom and boundary types (e.g.,
|
-- corresponding to the location geom and boundary types (e.g.,
|
||||||
@ -103,7 +103,7 @@ $$ LANGUAGE plpgsql;
|
|||||||
-- time_span
|
-- time_span
|
||||||
--
|
--
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetGeometryId(
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundaryId(
|
||||||
geom geometry(Geometry, 4326),
|
geom geometry(Geometry, 4326),
|
||||||
boundary_id text,
|
boundary_id text,
|
||||||
time_span text DEFAULT NULL
|
time_span text DEFAULT NULL
|
||||||
@ -163,7 +163,7 @@ END;
|
|||||||
$$ LANGUAGE plpgsql;
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
-- OBS_GetGeometryById
|
-- OBS_GetBoundaryById
|
||||||
--
|
--
|
||||||
-- Given a geometry reference (e.g., geoid for US Census), and it's geometry
|
-- Given a geometry reference (e.g., geoid for US Census), and it's geometry
|
||||||
-- level (see OBS_ListGeomColumns() for all available boundary ids), give back
|
-- level (see OBS_ListGeomColumns() for all available boundary ids), give back
|
||||||
@ -182,7 +182,7 @@ $$ LANGUAGE plpgsql;
|
|||||||
-- resolution requested with boundary_id, and time_span
|
-- resolution requested with boundary_id, and time_span
|
||||||
--
|
--
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetGeometryById(
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundaryById(
|
||||||
geometry_id text, -- ex: '36047'
|
geometry_id text, -- ex: '36047'
|
||||||
boundary_id text, -- ex: '"us.census.tiger".county'
|
boundary_id text, -- ex: '"us.census.tiger".county'
|
||||||
time_span text DEFAULT NULL --ex: '2009'
|
time_span text DEFAULT NULL --ex: '2009'
|
||||||
|
@ -27,46 +27,46 @@ Loading obs_d34555209878e8c4b37cf0b2b3d072ff129ec470.sql fixture file...
|
|||||||
Done.
|
Done.
|
||||||
Loading obs_b0ef6dd68d5faddbf231fd7f02916b3d00ec43c4.sql fixture file...
|
Loading obs_b0ef6dd68d5faddbf231fd7f02916b3d00ec43c4.sql fixture file...
|
||||||
Done.
|
Done.
|
||||||
obs_getgeometry_cartodb_census_tract
|
obs_getboundary_cartodb_census_tract
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometry_cartodb_county
|
obs_getboundary_cartodb_county
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometry_non_existent_boundary_id
|
obs_getboundary_non_existent_boundary_id
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometry_null_island_census_tract
|
obs_getboundary_null_island_census_tract
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometry_year_census_tract
|
obs_getboundary_year_census_tract
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometry_unlisted_year
|
obs_getboundary_unlisted_year
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometryid_cartodb_census_tract
|
obs_getboundaryid_cartodb_census_tract
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometryid_cartodb_census_tract_with_year
|
obs_getboundaryid_cartodb_census_tract_with_year
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometryid_cartodb_county_with_year
|
obs_getboundaryid_cartodb_county_with_year
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometryid_null_island
|
obs_getboundaryid_null_island
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometrybyid_cartodb_county
|
obs_getboundarybyid_cartodb_county
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometrybyid_compared_with_obs_getgeometry
|
obs_getboundarybyid_compared_with_obs_getboundary
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometrybyid_boundary_id_mismatch_geom_id
|
obs_getboundarybyid_boundary_id_mismatch_geom_id
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
obs_getgeometrybyid_boundary_id_mismatch_geom_id
|
obs_getboundarybyid_boundary_id_mismatch_geom_id
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
Dropping obs_table.sql fixture table...
|
Dropping obs_table.sql fixture table...
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user