Compare commits
1037
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a22b907b6 | ||
|
|
4aed149bd6 | ||
|
|
aea815237a | ||
|
|
f3dbccdbf3 | ||
|
|
f23df546b8 | ||
|
|
7dd14ba29b | ||
|
|
7f969ae064 | ||
|
|
3295dd069f | ||
|
|
66031a9167 | ||
|
|
ebf2c92f08 | ||
|
|
d6990134b6 | ||
|
|
9caeacf912 | ||
|
|
947566ee19 | ||
|
|
6a063ca0eb | ||
|
|
a0b2c86645 | ||
|
|
ccbc73cd6c | ||
|
|
7932726a0e | ||
|
|
63ad09cd87 | ||
|
|
d8e99d75aa | ||
|
|
bac5237d84 | ||
|
|
70e027bfd0 | ||
|
|
50bddfd08d | ||
|
|
9ed3c45547 | ||
|
|
0451478099 | ||
|
|
78799a59a4 | ||
|
|
8acd5d39b6 | ||
|
|
509d1d727a | ||
|
|
2f76772b4a | ||
|
|
9ca4d755c9 | ||
|
|
9b62a0980f | ||
|
|
01aea9e698 | ||
|
|
42226aa263 | ||
|
|
d21b34bb32 | ||
|
|
d3db90a823 | ||
|
|
5e829bc402 | ||
|
|
e89582eea6 | ||
|
|
efec69c957 | ||
|
|
1af8ab01f6 | ||
|
|
44727ac44c | ||
|
|
f4b8c39870 | ||
|
|
c354d48f28 | ||
|
|
96b5d84394 | ||
|
|
a32d0e0141 | ||
|
|
52fd8de04e | ||
|
|
0a029404c8 | ||
|
|
d932be1a9f | ||
|
|
b979167156 | ||
|
|
c6ef9b7f3a | ||
|
|
4e57558da6 | ||
|
|
3172a11d9d | ||
|
|
56a83f3eb5 | ||
|
|
f2710e9505 | ||
|
|
f5d6716acc | ||
|
|
e72b4ea7b6 | ||
|
|
0f9c53ddc2 | ||
|
|
f148057e45 | ||
|
|
865c1a38c3 | ||
|
|
6924cc4512 | ||
|
|
c62d1cd4b8 | ||
|
|
0d172353fb | ||
|
|
23088efc91 | ||
|
|
e2017d41cf | ||
|
|
d1c302a9df | ||
|
|
ef51209ee1 | ||
|
|
7c559fe7d5 | ||
|
|
0ae15880e0 | ||
|
|
811009a8ad | ||
|
|
f1668777d5 | ||
|
|
f050c05a55 | ||
|
|
467883726b | ||
|
|
915e67c061 | ||
|
|
2e365b1eee | ||
|
|
9f62a8c127 | ||
|
|
d050b968a4 | ||
|
|
78a7ccbe4b | ||
|
|
92155b6b33 | ||
|
|
5c4bb80f57 | ||
|
|
b8d00c49cb | ||
|
|
dcf10edd9e | ||
|
|
db637f6e52 | ||
|
|
4b128ea3e8 | ||
|
|
93790e9f0d | ||
|
|
d309a25379 | ||
|
|
50008ea149 | ||
|
|
5f9f77ded1 | ||
|
|
3fba8a3091 | ||
|
|
fafd4a364e | ||
|
|
46d7027cdb | ||
|
|
2cc14a9892 | ||
|
|
a0535a6d02 | ||
|
|
198ac90a0e | ||
|
|
19c5b09f2b | ||
|
|
eb31a8f40a | ||
|
|
43408f8de0 | ||
|
|
0a9fb4d51d | ||
|
|
b5afd0734b | ||
|
|
3e9e2f69c4 | ||
|
|
0241f03329 | ||
|
|
a3fc313ffb | ||
|
|
3816c2af8b | ||
|
|
ed3b7de9e0 | ||
|
|
350b1716e0 | ||
|
|
b3f2809851 | ||
|
|
a5a2d59e0b | ||
|
|
5a19090b41 | ||
|
|
cff0576368 | ||
|
|
2778986e15 | ||
|
|
5aba51d86d | ||
|
|
7340003c91 | ||
|
|
10b9fd3e72 | ||
|
|
ab0fb6abf9 | ||
|
|
ddb69e61a3 | ||
|
|
85883a1686 | ||
|
|
120d4e7c71 | ||
|
|
b9f29821f2 | ||
|
|
a766233af0 | ||
|
|
0e7898fdab | ||
|
|
c10c5c5021 | ||
|
|
4fc22dc188 | ||
|
|
6ce5e278e9 | ||
|
|
c0126bf5c7 | ||
|
|
7f6a72a65f | ||
|
|
8e714ddf2f | ||
|
|
a3f817b2b8 | ||
|
|
eb761cc6e7 | ||
|
|
0db98f4020 | ||
|
|
e9dbc97772 | ||
|
|
8f9c8cf164 | ||
|
|
b891034146 | ||
|
|
89f76e2a1a | ||
|
|
850b3c2524 | ||
|
|
5ee349f4e4 | ||
|
|
b4ba9b5d1d | ||
|
|
be82c87bb1 | ||
|
|
7aac256892 | ||
|
|
17345f4fca | ||
|
|
db585177ab | ||
|
|
fb17d05714 | ||
|
|
e469fb7920 | ||
|
|
6d23509557 | ||
|
|
e07ee0b882 | ||
|
|
2183b7fc26 | ||
|
|
1d5f8a6452 | ||
|
|
f583cca67a | ||
|
|
b4507b42b1 | ||
|
|
3c475d72df | ||
|
|
8c72122fb8 | ||
|
|
b93e7e8843 | ||
|
|
ff0989f8fc | ||
|
|
0a753e95c0 | ||
|
|
b62e3ea963 | ||
|
|
1da0b8cb6b | ||
|
|
a39de46531 | ||
|
|
94b8e7492d | ||
|
|
91ece26c06 | ||
|
|
74b9d209c0 | ||
|
|
4ae889dfdc | ||
|
|
3353ad0a32 | ||
|
|
b4ef3c77a9 | ||
|
|
90a2421b6e | ||
|
|
fd21709ca1 | ||
|
|
3791511d7d | ||
|
|
fad541c3fc | ||
|
|
48ed086fec | ||
|
|
7e550cf909 | ||
|
|
6ab17bf8be | ||
|
|
1f7f8015ad | ||
|
|
6066ef028d | ||
|
|
3c2e997a85 | ||
|
|
cef99c6343 | ||
|
|
50d975ce9b | ||
|
|
c56633dd2a | ||
|
|
2b26c5ad64 | ||
|
|
3ed18ca1f0 | ||
|
|
028c93170c | ||
|
|
8d52857f01 | ||
|
|
9e36e11bb3 | ||
|
|
adae37631e | ||
|
|
8b98b6b64a | ||
|
|
aedc45f2a8 | ||
|
|
8612da57f7 | ||
|
|
24a736c72e | ||
|
|
cde6d5bfba | ||
|
|
d1f4e570ad | ||
|
|
415a4ccc05 | ||
|
|
ccb8092506 | ||
|
|
6266262427 | ||
|
|
183c046289 | ||
|
|
8df89f4a91 | ||
|
|
28694163a2 | ||
|
|
60c7f54315 | ||
|
|
3ebb0b8662 | ||
|
|
a2e84696dc | ||
|
|
cd5cb38e8d | ||
|
|
26e1a2f461 | ||
|
|
090a1add43 | ||
|
|
536af5e4a2 | ||
|
|
ebf23d2a23 | ||
|
|
f1afcf0d8e | ||
|
|
3c0b40cf3f | ||
|
|
8a87dc7e9a | ||
|
|
61552adba4 | ||
|
|
36abbee64f | ||
|
|
5a76a7381e | ||
|
|
217ca2d84d | ||
|
|
f1bf4259bc | ||
|
|
a2609d9d07 | ||
|
|
01779991bb | ||
|
|
ec53d354e9 | ||
|
|
c1aa91da5b | ||
|
|
93ebd9aa0f | ||
|
|
4a29c060ef | ||
|
|
1639bea74a | ||
|
|
765cbfcccc | ||
|
|
c4f3c5d534 | ||
|
|
d5e7d95824 | ||
|
|
3ff1b36d7f | ||
|
|
c28cdeb767 | ||
|
|
b1d672bfe4 | ||
|
|
524d477f7b | ||
|
|
7ef035580f | ||
|
|
20b347528c | ||
|
|
d070802f53 | ||
|
|
751f470049 | ||
|
|
a1b5f01d57 | ||
|
|
f2d2b32bf1 | ||
|
|
02413eb974 | ||
|
|
1a4a2edbc6 | ||
|
|
47c6453bbc | ||
|
|
5f2daad408 | ||
|
|
764a1ce7cd | ||
|
|
12235c7138 | ||
|
|
3f817f8e9a | ||
|
|
5ca2664a17 | ||
|
|
1b913c77c4 | ||
|
|
22eb6349c2 | ||
|
|
862db2c33a | ||
|
|
e2f92d78cf | ||
|
|
3df1ffc3c8 | ||
|
|
6a60cfc417 | ||
|
|
3b6b1b4843 | ||
|
|
460059f2cf | ||
|
|
fc111dd1e2 | ||
|
|
7cbef7e1b5 | ||
|
|
deede798e9 | ||
|
|
fd3918b29c | ||
|
|
cdf7b17a4d | ||
|
|
50ec6dddf6 | ||
|
|
0ebe9babeb | ||
|
|
4fad32d5f2 | ||
|
|
f0efa1e2eb | ||
|
|
bcbd8a2be4 | ||
|
|
63ae7c1392 | ||
|
|
af671931d4 | ||
|
|
71d891c067 | ||
|
|
01b56fbfcc | ||
|
|
6215f6585c | ||
|
|
9bda063148 | ||
|
|
4a97689705 | ||
|
|
2edb850a45 | ||
|
|
8120081d68 | ||
|
|
72ced1a7a7 | ||
|
|
d15b74a594 | ||
|
|
60ab773549 | ||
|
|
01b70dd06e | ||
|
|
4b409cc9f4 | ||
|
|
79c450f63f | ||
|
|
c8dd9e417b | ||
|
|
2717ecdc8b | ||
|
|
0f372604db | ||
|
|
c5a715f7b5 | ||
|
|
e4b38413cd | ||
|
|
ee84604ced | ||
|
|
5e7bffae6a | ||
|
|
aa807eb65b | ||
|
|
80277ba065 | ||
|
|
0e4a514753 | ||
|
|
fc74529a04 | ||
|
|
a18d88a85f | ||
|
|
8ea972f4a0 | ||
|
|
0e99e62eb2 | ||
|
|
3db98fb522 | ||
|
|
c18f16ed6d | ||
|
|
fa82c1bb4f | ||
|
|
00825e4ba1 | ||
|
|
afe4c27dd5 | ||
|
|
c2dc4fb8b9 | ||
|
|
bc4f1b5909 | ||
|
|
267af19911 | ||
|
|
7c093741dc | ||
|
|
4886222776 | ||
|
|
ddbe1b6763 | ||
|
|
218840bfa8 | ||
|
|
000a440417 | ||
|
|
ff50c5e2bf | ||
|
|
d7552031f6 | ||
|
|
39eb031316 | ||
|
|
7adbad602e | ||
|
|
3233cb527e | ||
|
|
5bdcb59df3 | ||
|
|
6e475cf210 | ||
|
|
eb508c5d16 | ||
|
|
bbd0cc0938 | ||
|
|
d44887b2b3 | ||
|
|
fa96de5aa9 | ||
|
|
b7943ad8d2 | ||
|
|
6b071db588 | ||
|
|
fbf13be62a | ||
|
|
fc3fcbec4e | ||
|
|
d3a57e637c | ||
|
|
24587b7e03 | ||
|
|
2398b0268f | ||
|
|
4c6d854e81 | ||
|
|
fd32f962f2 | ||
|
|
462eed1d61 | ||
|
|
5a5d5a9386 | ||
|
|
88d1145c12 | ||
|
|
8455468ad0 | ||
|
|
9567f52a36 | ||
|
|
fad7bb991b | ||
|
|
d17b865648 | ||
|
|
d4e6e7ac95 | ||
|
|
e77ebe7bb1 | ||
|
|
82137d5679 | ||
|
|
d745f07cac | ||
|
|
aa3e0ed76b | ||
|
|
f378e75d4c | ||
|
|
f97482f3fb | ||
|
|
36f1c1974a | ||
|
|
21b108d32c | ||
|
|
9f640f0c35 | ||
|
|
95b6cba085 | ||
|
|
6a6d1bc3e4 | ||
|
|
99166d1b4e | ||
|
|
e33bcae964 | ||
|
|
48a8df8b98 | ||
|
|
4b9ba06b42 | ||
|
|
209832e38d | ||
|
|
7373794c30 | ||
|
|
1a2e1dd8c9 | ||
|
|
14b82a0e09 | ||
|
|
7e20a200c1 | ||
|
|
39473db14b | ||
|
|
4d7fb145eb | ||
|
|
8e51d33e4a | ||
|
|
b7ee3a6d67 | ||
|
|
d4dcb7f4ba | ||
|
|
401317738f | ||
|
|
1aca5b5ff0 | ||
|
|
521fcf9059 | ||
|
|
255f8dc18e | ||
|
|
463db99222 | ||
|
|
59857355c7 | ||
|
|
44932be1f5 | ||
|
|
4ce1648550 | ||
|
|
ff0f6ea6e0 | ||
|
|
34a3aab323 | ||
|
|
f32cc60d61 | ||
|
|
81c8fc316b | ||
|
|
cbe7b6dd15 | ||
|
|
70f4807139 | ||
|
|
603d26c674 | ||
|
|
355f6281e5 | ||
|
|
84794124fd | ||
|
|
6c08681446 | ||
|
|
e5e0b39595 | ||
|
|
713aacf535 | ||
|
|
9bf4b07be7 | ||
|
|
aaf580baca | ||
|
|
6845d4361d | ||
|
|
fa778f4eb0 | ||
|
|
22a413102b | ||
|
|
08980f47a7 | ||
|
|
54d512d4fb | ||
|
|
2a0ff6a541 | ||
|
|
62e13086e1 | ||
|
|
60b723de92 | ||
|
|
7e04c38c3a | ||
|
|
45dea25ec0 | ||
|
|
39836ea321 | ||
|
|
17d343a756 | ||
|
|
c7c8a6676a | ||
|
|
be4b5abbfa | ||
|
|
8dad88a6b3 | ||
|
|
7e6489f2a1 | ||
|
|
9fdca9161c | ||
|
|
785a5eed29 | ||
|
|
c91fcab28c | ||
|
|
174ee65f46 | ||
|
|
4aac696963 | ||
|
|
5c5b587495 | ||
|
|
dccae1ed8b | ||
|
|
1e02593fae | ||
|
|
89d10ff993 | ||
|
|
e35b7825ce | ||
|
|
ff613f7c12 | ||
|
|
06e0b5bcf8 | ||
|
|
efae735324 | ||
|
|
7bf87faba1 | ||
|
|
0b7e794fb9 | ||
|
|
017b404264 | ||
|
|
50b745227b | ||
|
|
2171cb83c7 | ||
|
|
0d9f0e4996 | ||
|
|
b473ffe307 | ||
|
|
2a1598d491 | ||
|
|
827104756e | ||
|
|
3602aab804 | ||
|
|
48221fc358 | ||
|
|
5629bdf035 | ||
|
|
f4113eaea3 | ||
|
|
86fac2a600 | ||
|
|
2d753cd758 | ||
|
|
96a98c3bce | ||
|
|
d58263935d | ||
|
|
104608c6d3 | ||
|
|
c67fe12111 | ||
|
|
18cfdc60d0 | ||
|
|
d63934bfc5 | ||
|
|
860290595c | ||
|
|
bf4ade2fa0 | ||
|
|
32d37a74b3 | ||
|
|
da877e4ef0 | ||
|
|
15de07ca33 | ||
|
|
8af3e22661 | ||
|
|
fdd591b159 | ||
|
|
5eb4ede219 | ||
|
|
dd5f560359 | ||
|
|
62c2693553 | ||
|
|
48d1bfdb13 | ||
|
|
30f27e5b58 | ||
|
|
26b22a9bf4 | ||
|
|
c9e809c061 | ||
|
|
43e83751ae | ||
|
|
4c13434b9a | ||
|
|
8785639ece | ||
|
|
f991f5a1e6 | ||
|
|
e4b4ebf72d | ||
|
|
20f56c98de | ||
|
|
e4ea90835a | ||
|
|
8f2c8f571c | ||
|
|
e9857e89fb | ||
|
|
8ed2135a7f | ||
|
|
af69b44f25 | ||
|
|
e12b729c51 | ||
|
|
a42827a3c9 | ||
|
|
948cdbff19 | ||
|
|
1c7c73f948 | ||
|
|
360adc47df | ||
|
|
571f1f343a | ||
|
|
186c57efbd | ||
|
|
b139a24012 | ||
|
|
260704327e | ||
|
|
252610673a | ||
|
|
d054f37528 | ||
|
|
3d58fd284a | ||
|
|
efcea9be7b | ||
|
|
cf242515e3 | ||
|
|
4c434f5448 | ||
|
|
59dd09c554 | ||
|
|
8187ab4bbe | ||
|
|
e54d95fa8f | ||
|
|
d766f08b03 | ||
|
|
8f345fd508 | ||
|
|
383c3eb6ec | ||
|
|
798c0a73a1 | ||
|
|
bfa57f4971 | ||
|
|
e7a16f4b4d | ||
|
|
540ff68a90 | ||
|
|
6a1df2abd1 | ||
|
|
dc9ed2de33 | ||
|
|
acaa434118 | ||
|
|
173d7c0aec | ||
|
|
970d5d2119 | ||
|
|
a3681062cb | ||
|
|
a179a46b86 | ||
|
|
4c434ffb8d | ||
|
|
b041821fc0 | ||
|
|
876515f9aa | ||
|
|
25570e5b11 | ||
|
|
1054443117 | ||
|
|
d93752efa3 | ||
|
|
588cda3262 | ||
|
|
e43d0ca4cf | ||
|
|
987c4c5b76 | ||
|
|
51ce13f8b9 | ||
|
|
25f4dbc416 | ||
|
|
c09e0b6e83 | ||
|
|
748428ace1 | ||
|
|
10a0dc9b26 | ||
|
|
9245de84b0 | ||
|
|
514e1e4c5b | ||
|
|
7bb1bbd804 | ||
|
|
1d008ccbe9 | ||
|
|
f581278b8a | ||
|
|
cbf1c5e67d | ||
|
|
adc663b563 | ||
|
|
3a37b98b72 | ||
|
|
a4a20e9c1d | ||
|
|
f485426085 | ||
|
|
75e765f256 | ||
|
|
b690478aff | ||
|
|
6fa9d5c96a | ||
|
|
fc6317161f | ||
|
|
c07d9f6833 | ||
|
|
ff173a0152 | ||
|
|
a7de1f2228 | ||
|
|
86529ada5a | ||
|
|
80cdc5e8ca | ||
|
|
7c8c5cca0a | ||
|
|
a946ab9d03 | ||
|
|
da127baa3c | ||
|
|
e89a88aa83 | ||
|
|
af2259bb0a | ||
|
|
fb083f4b9e | ||
|
|
976e119abb | ||
|
|
bbc6f9ef36 | ||
|
|
5229279ee9 | ||
|
|
0090e537fc | ||
|
|
e4052ed565 | ||
|
|
2107796f07 | ||
|
|
2463623658 | ||
|
|
91797918c1 | ||
|
|
6a39bedee7 | ||
|
|
6ce0e5a8d9 | ||
|
|
81176d1df2 | ||
|
|
f22854b4e9 | ||
|
|
54701d595a | ||
|
|
4b26eeda65 | ||
|
|
4fc02f99e2 | ||
|
|
5bb4285528 | ||
|
|
1e9c3fb860 | ||
|
|
62a2c259a7 | ||
|
|
61854a070d | ||
|
|
8654c22c87 | ||
|
|
62c08864af | ||
|
|
af39a37b43 | ||
|
|
26b61a6ddb | ||
|
|
965fb94704 | ||
|
|
84dec8bdf4 | ||
|
|
568996930b | ||
|
|
ebc27dbbb7 | ||
|
|
56fa19118b | ||
|
|
4f3baac10a | ||
|
|
b512985b46 | ||
|
|
329b4dbca3 | ||
|
|
897cf38d42 | ||
|
|
fe6343c73f | ||
|
|
26ee8aedb1 | ||
|
|
66e2c6be54 | ||
|
|
6b41994a87 | ||
|
|
d3d5cbdbbd | ||
|
|
4d51ecc12e | ||
|
|
c0030acb0c | ||
|
|
e938ee0c7b | ||
|
|
8fa2d642bf | ||
|
|
926435a908 | ||
|
|
80073aa213 | ||
|
|
3f78797e14 | ||
|
|
11dbb860ab | ||
|
|
9ade6588e2 | ||
|
|
5ef1427bc3 | ||
|
|
3f63f6f138 | ||
|
|
3d59adc452 | ||
|
|
50c5f01f3f | ||
|
|
0dad5427c4 | ||
|
|
71c098c1c3 | ||
|
|
4057f76fc1 | ||
|
|
17aeb5187b | ||
|
|
cf7c115a76 | ||
|
|
4e8341daab | ||
|
|
ca4327d3cd | ||
|
|
bac48d7bea | ||
|
|
91383fe933 | ||
|
|
446bdec30d | ||
|
|
f362e97f88 | ||
|
|
975137641d | ||
|
|
9379224629 | ||
|
|
7733529ff5 | ||
|
|
5a68f77b64 | ||
|
|
63448d6214 | ||
|
|
a18b07fa84 | ||
|
|
11b05877f4 | ||
|
|
62b23be2e0 | ||
|
|
eefdae8a58 | ||
|
|
563c31a77f | ||
|
|
3334e60ab8 | ||
|
|
da6aac4a18 | ||
|
|
5e99b60329 | ||
|
|
67d735af03 | ||
|
|
e960f3e097 | ||
|
|
8fbb9ebbcc | ||
|
|
389823d4fd | ||
|
|
076e285ed7 | ||
|
|
43dc37f62b | ||
|
|
49d584822c | ||
|
|
02ca484719 | ||
|
|
a7785bcae2 | ||
|
|
faa72b69ed | ||
|
|
023e48503e | ||
|
|
4d3b147497 | ||
|
|
7250be9efe | ||
|
|
dc718ab7d0 | ||
|
|
de567e4dc7 | ||
|
|
3502282835 | ||
|
|
f9ecf1595c | ||
|
|
614bce3051 | ||
|
|
b5267c14bf | ||
|
|
afb548c75d | ||
|
|
94756a2377 | ||
|
|
2e312464aa | ||
|
|
3f77a384c7 | ||
|
|
1ba7299fe4 | ||
|
|
45ae255223 | ||
|
|
dc5e9ba2ad | ||
|
|
a6e2530dda | ||
|
|
b848ccc077 | ||
|
|
ebcc9130c7 | ||
|
|
974911e01b | ||
|
|
8c1db899dd | ||
|
|
7e431ea223 | ||
|
|
73dfba2d4b | ||
|
|
d189bbe3c7 | ||
|
|
90aa7c2417 | ||
|
|
a1bbd5ace5 | ||
|
|
d92f472708 | ||
|
|
38226e40b4 | ||
|
|
faa3c168da | ||
|
|
6e1477890c | ||
|
|
5d5df7d57a | ||
|
|
ffa0f7c95f | ||
|
|
ea88a07855 | ||
|
|
9186635387 | ||
|
|
87aae34dcc | ||
|
|
792d6c90a1 | ||
|
|
dffda42f5d | ||
|
|
1894c421ec | ||
|
|
00165b17e6 | ||
|
|
6a5e299fa5 | ||
|
|
fe3a6759f7 | ||
|
|
05ac246032 | ||
|
|
51705eb411 | ||
|
|
797b217c8f | ||
|
|
eb5bcb2f18 | ||
|
|
7f34c5e0e9 | ||
|
|
fdfab967af | ||
|
|
0848d5aee4 | ||
|
|
54d0a6319c | ||
|
|
bb78ea7fe5 | ||
|
|
a49be9506f | ||
|
|
73200df38b | ||
|
|
49d3962a54 | ||
|
|
9cddac7768 | ||
|
|
a9d357699a | ||
|
|
8d17375766 | ||
|
|
323435fcfa | ||
|
|
ddf9e9f3cc | ||
|
|
3983967920 | ||
|
|
3f76602028 | ||
|
|
e145d26cbd | ||
|
|
fd483b60f4 | ||
|
|
5f1a49f879 | ||
|
|
e4d8422787 | ||
|
|
80d7813845 | ||
|
|
0d5e45fc98 | ||
|
|
52f44e995a | ||
|
|
b73883aa1c | ||
|
|
4f82b9d3f2 | ||
|
|
f17dc6d8ff | ||
|
|
f0baf48e85 | ||
|
|
b296845d02 | ||
|
|
1a51c786d3 | ||
|
|
a3bf071acb | ||
|
|
cd82837a51 | ||
|
|
b19e774604 | ||
|
|
7205676913 | ||
|
|
5d9a12dac0 | ||
|
|
c4b45606a8 | ||
|
|
b5f4a617e8 | ||
|
|
57adaf78d6 | ||
|
|
e78b9f603c | ||
|
|
60e716878f | ||
|
|
1e0b0a181c | ||
|
|
94495e793e | ||
|
|
75c8e052a1 | ||
|
|
c53bc10a26 | ||
|
|
4536de681e | ||
|
|
8563ca7e45 | ||
|
|
b074c1194b | ||
|
|
02a529f0fc | ||
|
|
4af1eb8efd | ||
|
|
126643b84e | ||
|
|
d3ff79c398 | ||
|
|
08bbfe190a | ||
|
|
73e768d698 | ||
|
|
60606db136 | ||
|
|
f56ab75859 | ||
|
|
06204d471e | ||
|
|
8959ec4e9a | ||
|
|
c6213e388c | ||
|
|
9ff99cbfbd | ||
|
|
7e7f572bf1 | ||
|
|
d99312aa06 | ||
|
|
2c10e75af6 | ||
|
|
8696037dd6 | ||
|
|
4fb79c6bc4 | ||
|
|
18eb4b8e41 | ||
|
|
cc798730a2 | ||
|
|
9a5c8777ce | ||
|
|
3230a9996b | ||
|
|
02a4dbde57 | ||
|
|
d0122786db | ||
|
|
e72c0521ea | ||
|
|
e74964c1ee | ||
|
|
bab13bd5ad | ||
|
|
bd6f3e2337 | ||
|
|
0acf9aa4ba | ||
|
|
aca37666fa | ||
|
|
8e3c75a94b | ||
|
|
1152eb542a | ||
|
|
3f1b1cfcb9 | ||
|
|
ebb2af249b | ||
|
|
9a7c0885bf | ||
|
|
a6c395e3be | ||
|
|
506f9ead30 | ||
|
|
ccf61c3583 | ||
|
|
d1c2598167 | ||
|
|
b2b34bfe05 | ||
|
|
011baaacd5 | ||
|
|
ce0601e157 | ||
|
|
e9f6326f04 | ||
|
|
7e1fcc2b15 | ||
|
|
b656569d51 | ||
|
|
addaef7d40 | ||
|
|
d2233609bc | ||
|
|
00ebca5132 | ||
|
|
aab24d00dd | ||
|
|
56f4d2f256 | ||
|
|
b21ff8a65e | ||
|
|
4d60a211de | ||
|
|
2be3943e56 | ||
|
|
6b4158ae09 | ||
|
|
a6752e090d | ||
|
|
9d3bb40877 | ||
|
|
ec1c2f8dfb | ||
|
|
340e4b7ce1 | ||
|
|
96f67129ab | ||
|
|
c8a1265b49 | ||
|
|
c1ac8ad64b | ||
|
|
397d8f28ec | ||
|
|
36698cce22 | ||
|
|
c2ea695bd2 | ||
|
|
321daf0a5d | ||
|
|
446fb34618 | ||
|
|
2f91b8f298 | ||
|
|
7c57d8b9e3 | ||
|
|
0a0b7347fe | ||
|
|
8874b07474 | ||
|
|
ff9923a466 | ||
|
|
26f0ee79fa | ||
|
|
b132e8992d | ||
|
|
e8c8c0e039 | ||
|
|
1ffa6b48e9 | ||
|
|
9f9c27e8bc | ||
|
|
e5fd0eaca9 | ||
|
|
1bddece563 | ||
|
|
1934957135 | ||
|
|
0671a5ba48 | ||
|
|
c7b74b068f | ||
|
|
b665773b50 | ||
|
|
314a241ec6 | ||
|
|
237ad8ec00 | ||
|
|
de8110157a | ||
|
|
af14526734 | ||
|
|
c0d04c7d9b | ||
|
|
0e64257a3b | ||
|
|
5593e4776b | ||
|
|
0dba8c8132 | ||
|
|
2ba0234143 | ||
|
|
b85d750ed1 | ||
|
|
08d2016b1c | ||
|
|
ba3a98af20 | ||
|
|
6a04409875 | ||
|
|
8ddc32f2c9 | ||
|
|
043d66e30c | ||
|
|
bd1ad1414e | ||
|
|
66c7e7692a | ||
|
|
c3a84d6395 | ||
|
|
42395efd21 | ||
|
|
dcca7bef23 | ||
|
|
579e0bc6c3 | ||
|
|
61f3c4b58f | ||
|
|
28028f1b04 | ||
|
|
e1d8d4e903 | ||
|
|
858e20c9c9 | ||
|
|
d5275c3f54 | ||
|
|
434c291247 | ||
|
|
9de2c15a39 | ||
|
|
89343a2ae3 | ||
|
|
192e4045cc | ||
|
|
ad348136da | ||
|
|
c05d4cb909 | ||
|
|
94b1ad4a71 | ||
|
|
1973198a06 | ||
|
|
91559480d0 | ||
|
|
21d74dc226 | ||
|
|
10ec53f08e | ||
|
|
6a595b36a0 | ||
|
|
3839261d89 | ||
|
|
7c655dcaa6 | ||
|
|
f9394129d9 | ||
|
|
dfbdb3c9ad | ||
|
|
25b3e5e2ec | ||
|
|
8e43b87933 | ||
|
|
b005fc5d9e | ||
|
|
b6e0cfc8e3 | ||
|
|
c96b6ef261 | ||
|
|
8733b819fe | ||
|
|
e39b438a0a | ||
|
|
d747d3d3a9 | ||
|
|
a5a011e9db | ||
|
|
c46630847b | ||
|
|
67c66358e8 | ||
|
|
d4b0f72016 | ||
|
|
66f2948d4d | ||
|
|
cff1189acd | ||
|
|
290ca3cb20 | ||
|
|
e306408a6a | ||
|
|
499eb6da62 | ||
|
|
5dcec6e126 | ||
|
|
73f8ea1b4e | ||
|
|
7aabc1be76 | ||
|
|
111d07c80a | ||
|
|
4a3d35759b | ||
|
|
10df7bc745 | ||
|
|
ef61d91acc | ||
|
|
a60fe76259 | ||
|
|
b938058b92 | ||
|
|
92d090a392 | ||
|
|
f8e5d162ec | ||
|
|
3b9d71aa00 | ||
|
|
c03800779a | ||
|
|
ef42e1212c | ||
|
|
a792cb5f4f | ||
|
|
3299bb013b | ||
|
|
5d20bd0804 | ||
|
|
14ab3bef6a | ||
|
|
ab75d2ecd6 | ||
|
|
7b784adb44 | ||
|
|
7dcc22828f | ||
|
|
af1afa57f3 | ||
|
|
ea8b212d45 | ||
|
|
1b3e8f52e1 | ||
|
|
199f090d7b | ||
|
|
59b5a09b32 | ||
|
|
050398bc84 | ||
|
|
8f021c0b49 | ||
|
|
fe7035c702 | ||
|
|
cccf2a6615 | ||
|
|
cf7aae8ce3 | ||
|
|
4125f05b28 | ||
|
|
998d6e742c | ||
|
|
47b2227453 | ||
|
|
685cb21779 | ||
|
|
7f2d675602 | ||
|
|
c6ad6b3c08 | ||
|
|
2d635db39b | ||
|
|
9601aab581 | ||
|
|
805dedd7e5 | ||
|
|
93b9e1a65e | ||
|
|
2200b2e437 | ||
|
|
c5a49ade60 | ||
|
|
57fe6862b0 | ||
|
|
ba2e9306a6 | ||
|
|
fa90389e82 | ||
|
|
7556e43b22 | ||
|
|
5168023091 | ||
|
|
f1ecc39cb7 | ||
|
|
530ce4e61e | ||
|
|
ac3574b98b | ||
|
|
2325f97684 | ||
|
|
ab93ff4ec0 | ||
|
|
0ba66c8f31 | ||
|
|
1a19e33877 | ||
|
|
502ffca6ec | ||
|
|
cdf70ea545 | ||
|
|
d5e67b9fe1 | ||
|
|
6230e52d98 | ||
|
|
a9d084e250 | ||
|
|
11df52dc3b | ||
|
|
8e38cafe87 | ||
|
|
4ad485984c | ||
|
|
236ad00a26 | ||
|
|
73ab1ea58a | ||
|
|
dc66ec40c4 | ||
|
|
d686b6b436 | ||
|
|
c9c5509f6b | ||
|
|
2152f97c9d | ||
|
|
12610e8a8a | ||
|
|
f2d71fb5a0 | ||
|
|
647ebf9255 | ||
|
|
10fc4f56f0 | ||
|
|
108fa9cc56 | ||
|
|
0274337ded | ||
|
|
34e2fdd284 | ||
|
|
c45b2cfdd5 | ||
|
|
972b9b941f | ||
|
|
4e87eae904 | ||
|
|
b93ea03786 | ||
|
|
3e99b2deeb | ||
|
|
0d811f6eb3 | ||
|
|
0535d3e305 | ||
|
|
82a838ff74 | ||
|
|
21d306898b | ||
|
|
1d9e37fd60 | ||
|
|
eda10dfa61 | ||
|
|
ace34f6ad8 | ||
|
|
20ec7ef25a | ||
|
|
511a15d993 | ||
|
|
07b678e448 | ||
|
|
68f5bce80b | ||
|
|
6709ce1589 | ||
|
|
55bbe55b4a | ||
|
|
0ab7982727 | ||
|
|
18445d7755 | ||
|
|
ebc2c6dec5 | ||
|
|
54c3407d49 | ||
|
|
aa29a287d1 | ||
|
|
0406d493a7 | ||
|
|
a9b22caadf | ||
|
|
2c46a72038 | ||
|
|
7782bdeec2 | ||
|
|
69ac0d25f2 | ||
|
|
31609e347a | ||
|
|
6fa7bcd871 | ||
|
|
3394483a45 | ||
|
|
7659ededaa | ||
|
|
a8829e76da | ||
|
|
7e9047eaf0 | ||
|
|
830a65b93f | ||
|
|
22549206c2 | ||
|
|
0baa3b4a33 | ||
|
|
0221379606 | ||
|
|
893002e6c0 | ||
|
|
8268044c2f | ||
|
|
74e4e5877a | ||
|
|
6d30ee352c | ||
|
|
17267c5894 | ||
|
|
a2a0a6f3b7 | ||
|
|
1e625ce3ef | ||
|
|
00d43a7812 | ||
|
|
e119e0ddda | ||
|
|
516ac1e358 | ||
|
|
f8ab20c8aa | ||
|
|
5411079553 | ||
|
|
6fd8a43e44 | ||
|
|
f5e2ae6273 | ||
|
|
be20b052ce | ||
|
|
b16a2ca6a8 | ||
|
|
06232b235a | ||
|
|
afd1be30b5 | ||
|
|
90a944070d | ||
|
|
b8148768b8 | ||
|
|
6684c67e61 | ||
|
|
06290fedf7 | ||
|
|
722b9404dc | ||
|
|
24eeaa787d | ||
|
|
e72583e15c | ||
|
|
16d65d01f3 | ||
|
|
c10da16d55 | ||
|
|
17db441b6e | ||
|
|
75f4e6d412 | ||
|
|
1702a392b3 | ||
|
|
30c1ed08c0 | ||
|
|
39e9ff32e5 | ||
|
|
851419a927 | ||
|
|
a6655003aa | ||
|
|
6696d4fcf5 | ||
|
|
346f944383 | ||
|
|
e36850b2c7 | ||
|
|
9f44caaa62 | ||
|
|
2503ed2124 | ||
|
|
0ab1cba06a | ||
|
|
594c6b5d80 | ||
|
|
34631d8a52 | ||
|
|
73f4a682cf | ||
|
|
1f6347aa23 | ||
|
|
d016c4b4bd | ||
|
|
83119d0720 | ||
|
|
1cff19127f | ||
|
|
e90a0c1900 | ||
|
|
05e8b0ecfd | ||
|
|
5e69297836 | ||
|
|
b34b628c90 | ||
|
|
0374a64a8b | ||
|
|
7f88e8c53a | ||
|
|
7e4243192e | ||
|
|
1968b6486b | ||
|
|
b8d42a41dd | ||
|
|
cf93a0193b | ||
|
|
8f161c1e68 | ||
|
|
a29876f47f | ||
|
|
6e9f4a03d1 | ||
|
|
d6077457dd | ||
|
|
987cfde7b6 | ||
|
|
077f8fedf5 | ||
|
|
ad55625769 | ||
|
|
e9f390526b | ||
|
|
96b3a085b6 | ||
|
|
10a175ed0b | ||
|
|
b1b69113a2 | ||
|
|
67ae37fb67 | ||
|
|
66f89e0728 | ||
|
|
a999c6e99c | ||
|
|
7a215db14f | ||
|
|
7bc37861a5 | ||
|
|
55ae84362a | ||
|
|
a533eb703e | ||
|
|
4977b94281 | ||
|
|
c1fb6c3694 | ||
|
|
f72754e1d5 | ||
|
|
c434cacd10 | ||
|
|
4b6b311823 | ||
|
|
3ee448016a | ||
|
|
874a397d3b | ||
|
|
3468d6e5e9 | ||
|
|
094b2da61d | ||
|
|
3beaf710a7 | ||
|
|
0bb304d43d | ||
|
|
9c1d761f55 | ||
|
|
44645ef1c6 | ||
|
|
f91c540bc3 | ||
|
|
48fd02c689 | ||
|
|
863f26716e | ||
|
|
4597896689 | ||
|
|
2f8b42e346 | ||
|
|
91e1be0f8a |
@@ -0,0 +1,28 @@
|
|||||||
|
## Request for a new Data observatory extension deploy
|
||||||
|
|
||||||
|
I'd like to request a new data observatory extension deploy: dump + extension
|
||||||
|
|
||||||
|
**VERY IMPORTANT!!!**
|
||||||
|
|
||||||
|
PLEASE USE `python scripts/generate_fixtures.py` TO GENERATE NEW FIXTURES FOR
|
||||||
|
THE NEW DUMP AND OVERRIDE IT IN THIS PROJECT BEFORE PASS THE TESTS
|
||||||
|
|
||||||
|
## Performance comparison to last deployment
|
||||||
|
|
||||||
|
Please include link here to comparison perftests:
|
||||||
|
|
||||||
|
http://52.71.151.140/perftest/#oldsha..newsha
|
||||||
|
|
||||||
|
## Dump database id to be deployed
|
||||||
|
|
||||||
|
Please put here the dump id to be deployed: <dump_id>
|
||||||
|
|
||||||
|
## Data Observatory extension PRs included.
|
||||||
|
|
||||||
|
*Please update the NEWS.md*
|
||||||
|
|
||||||
|
Add down here the PR links to be added and deployed:
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
// @CartoDB/datateam
|
||||||
@@ -2,3 +2,5 @@
|
|||||||
src/pg/observatory--current--dev.sql
|
src/pg/observatory--current--dev.sql
|
||||||
src/pg/observatory--dev--current.sql
|
src/pg/observatory--dev--current.sql
|
||||||
src/pg/observatory--dev.sql
|
src/pg/observatory--dev.sql
|
||||||
|
venv
|
||||||
|
*.pyc
|
||||||
|
|||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
language: c
|
||||||
|
sudo: required
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- PGUSER=postgres
|
||||||
|
- PGDATABASE=postgres
|
||||||
|
- PGOPTIONS='-c client_min_messages=NOTICE'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- env: POSTGRESQL_VERSION="9.6" POSTGIS_VERSION="2.5"
|
||||||
|
dist: xenial
|
||||||
|
- env: POSTGRESQL_VERSION="10" POSTGIS_VERSION="2.5"
|
||||||
|
dist: xenial
|
||||||
|
- env: POSTGRESQL_VERSION="11" POSTGIS_VERSION="2.5"
|
||||||
|
dist: xenial
|
||||||
|
- env: POSTGRESQL_VERSION="12" POSTGIS_VERSION="2.5"
|
||||||
|
dist: bionic
|
||||||
|
- env: POSTGRESQL_VERSION="12" POSTGIS_VERSION="3"
|
||||||
|
dist: bionic
|
||||||
|
|
||||||
|
script:
|
||||||
|
- sudo apt-get install -y --allow-unauthenticated --no-install-recommends --no-install-suggests postgresql-$POSTGRESQL_VERSION postgresql-client-$POSTGRESQL_VERSION postgresql-server-dev-$POSTGRESQL_VERSION postgresql-common
|
||||||
|
- if [[ $POSTGRESQL_VERSION == '9.6' ]]; then sudo apt-get install -y postgresql-contrib-9.6; fi;
|
||||||
|
- sudo apt-get install -y --allow-unauthenticated postgresql-$POSTGRESQL_VERSION-postgis-$POSTGIS_VERSION postgresql-$POSTGRESQL_VERSION-postgis-$POSTGIS_VERSION-scripts postgis
|
||||||
|
# For pre12, install plpython2. For PG12 install plpython3
|
||||||
|
- if [[ $POSTGRESQL_VERSION != '12' ]]; then sudo apt-get install -y postgresql-plpython-$POSTGRESQL_VERSION python python-redis; else sudo apt-get install -y postgresql-plpython3-12 python3 python3-redis; fi;
|
||||||
|
- sudo pg_dropcluster --stop $POSTGRESQL_VERSION main
|
||||||
|
- sudo rm -rf /etc/postgresql/$POSTGRESQL_VERSION /var/lib/postgresql/$POSTGRESQL_VERSION /var/ramfs/postgresql/$POSTGRESQL_VERSION
|
||||||
|
- sudo pg_createcluster -u postgres $POSTGRESQL_VERSION main --start -- --auth-local trust --auth-host password
|
||||||
|
- export PGPORT=$(pg_lsclusters | grep $POSTGRESQL_VERSION | awk '{print $3}')
|
||||||
|
- cd src/pg/
|
||||||
|
- make
|
||||||
|
- sudo make install
|
||||||
|
- make installcheck
|
||||||
|
|
||||||
|
after_failure:
|
||||||
|
- pg_lsclusters
|
||||||
|
- cat test/regression.out
|
||||||
|
- cat test/regression.diffs
|
||||||
|
- echo $PGPORT
|
||||||
|
- sudo cat /var/log/postgresql/postgresql-$POSTGRESQL_VERSION-main.log
|
||||||
+2
-2
@@ -28,8 +28,8 @@ Run the tests with `make test`.
|
|||||||
|
|
||||||
Update extension in a working database with:
|
Update extension in a working database with:
|
||||||
```
|
```
|
||||||
ALTER EXTENSION observatory VERSION TO 'current';
|
ALTER EXTENSION observatory UPDATE TO 'current';
|
||||||
ALTER EXTENSION observatory VERSION TO 'dev';
|
ALTER EXTENSION observatory UPDATE TO 'dev';
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: we keep the current development version install as 'dev' always;
|
Note: we keep the current development version install as 'dev' always;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ test: ## Run the tests for the development version of the extension
|
|||||||
$(MAKE) -C $(EXT_DIR) test
|
$(MAKE) -C $(EXT_DIR) test
|
||||||
|
|
||||||
# Generate a new release into release
|
# Generate a new release into release
|
||||||
release: ## Generate a new release of the extension. Only for telease manager
|
release: ## Generate a new release of the extension. Only for release manager
|
||||||
$(MAKE) -C $(EXT_DIR) release
|
$(MAKE) -C $(EXT_DIR) release
|
||||||
|
|
||||||
# Install the current release.
|
# Install the current release.
|
||||||
|
|||||||
@@ -1,3 +1,473 @@
|
|||||||
0.0.1 (open date)
|
1.10.0 (2018-07-??)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Updated for PostgreSQL 12 and PostGIS 3.0 compatibility.
|
||||||
|
|
||||||
|
1.9.0 (2018-04-20)
|
||||||
------------------
|
------------------
|
||||||
* First iteration of `OBS_GetDemographicSnapshot(location Geometry(Point,4326))`;
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Improved `OBS_GetAvailableGeometries` for the DO Timespans project ([#325](https://github.com/CartoDB/observatory-extension/pull/325))
|
||||||
|
* Improved `OBS_GetAvailableTimespans` for the DO Timespans project ([#324](https://github.com/CartoDB/bigmetadata/issues/324))
|
||||||
|
* Modified the denominated suggested_name to mitigate collisions ([#327](https://github.com/CartoDB/observatory-extension/pull/327))
|
||||||
|
* Fixed some errors so now the extension supports PostgreSQL 10 ([#329](https://github.com/CartoDB/observatory-extension/pull/329))
|
||||||
|
* Fixed documentation
|
||||||
|
* Add support for multiple PostgreSQL and Postgis versions in our travis script for test purposes
|
||||||
|
|
||||||
|
1.8.0 (2017-10-18)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Add `number_geometries` field to `OBS_GetAvailableGeometries` in order to provide the number of geometries from the source data to be used in the score calculation ([#313](https://github.com/CartoDB/observatory-extension/issues/313))
|
||||||
|
|
||||||
|
1.7.0 (2017-08-18)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Add Travis support to execute the extension tests ([#183](https://github.com/CartoDB/observatory-extension/issues/183))
|
||||||
|
|
||||||
|
__API Changes__
|
||||||
|
|
||||||
|
* Add new function `OBS_MetadataValidation` ([#303](https://github.com/CartoDB/observatory-extension/pull/303))
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Fixed parentheses for obs_getdata with ids
|
||||||
|
* Fixed failing tests due changes in the data dump for some TIGER geometries
|
||||||
|
|
||||||
|
1.6.0 (2017-07-20)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* The current OBS_GetAvailableNumerators is not designed with our
|
||||||
|
UI in mind so it's causing a lot of troubles and we're doing so
|
||||||
|
many hacks to fit our UI needs and the interface of the function so this
|
||||||
|
function it's a better fit for our purposes. ([#300](https://github.com/CartoDB/observatory-extension/pull/300))
|
||||||
|
* Now use the new meta table `obs_meta_geom_numer_timespan` to filter
|
||||||
|
the geometries by geometries timespan and/or numerator timespan (which
|
||||||
|
is what we get when we use the obs_getavailabletimespans) ([#302](https://github.com/CartoDB/observatory-extension/pull/302))
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Right now we're doing INNER JOINS when we JOIN the `_procgeoms` and
|
||||||
|
the data so we end up with NULL value instead of id, NULL value. ([#298](https://github.com/CartoDB/observatory-extension/pull/298))
|
||||||
|
|
||||||
|
|
||||||
|
1.5.1 (2017-05-16)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Much improved performance for `OBS_GetData` when augmenting with several
|
||||||
|
different geometries simultaneously ([#285](https://github.com/CartoDB/observatory-extension/pull/285))
|
||||||
|
* Return the automatically assigned normalization type from `OBS_GetMeta`
|
||||||
|
([#285](https://github.com/CartoDB/observatory-extension/pull/285))
|
||||||
|
|
||||||
|
1.5.0 (2017-04-24)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__API Changes__
|
||||||
|
|
||||||
|
* Add `suggested_name` to `OBS_GetMeta` responses
|
||||||
|
([#281](https://github.com/CartoDB/observatory-extension/pull/281))
|
||||||
|
* Add `geom_type`, `geom_extra`, and `geom_tags` to
|
||||||
|
`OBS_GetAvailableGeometries`. This brings it up to spec with existing docs.
|
||||||
|
([#282](https://github.com/CartoDB/observatory-extension/pull/282))
|
||||||
|
* Add `timespan_type`, `timespan_extra`, and `timespan_tags` to
|
||||||
|
`OBS_GetAvailableTimespans` for consistency.
|
||||||
|
([#282](https://github.com/CartoDB/observatory-extension/pull/282))
|
||||||
|
|
||||||
|
1.4.0 (2017-03-21)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__API Changes__
|
||||||
|
|
||||||
|
* Allow for override of `target_area` and `target_geoms` in `OBS_GetMeta`
|
||||||
|
([#276](https://github.com/CartoDB/observatory-extension/pull/276)). This
|
||||||
|
allows the interface to work with points and sparse areas much btter.
|
||||||
|
* Allow for override of `max_timespan_rank` and `max_score_rank` on an
|
||||||
|
item-by-item basis for metadata.
|
||||||
|
* `numer_description`, `geom_description`, `denom_description`,
|
||||||
|
`numer_t_description`, `denom_t_description` and `geom_t_description` now
|
||||||
|
returned as part of `OBS_GetMeta`.
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Reduced amount of simplification done on input geometries (from 0.0001 above
|
||||||
|
500 points to 0.00001 above 1000 points).
|
||||||
|
* Added tests to confirm that accurate results are returned from automatic
|
||||||
|
boundary selection
|
||||||
|
|
||||||
|
1.3.5 (2017-03-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
No changes. Artifact to allow for data update.
|
||||||
|
|
||||||
|
1.3.4 (2017-03-10)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Remove erroneously committed `RAISE NOTICE` in `OBS_GetData`
|
||||||
|
|
||||||
|
1.3.3 (2017-03-10)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Resolve divide-by-zero errors in cases where the intersection of an
|
||||||
|
Observatory geometry and user geometry has 0 area
|
||||||
|
([#265](https://github.com/CartoDB/observatory-extension/pull/265))
|
||||||
|
* Run MakeValid on geometry's when intersecting, if necessary
|
||||||
|
([#268](https://github.com/CartoDB/observatory-extension/pull/268))
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Add performance tests for multiple columns in `OBS_GetData`
|
||||||
|
* Major performance boost for `autotest.py` through the use of multi-column
|
||||||
|
`OBS_GetData` instead of separate `OBS_GetMeasure` calls for every single
|
||||||
|
measurement.
|
||||||
|
([#268](https://github.com/CartoDB/observatory-extension/pull/268))
|
||||||
|
* Major performance boost for `OBS_GetData` in cases where multiple columns are
|
||||||
|
requested. Previously, each additional column would result in a linear
|
||||||
|
slowdown, even if geometries could be reused.
|
||||||
|
([#267](https://github.com/CartoDB/observatory-extension/pull/267))
|
||||||
|
|
||||||
|
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__
|
||||||
|
|
||||||
|
* It is now possible to obtain measures that are averages or medians over
|
||||||
|
arbitrary polygons ([#254](https://github.com/CartoDB/observatory-extension/pull/254).
|
||||||
|
* Added test point for Australian data
|
||||||
|
* `OBS_GetLegacyMetadata` now returns median and averages in cases where it is
|
||||||
|
called for measures for polygons
|
||||||
|
|
||||||
|
1.3.0 (2017-01-17)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__API Changes__
|
||||||
|
|
||||||
|
* `OBS_GetMeasureDataMulti()` is now called `OBS_GetData()`
|
||||||
|
* `OBS_GetMeasureMetaMulti()` is now called `OBS_GetMeta()`
|
||||||
|
* Additional signature for `OBS_GetData` which can take an array of `TEXT`,
|
||||||
|
mimicking functionality of `OBS_GetMeasureByID`
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Generate fixtures from `obs_meta`
|
||||||
|
* Remove unused table-level code
|
||||||
|
* Refactor all augmentation and geometry functions to obtain data from
|
||||||
|
`OBS_GetMeta()` and `OBS_GetData()`.
|
||||||
|
* Improvements to `OBS_GetMeta()` so it can still fill in metadata in cases
|
||||||
|
where only a geometry is being requested.
|
||||||
|
* `OBS_GetData()` returns two-column table instead of anonymous record.
|
||||||
|
* `OBS_GetData()` can return categorical (text) and geometries
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Remove unnecessary dependency on `postgres_fdw`
|
||||||
|
* `OBS_GetData()` now aggregates measures with mixed geoms correctly
|
||||||
|
|
||||||
|
1.2.1 (2017-01-17)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Support Point/LineString in responses from `OBS_GetBoundary`.
|
||||||
|
([#243](https://github.com/CartoDB/observatory-extension/pull/233))
|
||||||
|
|
||||||
|
1.2.0 (2016-12-28)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__API Changes__
|
||||||
|
|
||||||
|
* Added `OBS_GetMeasureDataMulti`, which takes an array of geomvals and
|
||||||
|
parameters as JSON, and returns a set of RECORDs keyed by the vals of the
|
||||||
|
geomvals.
|
||||||
|
* Added `OBS_GetMeasureMetaMulti`, which takes sparse metadata as JSON (for
|
||||||
|
example, the measure ID) and returns a filled-out version of the metadata
|
||||||
|
sufficient for use with `OBS_GetMeasureDataMulti`.
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Move tests to 2015
|
||||||
|
* Fixes to `_OBS_GetGeometryScores` to avoid spamming NOTICEs about all pixels
|
||||||
|
for a band being NULL
|
||||||
|
* Tests for `_OBS_GetGeometryScores` with complex geometries
|
||||||
|
* Performance tests for `OBS_GetMeasureDataMulti`
|
||||||
|
* Return both `table_id` and `column_id` from `_OBS_GetGeometryScores`
|
||||||
|
|
||||||
|
1.1.7 (2016-12-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Use simpler raster table and simplified `_OBSGetGeometryScores` functions to
|
||||||
|
improve performance
|
||||||
|
* In cases where geometry passed into geometry scoring function has greater
|
||||||
|
than 10K points, simply use its buffer instead
|
||||||
|
* Add `IMMUTABLE` to `_OBSGetGeometryScores`
|
||||||
|
* Add tests explicitly for `_OBSGetGeometryScores` in perftest.py
|
||||||
|
* Yields a ~50% improvement in performance for `_OBSGetGeomeryScores`.
|
||||||
|
|
||||||
|
1.1.6 (2016-12-08)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Fix divide by zero condition in "denominator" branch of `OBS_GetMeasure`
|
||||||
|
when passing in a polygon ([#233](https://github.com/CartoDB/observatory-extension/pull/233)).
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Use `ST_Subdivide` to improve performance when functions are called on very
|
||||||
|
complex geometries (with many points) ([#232](https://github.com/CartoDB/observatory-extension/pull/232))
|
||||||
|
* Improve raster scoring to more heavily weight boundaries with nearer to
|
||||||
|
correct number of points, and penalize boundaries with lots of blank space
|
||||||
|
([#232](https://github.com/CartoDB/observatory-extension/pull/232))
|
||||||
|
* Remove some redundant area calculations in `OBS_GetMeasure`
|
||||||
|
([#232](https://github.com/CartoDB/observatory-extension/pull/232))
|
||||||
|
* Replace use of `format('%L', var)` with proper use of `EXECUTE` and `$1` etc.
|
||||||
|
variables ([#231](https://github.com/CartoDB/observatory-extension/pull/231))
|
||||||
|
* Add test point for Brazil
|
||||||
|
([#229](https://github.com/CartoDB/observatory-extension/pull/229))
|
||||||
|
* Improvements to performance tests
|
||||||
|
([#229](https://github.com/CartoDB/observatory-extension/pull/229))
|
||||||
|
- Support simple and complex geometries
|
||||||
|
- Handle all code branches
|
||||||
|
- Add ability to persist results to JSON for graph visualization later
|
||||||
|
|
||||||
|
1.1.5 (2016-11-29)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Return `NULL` instead of raising an exception when a measure is requested for
|
||||||
|
a geometry where it does not exist ([#220](https://github.com/CartoDB/observatory-extension/issues/220)).
|
||||||
|
|
||||||
|
1.1.4 (2016-11-21)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Fix duplicate subsections with only a partial set of measures appearing from
|
||||||
|
`OBS_GetLegacyMetadata` ([#216](https://github.com/CartoDB/observatory-extension/issues/216)).
|
||||||
|
|
||||||
|
1.1.3 (2016-11-15)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
* Temporarily ignore EU data for the sake of testing
|
||||||
|
|
||||||
|
1.1.2 (2016-11-09)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Update public `OBS_GetMeasure` to use highest ranked boundary, aiming for 500
|
||||||
|
geoms. ([#190](https://github.com/CartoDB/observatory-extension/issues/190))
|
||||||
|
* Update test generation to capture our raster tiles
|
||||||
|
* Standardize the way we generate our test points for `autotest.py`
|
||||||
|
* Add points for epa and eurostat
|
||||||
|
* Should support database dump generated 20161109
|
||||||
|
|
||||||
|
__API Changes (Internal)__
|
||||||
|
|
||||||
|
* Add internal `_OBS_GetGeometryScores`
|
||||||
|
|
||||||
|
1.1.1 (2016-10-14)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Test points for Canada and France ([#204](https://github.com/CartoDB/observatory-extension/issues/120))
|
||||||
|
|
||||||
|
1.1.0 (2016-10-04)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Fixed some minor errors in test suite
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* We now generate test fixtures from local data instead of remote server
|
||||||
|
([#120](https://github.com/CartoDB/observatory-extension/issues/120))
|
||||||
|
|
||||||
|
__API Changes__
|
||||||
|
|
||||||
|
* New function, `OBS_LegacyBuilderMetadata`, which resolves
|
||||||
|
([#133]( https://github.com/CartoDB/observatory-extension/issues/133))
|
||||||
|
* Creates "dimensional" metadata grabbing functions
|
||||||
|
(`OBS_GetAvailableNumerators`, `OBS_GetAvailableDenominators`,
|
||||||
|
`OBS_GetAvailableGeometries`, `OBS_GetAvailableTimespans`) which will be
|
||||||
|
used for obtaining metadata in the replacement for the Data Library
|
||||||
|
([CartoDB/design#104](https://github.com/CartoDB/design/issues/104)). This
|
||||||
|
is also referred to here ([CartoDB/design#68](https://github.com/CartoDB/design/issues/68)).
|
||||||
|
|
||||||
|
1.0.7 (2016-09-20)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* `NULL` geometries or geometry IDs no longer result in an exception from any
|
||||||
|
augmentation functions ([#178](https://github.com/CartoDB/observatory-extension/issues/178))
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Automatic tests work for Canada and Thailand
|
||||||
|
|
||||||
|
1.0.6 (2016-09-08)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* New function structure for Table-level functions which allows to separate the
|
||||||
|
framework logic from the observatory measure functions.
|
||||||
|
|
||||||
|
1.0.5 (2016-08-12)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Integration tests moved to `src/python/test/`, and can be run without hitting
|
||||||
|
any HTTP SQL API.
|
||||||
|
|
||||||
|
1.0.4 (2016-07-26)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Always default arguments to `NULL`, which prevents duplication & overwrite by
|
||||||
|
dataservices-api
|
||||||
|
([#173](https://github.com/CartoDB/observatory-extension/issues/173))
|
||||||
|
|
||||||
|
1.0.3 (2016-07-25)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Raise exception instead of crashing when `OBS_GetMeasure` is passed a polygon
|
||||||
|
in combination with a non-summable measure ([cartodb/issues
|
||||||
|
#9063](https://github.com/CartoDB/cartodb/issues/9063))
|
||||||
|
* Unnecessary dependencies on cartodb and plpythonu removed
|
||||||
|
([#161](https://github.com/CartoDB/observatory-extension/issues/161))
|
||||||
|
* Tests forced to run in-order on all systems
|
||||||
|
([#162](https://github.com/CartoDB/observatory-extension/issues/162))
|
||||||
|
* Area normalization done by square kilometer instead of square meter for
|
||||||
|
polygons ([#158](https://github.com/CartoDB/observatory-extension/issues/158))
|
||||||
|
* `postgres-fdw` installed as required in unit test environment
|
||||||
|
([#166](https://github.com/CartoDB/observatory-extension/issues/166))
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Added tests to make sure all functions can handle explicit NULL as default
|
||||||
|
([#159](https://github.com/CartoDB/observatory-extension/issues/159))
|
||||||
|
* Buffer and snaptogrid used to be far more liberal accepting problem geoms
|
||||||
|
([#170](https://github.com/CartoDB/observatory-extension/issues/160))
|
||||||
|
|
||||||
|
|
||||||
|
1.0.2 (2016-07-12)
|
||||||
|
---
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Fix for `OBS_GetCategory` outside the US ([#135](https://github.com/CartoDB/observatory-extension/pull/137))
|
||||||
|
* `OBS_GetMeasure` now respects the `normalize` parameter even when passed
|
||||||
|
a multi/polygon. Previously, no normalization was erroneously assumed.
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Automated tests cover Mexico data
|
||||||
|
* `obs_meta` is now provisioned during unit tests
|
||||||
|
* `obs_meta` is now used during end-to-end tests
|
||||||
|
* `OBS_GetMeasureByID` uses `obs_meta` internally, which should help
|
||||||
|
performance
|
||||||
|
* `OBS_GetCategory` uses `obs_meta` internally, which should help perfromance
|
||||||
|
* `OBS_GetCategory` will pick the correct category for an arbitrary polygon
|
||||||
|
(the category covering the highest % of that polygon)
|
||||||
|
* `OBS_GetMeasure` has been updated to use `obs_meta` internally, which should
|
||||||
|
help performance
|
||||||
|
* `OBS_GetMeasure` now can be passed "none" and skip normalization by area or
|
||||||
|
denominator for points
|
||||||
|
* Fixtures are only loaded at the start of the unit test suite, and dropped at the end,
|
||||||
|
instead of at the start/end of each individual test file
|
||||||
|
* Comment noisy NOTICEs ([#73](https://github.com/CartoDB/observatory-extension/issues/73))
|
||||||
|
|
||||||
|
1.0.1 (2016-07-01)
|
||||||
|
---
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Fix for ERROR: Operation on mixed SRID geometries #130
|
||||||
|
|
||||||
|
|
||||||
|
1.0.0 (6/27/2016)
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Incremented to 1.0.0 to be in compliance with [SemVer](http://semver.org/),
|
||||||
|
which disallows use of 0.x.x versions. This also reflects that we are
|
||||||
|
already in production.
|
||||||
|
|
||||||
|
__API Changes__
|
||||||
|
|
||||||
|
* Added `OBS_DumpVersion` to look up version data ([#118](https://github.com/CartoDB/observatory-extension/pull/118))
|
||||||
|
|
||||||
|
__Improvements__
|
||||||
|
|
||||||
|
* Whether data exists for a geom now determined by polygon intersection instead of
|
||||||
|
BBOX overlap ([#119](https://github.com/CartoDB/observatory-extension/pull/119))
|
||||||
|
* Automated tests cover Spanish and UK data
|
||||||
|
([#115](https://github.com/CartoDB/observatory-extension/pull/115))
|
||||||
|
* Automated tests cover `OBS_GetUSCensusMeasure`
|
||||||
|
([#105](https://github.com/CartoDB/observatory-extension/pull/105))
|
||||||
|
|
||||||
|
__Bugfixes__
|
||||||
|
|
||||||
|
* Geom table can have different `geomref_colname` than the data table
|
||||||
|
([#123](https://github.com/CartoDB/observatory-extension/pull/123))
|
||||||
|
|
||||||
|
|
||||||
|
0.0.5 (5/27/2016)
|
||||||
|
-----
|
||||||
|
* Adds new function `OBS_GetMeasureById` ([#96](https://github.com/CartoDB/observatory-extension/pull/96))
|
||||||
|
|
||||||
|
0.0.4 (5/25/2016)
|
||||||
|
-----
|
||||||
|
* Updates queries involving US Census measure tags to be more generic ([#95](https://github.com/CartoDB/observatory-extension/pull/95))
|
||||||
|
* Fixes tests which relied on an erroneous subset of block groups ([#95](https://github.com/CartoDB/observatory-extension/pull/95))
|
||||||
|
|
||||||
|
0.0.3 (5/24/2016)
|
||||||
|
-----
|
||||||
|
* Generalizes internal queries to properly pull from multiple named geometry references
|
||||||
|
* Adds tests for Who's on First boundaries
|
||||||
|
* Improves automatic fixtures testing script
|
||||||
|
|
||||||
|
0.0.2 (5/19/2016)
|
||||||
|
-----
|
||||||
|
* Adds Data Observatory exploration functions
|
||||||
|
* Adds Data Observatory boundary functions
|
||||||
|
* Adds Data Observatory measure functions
|
||||||
|
* Adds script to generate fixtures for tests
|
||||||
|
* Adds script for the automatic testing of metadata
|
||||||
|
* Adds full documentation for all included functions
|
||||||
|
* removes `cartodb` extension dependency
|
||||||
|
|
||||||
|
0.0.1 (5/19/2016)
|
||||||
|
------------------
|
||||||
|
* First iteration of `OBS_GetDemographicSnapshot(location Geometry(Point,4326))`
|
||||||
|
|||||||
@@ -1,64 +1,5 @@
|
|||||||
# Observatory extension
|
# Observatory extension
|
||||||
|
|
||||||
CartoDB extension that implements the row-level functions needed by the Observatory Service.
|
## :warning: Deprecated :warning:
|
||||||
|
|
||||||
## Code organization
|
This repository has been deprecated! No further maintenance or development will be done.
|
||||||
|
|
||||||
```
|
|
||||||
.
|
|
||||||
├── doc # documentation
|
|
||||||
├── release # released versions
|
|
||||||
└── src # source code
|
|
||||||
└── pg
|
|
||||||
├── sql
|
|
||||||
└── test
|
|
||||||
├── expected
|
|
||||||
├── fixtures
|
|
||||||
└── sql
|
|
||||||
```
|
|
||||||
|
|
||||||
# Development workflow
|
|
||||||
|
|
||||||
We distinguish two roles regarding the development cycle:
|
|
||||||
|
|
||||||
* *developers* will implement new functionality and bugfixes into
|
|
||||||
the codebase and will request for new releases of the extension.
|
|
||||||
* A *release manager* will attend these requests and will handle
|
|
||||||
the release process. The release process is sequential:
|
|
||||||
no concurrent releases will ever be in the works.
|
|
||||||
|
|
||||||
We use the default `develop` branch as the basis for development.
|
|
||||||
The `master` branch is used to merge and tag releases to be
|
|
||||||
deployed in production.
|
|
||||||
|
|
||||||
Developers shall create a new topic branch from `develop` for any new feature
|
|
||||||
or bugfix and commit their changes to it and eventually merge back into
|
|
||||||
the `develop` branch. When a new release is required a Pull Request
|
|
||||||
will be open against the `develop` branch.
|
|
||||||
|
|
||||||
The `develop` pull requests will be handled by the release manage,
|
|
||||||
who will merge into master where new releases are prepared and tagged.
|
|
||||||
The `master` branch is the sole responsibility of the release masters
|
|
||||||
and developers must not commit or merge into it.
|
|
||||||
|
|
||||||
## Development Guidelines
|
|
||||||
|
|
||||||
For a detailed description of the development process please see
|
|
||||||
the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
|
|
||||||
|
|
||||||
Any modification to the source code
|
|
||||||
shall always be done in a topic branch created from the `develop` branch.
|
|
||||||
|
|
||||||
Tests, documentation and peer code reviews are required for all
|
|
||||||
modifications.
|
|
||||||
|
|
||||||
The tests are executed by running this from the top directory:
|
|
||||||
```
|
|
||||||
sudo make install
|
|
||||||
make test
|
|
||||||
```
|
|
||||||
## Release
|
|
||||||
|
|
||||||
The release and deployment process is described in the
|
|
||||||
[RELEASE.md](RELEASE.md) guide and it is the responsibility of the designated
|
|
||||||
release manager.
|
|
||||||
|
|||||||
@@ -20,12 +20,6 @@ script for the new release, `release/observatory--X.Y.Z.sql`:
|
|||||||
make release
|
make release
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, the release manager shall produce upgrade and downgrade scripts
|
|
||||||
to migrate to/from the previous release. In the case of minor/patch
|
|
||||||
releases this simply consist in extracting the functions that have changed
|
|
||||||
and placing them in the proper `release/observatory--X.Y.Z--A.B.C.sql`
|
|
||||||
file.
|
|
||||||
|
|
||||||
The new release can be deployed for staging/smoke tests with this command:
|
The new release can be deployed for staging/smoke tests with this command:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "observatory-server-extension",
|
||||||
|
"current_version": {
|
||||||
|
"requires": {
|
||||||
|
"postgresql": "^10.0.0",
|
||||||
|
"postgis": "^2.4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-106
@@ -1,110 +1,13 @@
|
|||||||
# Data Observatory Access
|
# Data Observatory Documentation
|
||||||
|
|
||||||
This file is for reference purposes only. It is intended for tracking the Data Observatory API functions that should be displayed from the Docs site. Like all API doc, the golden source of the code will live in this repo. I will pull the list of files below into the docs for the output.
|
This file is for reference purposes only. It is intended for tracking the Data Observatory functions that should be pulled into the live Docs site. Like all API doc, the golden source of this code will live in this observatory-extension repo, and will be edited in this repo. Other non-code related content will live as a local file in the Docs repo.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
## OBS_GetDemographicSnapshot
|
* Overview (local file in the Docs repo)
|
||||||
|
* Accessing the Data Observatory (local file in the Docs repo)
|
||||||
The Demographic Snapshot API call enables you to collect demographic details around a point location. For example, you can take the coordinates of a bus stop and find the average population characteristics in that location. If you need help creating coordinates from addresses, [see our geocoding documentation].
|
* [Measures Functions](measures_functions.md)
|
||||||
|
* [Boundary Functions](boundary_functions.md)
|
||||||
Fields returned include information about income, education, transportation, race, and more. Not all fields will have information for every coordinate queried.
|
* [Discovery Functions](discovery_functions.md)
|
||||||
|
* [Glossary](local file in the Docs repo)
|
||||||
|
* [License](local file in the Docs repo)
|
||||||
### API Syntax
|
|
||||||
|
|
||||||
```html
|
|
||||||
https://{{account name}}.cartodb.com/api/v2/sql?q=SELECT * FROM
|
|
||||||
OBS_GetDemographicSnapshot({{point geometry}})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Parameter | Description | Example |
|
|
||||||
|---|:-:|:-:|
|
|
||||||
| account name | The name of your CartoDB account where the Data Observatory has been enabled | example_account |
|
|
||||||
| point geometry | A WKB point geometry. You can use the helper function, CDB_LatLng to quickly generate one from latitude and longitude | CDB_LatLng(40.760410,-73.964242) |
|
|
||||||
|
|
||||||
#### Geographic Scope
|
|
||||||
|
|
||||||
The Demographic Snapshot API is available for the following countries:
|
|
||||||
|
|
||||||
* United States
|
|
||||||
|
|
||||||
### API Examples
|
|
||||||
|
|
||||||
__Get the Demographic Snapshot at Camp David__
|
|
||||||
|
|
||||||
```text
|
|
||||||
https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM
|
|
||||||
OBS_GetDemographicSnapshot(CDB_LatLng(39.648333, -77.465))
|
|
||||||
```
|
|
||||||
__Get the Demographic Snapshot in the Upper West Side__
|
|
||||||
|
|
||||||
```text
|
|
||||||
https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM
|
|
||||||
OBS_GetDemographicSnapshot(CDB_LatLng(40.80, -73.960))
|
|
||||||
```
|
|
||||||
|
|
||||||
### API Response
|
|
||||||
|
|
||||||
[Click to expand](https://gist.github.com/ohasselblad/c9e59a6e8da35728d0d81dfed131ed17)
|
|
||||||
|
|
||||||
### Available fields
|
|
||||||
|
|
||||||
The Demographic Snapshot contains a broad subset of demographic measures in the Data Observatory. Over 80 measurements are returned by a single API request.
|
|
||||||
|
|
||||||
__todo: turn this spreadsheet into a markdown table__
|
|
||||||
|
|
||||||
https://docs.google.com/spreadsheets/d/1U3Uajw_PsIy3_YgeujnJ7AiL2VREdT-ozdaulx07q2g/edit#gid=430723120
|
|
||||||
|
|
||||||
## OBS_GetSegmentationSnapshot
|
|
||||||
|
|
||||||
The Segmentation Snapshot API call enables you to determine the pre-calculated population segment for a location. For example, you can take the location of a store location and determine what classification of population exists around that location. If you need help creating coordinates from addresses, [see our geocoding documentation].
|
|
||||||
|
|
||||||
### API Syntax
|
|
||||||
|
|
||||||
```html
|
|
||||||
https://{{account name}}.cartodb.com/api/v2/sql?q=SELECT * FROM
|
|
||||||
OBS_GetSegmentationSnapshot({{point geometry}})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Parameters
|
|
||||||
|
|
||||||
| Parameter | Description | Example |
|
|
||||||
|---|:-:|:-:|
|
|
||||||
| account name | The name of your CartoDB account where the Data Observatory has been enabled | example_account |
|
|
||||||
| point geometry | A WKB point geometry. You can use the helper function, CDB_LatLng to quickly generate one from latitude and longitude | CDB_LatLng(40.760410,-73.964242) |
|
|
||||||
|
|
||||||
#### Geographic Scope
|
|
||||||
|
|
||||||
The Segmentation Snapshot API is available for the following countries:
|
|
||||||
|
|
||||||
* United States
|
|
||||||
|
|
||||||
### API Examples
|
|
||||||
|
|
||||||
__Get the Segmentation Snapshot around the MGM Grand__
|
|
||||||
|
|
||||||
```text
|
|
||||||
https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM
|
|
||||||
OBS_GetSegmentationSnapshot(CDB_LatLng(36.10222, -115.169516))
|
|
||||||
```
|
|
||||||
__Get the Segmentation Snapshot at CartoDB's NYC HQ__
|
|
||||||
|
|
||||||
```text
|
|
||||||
https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM
|
|
||||||
OBS_GetSegmentationSnapshot(CDB_LatLng(40.704512, -73.936669))
|
|
||||||
```
|
|
||||||
|
|
||||||
### API Response
|
|
||||||
|
|
||||||
__todo__
|
|
||||||
|
|
||||||
### Available segments
|
|
||||||
|
|
||||||
__todo__
|
|
||||||
|
|
||||||
### Methodology
|
|
||||||
|
|
||||||
Segmentation is a method that divides a target market into subgroups based on shared common traits. While we plan to make many different segmentation methods available, our first release includes a segmentation profile first defined in a paper, _Understanding America's Neighborhoods Using Uncertain Data from the American Community Survey: Output Data: US_tract_clusters_new_. [See here](http://www.tandfonline.com/doi/pdf/10.1080/00045608.2015.1052335) for further information on the work in that paper.
|
|
||||||
|
|||||||
@@ -0,0 +1,273 @@
|
|||||||
|
# Boundary Functions
|
||||||
|
|
||||||
|
Use the following functions to retrieve [Boundary](https://carto.com/docs/carto-engine/data/overview/#boundary-data) data. Data ranges from small areas (e.g. US Census Block Groups) to large areas (e.g. Countries). You can access boundaries by point location lookup, bounding box lookup, direct ID access and several other methods described below.
|
||||||
|
|
||||||
|
You can [access](https://carto.com/docs/carto-engine/data/accessing) boundaries through CARTO Builder. The same methods will work if you are using the CARTO Engine to develop your application. We [encourage you](https://carto.com/docs/carto-engine/data/accessing/#best-practices) to use table modifying methods (UPDATE and INSERT) over dynamic methods (SELECT).
|
||||||
|
|
||||||
|
## OBS_GetBoundariesByGeometry(geom geometry, geometry_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundariesByGeometry(geometry, geometry_id)``` method returns a set of boundary geometries that intersect a supplied geometry. This can be used to find all boundaries that are within or overlap a bounding box. You have the ability to choose whether to retrieve all boundaries that intersect your supplied bounding box or only those that fall entirely inside of your bounding box.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
geom | a WGS84 geometry
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from ('NULL' (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a boundary geometry (e.g., US Census tract boundaries)
|
||||||
|
geom_refs | a string identifier for the geometry (e.g., geoids of US Census tracts)
|
||||||
|
|
||||||
|
If geometries are not found for the requested `geom`, `geometry_id`, `timespan`, or `overlap_type`, then null values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert all Census Tracts from Lower Manhattan and nearby areas within the supplied bounding box to a table named `manhattan_census_tracts` which has columns `the_geom` (geometry) and `geom_refs` (text).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO manhattan_census_tracts(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetBoundariesByGeometry(
|
||||||
|
ST_MakeEnvelope(-74.0251922607,40.6945658517,
|
||||||
|
-73.9651107788,40.7377626342,
|
||||||
|
4326),
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If an `overlap_type` other than the valid ones listed above is entered, then an error is thrown
|
||||||
|
|
||||||
|
## OBS_GetPointsByGeometry(polygon geometry, geometry_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetPointsByGeometry(polygon, geometry_id)``` method returns point geometries and their geographical identifiers that intersect (or are contained by) a bounding box polygon and lie on the surface of a boundary corresponding to the boundary with same geographical identifiers (e.g., a point that is on a census tract with the same geoid). This is a useful alternative to ```OBS_GetBoundariesByGeometry``` listed above because it returns much less data for each location.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
polygon | a bounding box or other geometry
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a point geometry on a boundary (e.g., a point that lies on a US Census tract)
|
||||||
|
geom_refs| a string identifier for the geometry (e.g., the geoid of a US Census tract)
|
||||||
|
|
||||||
|
If geometries are not found for the requested geometry, `geometry_id`, `timespan`, or `overlap_type`, then NULL values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert points that lie on Census Tracts from Lower Manhattan and nearby areas within the supplied bounding box to a table named `manhattan_tract_points` which has columns `the_geom` (geometry) and `geom_refs` (text).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO manhattan_tract_points (the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetPointsByGeometry(
|
||||||
|
ST_MakeEnvelope(-74.0251922607,40.6945658517,
|
||||||
|
-73.9651107788,40.7377626342,
|
||||||
|
4326),
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed as the first argument, an error is thrown: `Invalid geometry type (ST_Point), expecting 'ST_MultiPolygon' or 'ST_Polygon'`
|
||||||
|
|
||||||
|
## OBS_GetBoundary(point_geometry, boundary_id)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundary(point_geometry, boundary_id)``` method returns a boundary geometry defined as overlapping the point geometry and from the desired boundary set (e.g. Census Tracts). See the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids). This is a useful method for performing aggregations of points.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
point_geometry | a WGS84 polygon geometry (the_geom)
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids)
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A boundary geometry. If no value is found at the requested `boundary_id` or `timespan`, a null value is returned.
|
||||||
|
|
||||||
|
Value | Description
|
||||||
|
--- | ---
|
||||||
|
geom | WKB geometry
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Overwrite a point geometry with a boundary geometry that contains it in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET the_geom = OBS_GetBoundary(the_geom, 'us.census.tiger.block_group')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown: `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
|
|
||||||
|
## OBS_GetBoundaryId(point_geometry, boundary_id)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundaryId(point_geometry, boundary_id)``` returns a unique geometry_id for the boundary geometry that contains a given point geometry. See the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids). The method can be combined with ```OBS_GetBoundaryById(geometry_id)``` to create a point aggregation workflow.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point_geometry | a WGS84 point geometry (the_geom)
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids)
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TEXT boundary geometry id. If no value is found at the requested `boundary_id` or `timespan`, a null value is returned.
|
||||||
|
|
||||||
|
Value | Description
|
||||||
|
--- | ---
|
||||||
|
geometry_id | a string identifier of a geometry in the Boundaries
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Write the US Census block group geoid that contains the point geometry for every row as a new column in your table.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET geometry_id = OBS_GetBoundaryId(the_geom, 'us.census.tiger.block_group')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown: `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
|
|
||||||
|
## OBS_GetBoundaryById(geometry_id, boundary_id)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundaryById(geometry_id, boundary_id)``` returns the boundary geometry for a unique geometry_id. A geometry_id can be found using the ```OBS_GetBoundaryId(point_geometry, boundary_id)``` method described above.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
geometry_id | a string identifier for a Boundary geometry
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids)
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A boundary geometry. If a geometry is not found for the requested `geometry_id`, `boundary_id`, or `timespan`, then a null value is returned.
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
geom | a WGS84 polygon geometry
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Use a table of `geometry_id`s (e.g., geoid from the U.S. Census) to select the unique boundaries that they correspond to and insert into a table called, `overlapping_polygons`. This is a useful method for creating new choropleths of aggregate data.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
INSERT INTO overlapping_polygons (the_geom, geometry_id, point_count)
|
||||||
|
SELECT
|
||||||
|
OBS_GetBoundaryById(geometry_id, 'us.census.tiger.county') As the_geom,
|
||||||
|
geometry_id,
|
||||||
|
count(*)
|
||||||
|
FROM tablename
|
||||||
|
GROUP BY geometry_id
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetBoundariesByPointAndRadius(point geometry, radius numeric, boundary_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundariesByPointAndRadius(point, radius, boundary_id)``` method returns boundary geometries and their geographical identifiers that intersect (or are contained by) a circle centered on a point with a radius.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry
|
||||||
|
radius | a radius (in meters) from the center point
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a boundary geometry (e.g., a US Census tract)
|
||||||
|
geom_refs| a string identifier for the geometry (e.g., the geoid of a US Census tract)
|
||||||
|
|
||||||
|
If geometries are not found for the requested point and radius, `geometry_id`, `timespan`, or `overlap_type`, then null values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert into table `denver_census_tracts` the census tract boundaries and geom_refs of census tracts which intersect within 10 miles of downtown Denver, Colorado.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO denver_census_tracts(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetBoundariesByPointAndRadius(
|
||||||
|
CDB_LatLng(39.7392, -104.9903), -- Denver, Colorado
|
||||||
|
10000 * 1.609, -- 10 miles (10km * conversion to miles)
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown. E.g., `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
|
|
||||||
|
## OBS_GetPointsByPointAndRadius(point geometry, radius numeric, boundary_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetPointsByPointAndRadius(point, radius, boundary_id)``` method returns point geometries on boundaries (e.g., a point that lies on a Census tract) and their geographical identifiers that intersect (or are contained by) a circle centered on a point with a radius.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry
|
||||||
|
radius | radius (in meters)
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a point geometry (e.g., a point on a US Census tract)
|
||||||
|
geom_refs | a string identifier for the geometry (e.g., the geoid of a US Census tract)
|
||||||
|
|
||||||
|
If geometries are not found for the requested point and radius, `geometry_id`, `timespan`, or `overlap_type`, then null values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert into table `denver_tract_points` points on US census tracts and their corresponding geoids for census tracts which intersect within 10 miles of downtown Denver, Colorado, USA.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO denver_tract_points(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetPointsByPointAndRadius(
|
||||||
|
CDB_LatLng(39.7392, -104.9903), -- Denver, Colorado
|
||||||
|
10000 * 1.609, -- 10 miles (10km * conversion to miles)
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown. E.g., `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
@@ -0,0 +1,365 @@
|
|||||||
|
# Discovery Functions
|
||||||
|
|
||||||
|
If you are using the [discovery methods](https://carto.com/docs/carto-engine/data/overview/#discovery-methods) from the Data Observatory, use the following functions to retrieve [boundary](https://carto.com/docs/carto-engine/data/overview/#boundary-data) and [measures](https://carto.com/docs/carto-engine/data/overview/#measures-data) data.
|
||||||
|
|
||||||
|
## OBS_Search(search_term)
|
||||||
|
|
||||||
|
Use arbitrary text to search all available measures
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
search_term | a string to search for available measures
|
||||||
|
boundary_id | a string identifier for a boundary geometry (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
id | the unique id of the measure for use with the ```OBS_GetMeasure``` function
|
||||||
|
name | the human readable name of the measure
|
||||||
|
description | a brief description of the measure
|
||||||
|
aggregate | **sum** are raw count values, **median** are statistical medians, **average** are statistical averages, **undefined** other (e.g. an index value)
|
||||||
|
source | where the data came from (e.g. US Census Bureau)
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_Search('home value')
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetAvailableBoundaries(point_geometry)
|
||||||
|
|
||||||
|
Returns available `boundary_id`s at a given point geometry.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
point_geometry | a WGS84 point geometry (e.g. the_geom)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids)
|
||||||
|
description | a brief description of the boundary dataset
|
||||||
|
time_span | the timespan attached the boundary. this does not mean that the boundary is invalid outside of the timespan, but is the explicit timespan published with the geometry.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableBoundaries(CDB_LatLng(40.7, -73.9))
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetAvailableNumerators(bounds, filter_tags, denom_id, geom_id, timespan)
|
||||||
|
|
||||||
|
Return available numerators within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which some of the numerator's data must intersect with
|
||||||
|
filter_tags | Text[] | a list of filters. Only numerators for which all of these apply are returned `NULL` to ignore (optional)
|
||||||
|
denom_id | Text | the ID of a denominator to check whether the numerator is valid against. Will not reduce length of returned table, but will change values for `valid_denom` (optional)
|
||||||
|
geom_id | Text | the ID of a geometry to check whether the numerator is valid against. Will not reduce length of returned table, but will change values for `valid_geom` (optional)
|
||||||
|
timespan | Text | the ID of a timespan to check whether the numerator is valid against. Will not reduce length of returned table, but will change values for `valid_timespan` (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
numer_id | Text | The ID of the numerator
|
||||||
|
numer_name | Text | A human readable name for the numerator
|
||||||
|
numer_description | Text | Description of the numerator. Is sometimes NULL
|
||||||
|
numer_weight | Numeric | Numeric "weight" of the numerator. Ignored.
|
||||||
|
numer_license | Text | ID of the license for the numerator
|
||||||
|
numer_source | Text | ID of the source for the numerator
|
||||||
|
numer_type | Text | Postgres type of the numerator
|
||||||
|
numer_aggregate | Text | Aggregate type of the numerator. If `'SUM'`, this can be normalized by area
|
||||||
|
numer_extra | JSONB | Extra information about the numerator column. Ignored.
|
||||||
|
numer_tags | Text[] | Array of all tags applying to this numerator
|
||||||
|
valid_denom | Boolean | True if the `denom_id` argument is a valid denominator for this numerator, False otherwise
|
||||||
|
valid_geom | Boolean | True if the `geom_id` argument is a valid geometry for this numerator, False otherwise
|
||||||
|
valid_timespan | Boolean | True if the `timespan` argument is a valid timespan for this numerator, False otherwise
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326))
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle and are
|
||||||
|
employment related for the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle and are
|
||||||
|
related to both employment and age & gender for the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment, subsection/tags.age_gender}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that work with US population (`us.census.acs.B01003001`)
|
||||||
|
as a denominator.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_denom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators available in the timespan `2011 - 2015`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetAvailableDenominators(bounds, filter_tags, numer_id, geom_id, timespan)
|
||||||
|
|
||||||
|
Return available denominators within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which some of the denominator's data must intersect with
|
||||||
|
filter_tags | Text[] | a list of filters. Only denominators for which all of these apply are returned `NULL` to ignore (optional)
|
||||||
|
numer_id | Text | the ID of a numerator to check whether the denominator is valid against. Will not reduce length of returned table, but will change values for `valid_numer` (optional)
|
||||||
|
geom_id | Text | the ID of a geometry to check whether the denominator is valid against. Will not reduce length of returned table, but will change values for `valid_geom` (optional)
|
||||||
|
timespan | Text | the ID of a timespan to check whether the denominator is valid against. Will not reduce length of returned table, but will change values for `valid_timespan` (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
denom_id | Text | The ID of the denominator
|
||||||
|
denom_name | Text | A human readable name for the denominator
|
||||||
|
denom_description | Text | Description of the denominator. Is sometimes NULL
|
||||||
|
denom_weight | Numeric | Numeric "weight" of the denominator. Ignored.
|
||||||
|
denom_license | Text | ID of the license for the denominator
|
||||||
|
denom_source | Text | ID of the source for the denominator
|
||||||
|
denom_type | Text | Postgres type of the denominator
|
||||||
|
denom_aggregate | Text | Aggregate type of the denominator. If `'SUM'`, this can be normalized by area
|
||||||
|
denom_extra | JSONB | Extra information about the denominator column. Ignored.
|
||||||
|
denom_tags | Text[] | Array of all tags applying to this denominator
|
||||||
|
valid_numer | Boolean | True if the `numer_id` argument is a valid numerator for this denominator, False otherwise
|
||||||
|
valid_geom | Boolean | True if the `geom_id` argument is a valid geometry for this denominator, False otherwise
|
||||||
|
valid_timespan | Boolean | True if the `timespan` argument is a valid timespan for this denominator, False otherwise
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all denominators that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators for male population (`us.census.acs.B01001002`).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01001002')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators available in the timespan `2011 - 2015`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetAvailableGeometries(bounds, filter_tags, numer_id, denom_id, timespan, number_geometries)
|
||||||
|
|
||||||
|
Return available geometries within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which must intersect the geometry
|
||||||
|
filter_tags | Text[] | a list of filters. Only geometries for which all of these apply are returned `NULL` to ignore (optional)
|
||||||
|
numer_id | Text | the ID of a numerator to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_numer` (optional)
|
||||||
|
denom_id | Text | the ID of a denominator to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_denom` (optional)
|
||||||
|
timespan | Text | the ID of a timespan to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_timespan` (optional)
|
||||||
|
number_geometries | Integer | an additional variable that is used to adjust the calculation of the [score](https://carto.com/docs/carto-engine/data/discovery-functions/#returns-4) (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
geom_id | Text | The ID of the geometry
|
||||||
|
geom_name | Text | A human readable name for the geometry
|
||||||
|
geom_description | Text | Description of the geometry. Is sometimes NULL
|
||||||
|
geom_weight | Numeric | Numeric "weight" of the geometry. Ignored.
|
||||||
|
geom_aggregate | Text | Aggregate type of the geometry. Ignored.
|
||||||
|
geom_license | Text | ID of the license for the geometry
|
||||||
|
geom_source | Text | ID of the source for the geometry
|
||||||
|
geom_type | Text | Postgres type of the geometry
|
||||||
|
geom_extra | JSONB | Extra information about the geometry column. Ignored.
|
||||||
|
geom_tags | Text[] | Array of all tags applying to this geometry
|
||||||
|
valid_numer | Boolean | True if the `numer_id` argument is a valid numerator for this geometry, False otherwise
|
||||||
|
valid_denom | Boolean | True if the `geom_id` argument is a valid geometry for this geometry, False otherwise
|
||||||
|
valid_timespan | Boolean | True if the `timespan` argument is a valid timespan for this geometry, False otherwise
|
||||||
|
score | Numeric | Score between 0 and 100 for this geometry, higher numbers mean that this geometry is a better choice for the passed extent
|
||||||
|
numtiles | Numeric | How many raster tiles were read for score, numgeoms, and percentfill estimates
|
||||||
|
numgeoms | Numeric | About how many of these geometries fit inside the passed extent
|
||||||
|
percentfill | Numeric | About what percentage of the passed extent is filled with these geometries
|
||||||
|
estnumgeoms | Numeric | Ignored
|
||||||
|
meanmediansize | Numeric | Ignored
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all geometries that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all geometries that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all geometries that work with total population (`us.census.acs.B01003001`).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all geometries with timespan `2015`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetAvailableTimespans(bounds, filter_tags, numer_id, denom_id, geom_id)
|
||||||
|
|
||||||
|
Return available timespans within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which some of the timespan's data must intersect with
|
||||||
|
filter_tags | Text[] | a list of filters. Ignore
|
||||||
|
numer_id | Text | the ID of a numerator to check whether the timespans is valid against. Will not reduce length of returned table, but will change values for `valid_numer` (optional)
|
||||||
|
denom_id | Text | the ID of a denominator to check whether the timespans is valid against. Will not reduce length of returned table, but will change values for `valid_denom` (optional)
|
||||||
|
geom_id | Text | the ID of a geometry to check whether the timespans is valid against. Will not reduce length of returned table, but will change values for `valid_geom` (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
timespan_id | Text | The ID of the timespan
|
||||||
|
timespan_name | Text | A human readable name for the timespan
|
||||||
|
timespan_description | Text | Ignored
|
||||||
|
timespan_weight | Numeric | Ignored
|
||||||
|
timespan_aggregate | Text | Ignored
|
||||||
|
timespan_license | Text | Ignored
|
||||||
|
timespan_source | Text | Ignored
|
||||||
|
timespan_type | Text | Ignored
|
||||||
|
timespan_extra | JSONB | Ignored
|
||||||
|
timespan_tags | JSONB | Ignored
|
||||||
|
valid_numer | Boolean | True if the `numer_id` argument is a valid numerator for this timespan, False otherwise
|
||||||
|
valid_denom | Boolean | True if the `timespan` argument is a valid timespan for this timespan, False otherwise
|
||||||
|
valid_geom | Boolean | True if the `geom_id` argument is a valid geometry for this timespan, False otherwise
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all timespans that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all timespans for total population (`us.census.acs.B01003001`).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all timespans that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
@@ -0,0 +1,539 @@
|
|||||||
|
# Measures Functions
|
||||||
|
|
||||||
|
[Data Observatory Measures](https://carto.com/docs/carto-engine/data/overview/#measures-methods) are the numerical location data you can access. The measure functions allow you to access individual measures to augment your own data or integrate in your analysis workflows. Measures are used by sending an identifier or a geometry (point or polygon) and receiving back a measure (an absolute value) for that location.
|
||||||
|
|
||||||
|
There are hundreds of measures and the list is growing with each release. You can currently discover and learn about measures contained in the Data Observatory by downloading our [Data Catalog](https://cartodb.github.io/bigmetadata/index.html).
|
||||||
|
|
||||||
|
You can [access](https://carto.com/docs/carto-engine/data/accessing) measures through CARTO Builder. The same methods will work if you are using the CARTO Engine to develop your application. We [encourage you](https://carto.com/docs/carto-engine/data/accessing/#best-practices) to use table modifying methods (UPDATE and INSERT) over dynamic methods (SELECT).
|
||||||
|
|
||||||
|
## OBS_GetUSCensusMeasure(point geometry, measure_name text)
|
||||||
|
|
||||||
|
The ```OBS_GetUSCensusMeasure(point, measure_name)``` function returns a measure based on a subset of the US Census variables at a point location. The ```OBS_GetUSCensusMeasure``` function is limited to only a subset of all measures that are available in the Data Observatory. To access the full list, use measure IDs with the ```OBS_GetMeasure``` function below.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry (the_geom)
|
||||||
|
measure_name | a human-readable name of a US Census variable. The list of measure_names is [available in the Glossary](https://carto.com/docs/carto-engine/data/glossary/#obsgetuscensusmeasure-names-table).
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'area' and response comes back as a rate per square kilometer. Other options are 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html) (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty numeric column based on point locations in your table.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET total_population = OBS_GetUSCensusMeasure(the_geom, 'Total Population')
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetUSCensusMeasure(polygon geometry, measure_name text)
|
||||||
|
|
||||||
|
The ```OBS_GetUSCensusMeasure(polygon, measure_name)``` function returns a measure based on a subset of the US Census variables within a given polygon. The ```OBS_GetUSCensusMeasure``` function is limited to only a subset of all measures that are available in the Data Observatory. To access the full list, use the ```OBS_GetMeasure``` function below.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
polygon | a WGS84 polygon geometry (the_geom)
|
||||||
|
measure_name | a human readable string name of a US Census variable. The list of measure_names is [available in the Glossary](https://carto.com/docs/carto-engine/data/glossary/#obsgetuscensusmeasure-names-table).
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'none' and response comes back as a raw value. Other options are 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html) (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty numeric column based on polygons in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET local_male_population = OBS_GetUSCensusMeasure(the_geom, 'Male Population')
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetMeasure(point geometry, measure_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetMeasure(point, measure_id)``` function returns any Data Observatory measure at a point location. You can browse all available Measures in the [Catalog](https://cartodb.github.io/bigmetadata/index.html).
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry (the_geom)
|
||||||
|
measure_id | a measure identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf)). It is important to note that these are different than 'measure_name' used in the Census based functions above.
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'area' and response comes back as a rate per square kilometer. The other option is 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html). (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty numeric column based on point locations in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET median_home_value_sqft = OBS_GetMeasure(the_geom, 'us.zillow.AllHomes_MedianValuePerSqft')
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetMeasure(polygon geometry, measure_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetMeasure(polygon, measure_id)``` function returns any Data Observatory measure calculated within a polygon.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
polygon_geometry | a WGS84 polygon geometry (the_geom)
|
||||||
|
measure_id | a measure identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf))
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'none' and response comes back as a raw value. Other options are 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html) (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty column based on polygons in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET household_count = OBS_GetMeasure(the_geom, 'us.census.acs.B11001001')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If an unrecognized normalization type is input, raises error: `'Only valid inputs for "normalize" are "area" (default) and "denominator".`
|
||||||
|
|
||||||
|
## OBS_GetMeasureById(geom_ref text, measure_id text, boundary_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetMeasureById(geom_ref, measure_id, boundary_id)``` function returns any Data Observatory measure that corresponds to the boundary in ```boundary_id``` that has a geometry reference of ```geom_ref```.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
geom_ref | a geometry reference (e.g., a US Census geoid)
|
||||||
|
measure_id | a measure identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf))
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span (optional) | time span of interest (e.g., 2010 - 2014). If `NULL` is passed, the measure from the most recent data will be used.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw measure associated with `geom_ref`
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty column based on county geoids in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET household_count = OBS_GetMeasureById(geoid_column, 'us.census.acs.B11001001', 'us.census.tiger.county')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* Returns `NULL` if there is a mismatch between the geometry reference and the boundary id such as using the geoid of a county with the boundary of block groups
|
||||||
|
|
||||||
|
## OBS_GetCategory(point geometry, category_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetCategory(point, category_id)``` function returns any Data Observatory Category value at a point location. The Categories available are currently limited to Segmentation categories. See the Segmentation section of the [Catalog](https://cartodb.github.io/bigmetadata/index.html) for more detail.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry (the_geom)
|
||||||
|
category_id | a category identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf)).
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TEXT value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | a text based category found at the supplied point
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add the Category to an empty column text column based on point locations in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET segmentation = OBS_GetCategory(the_geom, 'us.census.spielman_singleton_segments.X55')
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetMeta(extent geometry, metadata json, max_timespan_rank, max_score_rank, target_geoms)
|
||||||
|
|
||||||
|
The ```OBS_GetMeta(extent, metadata)``` function returns a completed Data
|
||||||
|
Observatory metadata JSON Object for use in ```OBS_GetData(geomvals,
|
||||||
|
metadata)``` or ```OBS_GetData(ids, metadata)```. It is not possible to pass
|
||||||
|
metadata to those functions if it is not processed by ```OBS_GetMeta(extent,
|
||||||
|
metadata)``` first.
|
||||||
|
|
||||||
|
`OBS_GetMeta` makes it possible to automatically select appropriate timespans
|
||||||
|
and boundaries for the measurement you want.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
extent | A geometry of the extent of the input geometries
|
||||||
|
metadata | A JSON array composed of metadata input objects. Each indicates one desired measure for an output column, and optionally additional parameters about that column
|
||||||
|
num_timespan_options | How many historical time periods to include. Defaults to 1
|
||||||
|
num_score_options | How many alternative boundary levels to include. Defaults to 1
|
||||||
|
target_geoms | Target number of geometries. Boundaries with close to this many objects within `extent` will be ranked highest.
|
||||||
|
|
||||||
|
The schema of the metadata input objects are as follows:
|
||||||
|
|
||||||
|
Metadata Input Key | Description
|
||||||
|
--- | -----------
|
||||||
|
numer_id | The identifier for the desired measurement. If left blank, but a `geom_id` is specified, the column will return a geometry instead of a measurement.
|
||||||
|
geom_id | Identifier for a desired geographic boundary level to use when calculating measures. Will be automatically assigned if undefined. If defined but `numer_id` is blank, then the column will return a geometry instead of a measurement.
|
||||||
|
normalization | The desired normalization. One of 'area', 'prenormalized', or 'denominated'. 'Area' will normalize the measure per square kilometer, 'prenormalized' will return the original value, and 'denominated' will normalize by a denominator. Ignored if this metadata object specifies a geometry.
|
||||||
|
denom_id | Identifier for a desired normalization column in case `normalization` is 'denominated'. Will be automatically assigned if necessary. Ignored if this metadata object specifies a geometry.
|
||||||
|
numer_timespan | The desired timespan for the measurement. Defaults to most recent timespan available if left unspecified.
|
||||||
|
geom_timespan | The desired timespan for the geometry. Defaults to timespan matching numer_timespan if left unspecified.
|
||||||
|
target_area | Instead of aiming to have `target_geoms` in the area of the geometry passed as `extent`, fill this area. Unit is square degrees WGS84. Set this to `0` if you want to use the smallest source geometry for this element of metadata, for example if you're passing in points.
|
||||||
|
target_geoms | Override global `target_geoms` for this element of metadata
|
||||||
|
max_timespan_rank | Only include timespans of this recency (for example, `1` is only the most recent timespan). No limit by default
|
||||||
|
max_score_rank | Only include boundaries of this relevance (for example, `1` is the most relevant boundary). Is `1` by default
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A JSON array composed of metadata output objects.
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
meta | A JSON array with completed metadata for the requested data, including all keys below
|
||||||
|
|
||||||
|
The schema of the metadata output objects are as follows. You should pass this
|
||||||
|
array as-is to ```OBS_GetData```. If you modify any values the function will
|
||||||
|
fail.
|
||||||
|
|
||||||
|
Metadata Output Key | Description
|
||||||
|
--- | -----------
|
||||||
|
suggested_name | A suggested column name for adding this to an existing table
|
||||||
|
numer_id | Identifier for desired measurement
|
||||||
|
numer_timespan | Timespan that will be used of the desired measurement
|
||||||
|
numer_name | Human-readable name of desired measure
|
||||||
|
numer_description | Long human-readable description of the desired measure
|
||||||
|
numer_t_description | Further information about the source table
|
||||||
|
numer_type | PostgreSQL/PostGIS type of desired measure
|
||||||
|
numer_colname | Internal identifier for column name
|
||||||
|
numer_tablename | Internal identifier for table
|
||||||
|
numer_geomref_colname | Internal identifier for geomref column name
|
||||||
|
denom_id | Identifier for desired normalization
|
||||||
|
denom_timespan | Timespan that will be used of the desired normalization
|
||||||
|
denom_name | Human-readable name of desired measure's normalization
|
||||||
|
denom_description | Long human-readable description of the desired measure's normalization
|
||||||
|
denom_t_description | Further information about the source table
|
||||||
|
denom_type | PostgreSQL/PostGIS type of desired measure's normalization
|
||||||
|
denom_colname | Internal identifier for normalization column name
|
||||||
|
denom_tablename | Internal identifier for normalization table
|
||||||
|
denom_geomref_colname | Internal identifier for normalization geomref column name
|
||||||
|
geom_id | Identifier for desired boundary geometry
|
||||||
|
geom_timespan | Timespan that will be used of the desired boundary geometry
|
||||||
|
geom_name | Human-readable name of desired boundary geometry
|
||||||
|
geom_description | Long human-readable description of the desired boundary geometry
|
||||||
|
geom_t_description | Further information about the source table
|
||||||
|
geom_type | PostgreSQL/PostGIS type of desired boundary geometry
|
||||||
|
geom_colname | Internal identifier for boundary geometry column name
|
||||||
|
geom_tablename | Internal identifier for boundary geometry table
|
||||||
|
geom_geomref_colname | Internal identifier for boundary geometry ref column name
|
||||||
|
timespan_rank | Ranking of this measurement by time, most recent is 1, second most recent 2, etc.
|
||||||
|
score | The score of this measurement's boundary compared to the `extent` and `target_geoms` passed in. Between 0 and 100.
|
||||||
|
score_rank | The ranking of this measurement's boundary, highest ranked is 1, second is 2, etc.
|
||||||
|
numer_aggregate | The aggregate type of the numerator, either `sum`, `average`, `median`, or blank
|
||||||
|
denom_aggregate | The aggregate type of the denominator, either `sum`, `average`, `median`, or blank
|
||||||
|
normalization | The sort of normalization that will be used for this measure, either `area`, `predenominated`, or `denominated`
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain metadata that can augment with one additional column of US population
|
||||||
|
data, using a boundary relevant for the geometry provided and latest timespan.
|
||||||
|
Limit to only the most recent column most relevant to the extent & density of
|
||||||
|
input geometries in `tablename`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain metadata that can augment with one additional column of US population
|
||||||
|
data, using census tract boundaries.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.census_tract"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain metadata that can augment with two additional columns, one for total
|
||||||
|
population and one for male population.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}, {"numer_id": "us.census.acs.B01001002"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_MetadataValidation(extent geometry, geometry_type text, metadata json, target_geoms)
|
||||||
|
|
||||||
|
The ```OBS_MetadataValidation``` function performs a validation check over the known issues using the extent, type of geometry, and metadata that is being used in the ```OBS_GetMeta``` function.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
extent | A geometry of the extent of the input geometries
|
||||||
|
geometry_type | The geometry type of the source data
|
||||||
|
metadata | A JSON array composed of metadata input objects. Each indicates one desired measure for an output column, and optional additional parameters about that column
|
||||||
|
target_geoms | Target number of geometries. Boundaries with close to this many objects within `extent` will be ranked highest
|
||||||
|
|
||||||
|
The schema of the metadata input objects are as follows:
|
||||||
|
|
||||||
|
Metadata Input Key | Description
|
||||||
|
--- | -----------
|
||||||
|
numer_id | The identifier for the desired measurement. If left blank, a `geom_id` is specified and the column returns a geometry, instead of a measurement
|
||||||
|
geom_id | Identifier for a desired geographic boundary level used to calculate measures. If undefined, this is automatically assigned. If defined, `numer_id` is blank and the column returns a geometry, instead of a measurement
|
||||||
|
normalization | The desired normalization. One of 'area', 'prenormalized', or 'denominated'. 'Area' will normalize the measure per square kilometer, 'prenormalized' will return the original value, and 'denominated' will normalize by a denominator. If the metadata object specifies a geometry, this is ignored
|
||||||
|
denom_id | When `normalization` is 'denominated', this is the identifier for a desired normalization column. This is automatically assigned. If the metadata object specifies a geometry, this is ignored
|
||||||
|
numer_timespan | The desired timespan for the measurement. If left unspecified, it defaults to the most recent timespan available
|
||||||
|
geom_timespan | The desired timespan for the geometry. If left unspecified, it defaults to the timespan matching `numer_timespan`
|
||||||
|
target_area | Instead of aiming to have `target_geoms` in the area of the geometry passed as `extent`, fill this area. Unit is square degrees WGS84. Set this to `0` if you want to use the smallest source geometry for this element of metadata. For example, if you are passing in points
|
||||||
|
target_geoms | Override global `target_geoms` for this element of metadata
|
||||||
|
max_timespan_rank | Only include timespans of this recency (For example, `1` is only the most recent timespan). There is no limit by default
|
||||||
|
max_score_rank | Only include boundaries of this relevance (for example, `1` is the most relevant boundary). The default is `1`
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
valid | A boolean field that represents if the validation was successful or not
|
||||||
|
errors | A text array with all possible errors
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Validate metadata with two additional columns of US census data; using a boundary relevant for the geometry provided and the latest timespan. Limited to the most recent column, and the most relevant, based on the extent and density of input geometries in `tablename`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_MetadataValidation(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
ST_GeometryType(the_geom),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}, {"numer_id": "us.census.acs.B01001002"}]',
|
||||||
|
COUNT(*)::INTEGER
|
||||||
|
) FROM tablename
|
||||||
|
GROUP BY ST_GeometryType(the_geom)
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetData(geomvals array[geomval], metadata json)
|
||||||
|
|
||||||
|
The ```OBS_GetData(geomvals, metadata)``` function returns a measure and/or
|
||||||
|
geometry corresponding to the `metadata` JSON array for each every Geometry of
|
||||||
|
the `geomval` element in the `geomvals` array. The metadata argument must be
|
||||||
|
obtained from ```OBS_GetMeta(extent, metadata)```.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
geomvals | An array of `geomval` elements, which are obtained by casting together a `Geometry` and a `Numeric`. This should be obtained by using `ARRAY_AGG((the_geom, cartodb_id)::geomval)` from the CARTO table one wishes to obtain data for.
|
||||||
|
metadata | A JSON array composed of metadata output objects from ```OBS_GetMeta(extent, metadata)```. The schema of the elements of the `metadata` JSON array corresponds to that of the output of ```OBS_GetMeta(extent, metadata)```, and this argument must be obtained from that function in order for the call to be valid.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE with the following schema, where each element of the input `geomvals`
|
||||||
|
array corresponds to one row:
|
||||||
|
|
||||||
|
Column | Type | Description
|
||||||
|
------ | ---- | -----------
|
||||||
|
id | Numeric | ID corresponding to the `val` component of an element of the input `geomvals` array
|
||||||
|
data | JSON | A JSON array with elements corresponding to the input `metadata` JSON array
|
||||||
|
|
||||||
|
Each `data` object has the following keys:
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
value | The value of the measurement or geometry for the geometry corresponding to this row and measurement corresponding to this position in the `metadata` JSON array
|
||||||
|
|
||||||
|
To determine the appropriate cast for `value`, one can use the `numer_type`
|
||||||
|
or `geom_type` key corresponding to that value in the input `metadata` JSON
|
||||||
|
array.
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain population densities for every geometry in a table, keyed by cartodb_id:
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta FROM tablename)
|
||||||
|
SELECT id AS cartodb_id, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta))
|
||||||
|
```
|
||||||
|
|
||||||
|
Update a table with a blank numeric column called `pop_density` with population
|
||||||
|
densities:
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta FROM tablename),
|
||||||
|
data AS (
|
||||||
|
SELECT id AS cartodb_id, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density
|
||||||
|
FROM data
|
||||||
|
WHERE cartodb_id = data.id
|
||||||
|
```
|
||||||
|
|
||||||
|
Update a table with two measurements at once, population density and household
|
||||||
|
density. The table should already have a Numeric column `pop_density` and
|
||||||
|
`household_density`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom),4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"},{"numer_id": "us.census.acs.B11001001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta from tablename),
|
||||||
|
data AS (
|
||||||
|
SELECT id,
|
||||||
|
data->0->>'value' AS pop_density,
|
||||||
|
data->1->>'value' AS household_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density,
|
||||||
|
household_density = data.household_density
|
||||||
|
FROM data
|
||||||
|
WHERE cartodb_id = data.id
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetData(ids array[text], metadata json)
|
||||||
|
|
||||||
|
The ```OBS_GetData(ids, metadata)``` function returns a measure and/or
|
||||||
|
geometry corresponding to the `metadata` JSON array for each every id of
|
||||||
|
the `ids` array. The metadata argument must be obtained from
|
||||||
|
`OBS_GetMeta(extent, metadata)`. When obtaining metadata, one must include
|
||||||
|
the `geom_id` corresponding to the boundary that the `ids` refer to.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
ids | An array of `TEXT` elements. This should be obtained by using `ARRAY_AGG(col_of_geom_refs)` from the CARTO table one wishes to obtain data for.
|
||||||
|
metadata | A JSON array composed of metadata output objects from ```OBS_GetMeta(extent, metadata)```. The schema of the elements of the `metadata` JSON array corresponds to that of the output of ```OBS_GetMeta(extent, metadata)```, and this argument must be obtained from that function in order for the call to be valid.
|
||||||
|
|
||||||
|
For this function to work, the `metadata` argument must include a `geom_id`
|
||||||
|
that corresponds to the ids found in `col_of_geom_refs`.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE with the following schema, where each element of the input `ids` array
|
||||||
|
corresponds to one row:
|
||||||
|
|
||||||
|
Column | Type | Description
|
||||||
|
------ | ---- | -----------
|
||||||
|
id | Text | ID corresponding to an element of the input `ids` array
|
||||||
|
data | JSON | A JSON array with elements corresponding to the input `metadata` JSON array
|
||||||
|
|
||||||
|
Each `data` object has the following keys:
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
value | The value of the measurement or geometry for the geometry corresponding to this row and measurement corresponding to this position in the `metadata` JSON array
|
||||||
|
|
||||||
|
To determine the appropriate cast for `value`, one can use the `numer_type`
|
||||||
|
or `geom_type` key corresponding to that value in the input `metadata` JSON
|
||||||
|
array.
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain population densities for every row of a table with FIPS code county IDs
|
||||||
|
(USA).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.county"}]'
|
||||||
|
) meta FROM tablename)
|
||||||
|
SELECT id AS fips, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG(fips) FROM tablename),
|
||||||
|
(SELECT meta FROM meta))
|
||||||
|
```
|
||||||
|
|
||||||
|
Update a table with population densities for every FIPS code county ID (USA).
|
||||||
|
This table has a blank column called `pop_density` and fips codes stored in a
|
||||||
|
column `fips`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.county"}]'
|
||||||
|
) meta FROM tablename),
|
||||||
|
data as (
|
||||||
|
SELECT id AS fips, (data->0->>'value') AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG(fips) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density
|
||||||
|
FROM data
|
||||||
|
WHERE fips = data.id
|
||||||
|
```
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
## Overview
|
||||||
|
|
||||||
|
Quick reference guides for learning how to use the Data Observatory features.
|
||||||
|
|
||||||
|
- [Data discovery guide](https://carto.com/developers/cartoframes/guides/Data-discovery/)
|
||||||
|
- [Data enrichment guide](https://carto.com/developers/cartoframes/guides/Data-enrichment/)
|
||||||
|
|
||||||
|
Play with [real examples](https://carto.com/developers/cartoframes/examples/#example-data-observatory).
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
## Introduction
|
||||||
|
|
||||||
|
Browse the interactive API documentation to search for specific Data Observatory methods, arguments, and sample code that can be used to build your applications.
|
||||||
|
|
||||||
|
[Check the reference](https://carto.com/developers/cartoframes/reference/#heading-Data-Observatory).
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
|
||||||
|
## Measures functions examples
|
||||||
|
|
||||||
|
- Add a measure to an empty numeric column based on point locations in your table.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET total_population = OBS_GetUSCensusMeasure(the_geom, 'Total Population')
|
||||||
|
|
||||||
|
|
||||||
|
- Add a measure to an empty numeric column based on polygons in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET local_male_population = OBS_GetUSCensusMeasure(the_geom, 'Male Population')
|
||||||
|
```
|
||||||
|
|
||||||
|
- Add a measure to an empty numeric column based on point locations in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET median_home_value_sqft = OBS_GetMeasure(the_geom, 'us.zillow.AllHomes_MedianValuePerSqft')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Add a measure to an empty column based on polygons in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET household_count = OBS_GetMeasure(the_geom, 'us.census.acs.B11001001')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Add the Category to an empty column text column based on point locations in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET segmentation = OBS_GetCategory(the_geom, 'us.census.spielman_singleton_segments.X55')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Obtain metadata that can augment with one additional column of US population
|
||||||
|
data, using a boundary relevant for the geometry provided and latest timespan.
|
||||||
|
Limit to only the most recent column most relevant to the extent & density of
|
||||||
|
input geometries in `tablename`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain metadata that can augment with one additional column of US population
|
||||||
|
data, using census tract boundaries.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.census_tract"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain metadata that can augment with two additional columns, one for total
|
||||||
|
population and one for male population.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}, {"numer_id": "us.census.acs.B01001002"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Validate metadata with two additional columns of US census data; using a boundary relevant for the geometry provided and the latest timespan. Limited to the most recent column, and the most relevant, based on the extent and density of input geometries in `tablename`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT OBS_MetadataValidation(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
ST_GeometryType(the_geom),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}, {"numer_id": "us.census.acs.B01001002"}]',
|
||||||
|
COUNT(*)::INTEGER
|
||||||
|
) FROM tablename
|
||||||
|
GROUP BY ST_GeometryType(the_geom)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Obtain population densities for every geometry in a table, keyed by cartodb_id:
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta FROM tablename)
|
||||||
|
SELECT id AS cartodb_id, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta))
|
||||||
|
```
|
||||||
|
|
||||||
|
- Update a table with a blank numeric column called `pop_density` with population
|
||||||
|
densities:
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta FROM tablename),
|
||||||
|
data AS (
|
||||||
|
SELECT id AS cartodb_id, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density
|
||||||
|
FROM data
|
||||||
|
WHERE cartodb_id = data.id
|
||||||
|
```
|
||||||
|
|
||||||
|
- Update a table with two measurements at once, population density and household
|
||||||
|
density. The table should already have a Numeric column `pop_density` and
|
||||||
|
`household_density`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom),4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"},{"numer_id": "us.census.acs.B11001001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta from tablename),
|
||||||
|
data AS (
|
||||||
|
SELECT id,
|
||||||
|
data->0->>'value' AS pop_density,
|
||||||
|
data->1->>'value' AS household_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density,
|
||||||
|
household_density = data.household_density
|
||||||
|
FROM data
|
||||||
|
WHERE cartodb_id = data.id
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Obtain population densities for every row of a table with FIPS code county IDs
|
||||||
|
(USA).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.county"}]'
|
||||||
|
) meta FROM tablename)
|
||||||
|
SELECT id AS fips, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG(fips) FROM tablename),
|
||||||
|
(SELECT meta FROM meta))
|
||||||
|
```
|
||||||
|
|
||||||
|
- Update a table with population densities for every FIPS code county ID (USA).
|
||||||
|
This table has a blank column called `pop_density` and fips codes stored in a
|
||||||
|
column `fips`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.county"}]'
|
||||||
|
) meta FROM tablename),
|
||||||
|
data as (
|
||||||
|
SELECT id AS fips, (data->0->>'value') AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG(fips) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density
|
||||||
|
FROM data
|
||||||
|
WHERE fips = data.id
|
||||||
|
```
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
- Insert all Census Tracts from Lower Manhattan and nearby areas within the supplied bounding box to a table named `manhattan_census_tracts` which has columns `the_geom` (geometry) and `geom_refs` (text).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO manhattan_census_tracts(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetBoundariesByGeometry(
|
||||||
|
ST_MakeEnvelope(-74.0251922607,40.6945658517,
|
||||||
|
-73.9651107788,40.7377626342,
|
||||||
|
4326),
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
- Insert points that lie on Census Tracts from Lower Manhattan and nearby areas within the supplied bounding box to a table named `manhattan_tract_points` which has columns `the_geom` (geometry) and `geom_refs` (text).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO manhattan_tract_points (the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetPointsByGeometry(
|
||||||
|
ST_MakeEnvelope(-74.0251922607,40.6945658517,
|
||||||
|
-73.9651107788,40.7377626342,
|
||||||
|
4326),
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Overwrite a point geometry with a boundary geometry that contains it in your table
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET the_geom = OBS_GetBoundary(the_geom, 'us.census.tiger.block_group')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Write the US Census block group geoid that contains the point geometry for every row as a new column in your table.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
UPDATE tablename
|
||||||
|
SET geometry_id = OBS_GetBoundaryId(the_geom, 'us.census.tiger.block_group')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Use a table of `geometry_id`s (e.g., geoid from the U.S. Census) to select the unique boundaries that they correspond to and insert into a table called, `overlapping_polygons`. This is a useful method for creating new choropleths of aggregate data.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
INSERT INTO overlapping_polygons (the_geom, geometry_id, point_count)
|
||||||
|
SELECT
|
||||||
|
OBS_GetBoundaryById(geometry_id, 'us.census.tiger.county') As the_geom,
|
||||||
|
geometry_id,
|
||||||
|
count(*)
|
||||||
|
FROM tablename
|
||||||
|
GROUP BY geometry_id
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Insert into table `denver_census_tracts` the census tract boundaries and geom_refs of census tracts which intersect within 10 miles of downtown Denver, Colorado.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO denver_census_tracts(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetBoundariesByPointAndRadius(
|
||||||
|
CDB_LatLng(39.7392, -104.9903), -- Denver, Colorado
|
||||||
|
10000 * 1.609, -- 10 miles (10km * conversion to miles)
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
- Insert into table `denver_tract_points` points on US census tracts and their corresponding geoids for census tracts which intersect within 10 miles of downtown Denver, Colorado, USA.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO denver_tract_points(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetPointsByPointAndRadius(
|
||||||
|
CDB_LatLng(39.7392, -104.9903), -- Denver, Colorado
|
||||||
|
10000 * 1.609, -- 10 miles (10km * conversion to miles)
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_Search('home value')
|
||||||
|
```
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableBoundaries(CDB_LatLng(40.7, -73.9))
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all numerators that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326))
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all numerators that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all numerators that are available within a small rectangle and are
|
||||||
|
employment related for the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment}');
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all numerators that are available within a small rectangle and are
|
||||||
|
related to both employment and age & gender for the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment, subsection/tags.age_gender}');
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all numerators that work with US population (`us.census.acs.B01003001`)
|
||||||
|
as a denominator.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_denom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all numerators that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all numerators available in the timespan `2011 - 2015`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all denominators that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all denominators that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all denominators for male population (`us.census.acs.B01001002`).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01001002')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all denominators that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all denominators available in the timespan `2011 - 2015`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all geometries that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all geometries that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all geometries that work with total population (`us.census.acs.B01003001`).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all geometries with timespan `2015`.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all timespans that are available within a small rectangle.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all timespans for total population (`us.census.acs.B01003001`).
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
- Obtain all timespans that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```SQL
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"main": {
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
"categories": [
|
||||||
|
{
|
||||||
|
"title": "Import",
|
||||||
|
"samples": [
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import standard table",
|
||||||
|
"desc": "Import standard table into your CARTO account.",
|
||||||
|
"file": "import/import-standard-table.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import sync table",
|
||||||
|
"desc": "Import sync table into your CARTO account from database.",
|
||||||
|
"file": "import/import-sync-table.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import sync table as dataset",
|
||||||
|
"desc": "Import sync table as dataset into your CARTO account.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Export",
|
||||||
|
"samples": [
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Tables",
|
||||||
|
"samples": [
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Misc",
|
||||||
|
"samples": [
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Import from database",
|
||||||
|
"desc": "Import data into your CARTO account from database.",
|
||||||
|
"file": "import/import-from-database.md"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
## Overview
|
||||||
|
|
||||||
|
For Enterprise account plans, the [Data Observatory](https://carto.com/data) provides access to a searchable catalog of advanced location data, such as census block, population segments, boundaries and so on. A set of SQL functions allow you to augment your own data and broaden your analysis by discovering boundaries and measures of data from this catalog.
|
||||||
|
|
||||||
|
This section describes the Data Observatory functions and the type of data that it returns.
|
||||||
|
|
||||||
|
### Functions Overview
|
||||||
|
|
||||||
|
There are several functions for accessing different categories of data into your visualizations. You can discover and retrieve data by requesting OBS functions from the Data Observatory. These Data Observatory functions are designed for specific, targeted methods of data analysis. The response for these functions are classified into two primary types of data results; measures and boundaries.
|
||||||
|
|
||||||
|
- Boundaries are the geospatial boundaries you need to map or aggregate your data. Examples include Country Borders, Zip Code Tabulation Areas, and Counties
|
||||||
|
|
||||||
|
- Measures are the various dimensions of information that CARTO can tell you about a place. Examples include, Population, Household Income, and Median Age
|
||||||
|
|
||||||
|
Depending on the OBS function, you will get one, or both, types of data in your result. See [Measures and Boundary Data](#measures-and-boundary-results) for details about available data.
|
||||||
|
|
||||||
|
#### Measures Functions
|
||||||
|
|
||||||
|
Use location-based measures to analyze your data by accessing population and industry measurements at point locations, or within a region or polygon. These include variables for demographic, economic, and other types of information.
|
||||||
|
|
||||||
|
- See [Measures Functions]({{ site.dataobservatory_docs }}/reference/#measures-functions) for specific OBS functions
|
||||||
|
- Returns Measures data results
|
||||||
|
|
||||||
|
#### Boundary Functions
|
||||||
|
|
||||||
|
Use global boundaries to analyze your data by accessing multi-scaled geometries for visualizations. Examples include US Block Groups and Census Tracts. These enable you to aggregate your data into geometric polygons. You can also use your own data to query specific boundaries.
|
||||||
|
|
||||||
|
- See [Boundary Functions]({{ site.dataobservatory_docs }}/reference/#boundary-functions) for specific OBS functions
|
||||||
|
- Returns Boundary data results
|
||||||
|
|
||||||
|
#### Discovery Functions
|
||||||
|
|
||||||
|
Discovery Functions provide easier ways for you to find Measures and Boundaries of interest in the Data Observatory. The Discovery functions allow you to perform targeted searches for Measures, or use your own data to discover what is available at a given location. As this is a **retrieval tool** of the Data Observatory, the query results do not change your table. The response back displays one or more identifiers as matches to your search criteria. Each unique identifier can _then_ be used as part of other OBS functions to access any of the other Data Observatory functions.
|
||||||
|
|
||||||
|
- See [Discovery Functions]({{ site.dataobservatory_docs }}/reference/#discovery-functions) for specific OBS functions
|
||||||
|
- Returns Boundary or Measures matches for your data
|
||||||
|
|
||||||
|
### Measures and Boundary Results
|
||||||
|
|
||||||
|
The response from the Data Observatory functions are classified as either Measures or Boundary. Depending on your OBS function, you will get one, or both, types of data in your result.
|
||||||
|
|
||||||
|
#### Measures Data
|
||||||
|
|
||||||
|
Measures provide details about local populations, markets, industries and other dimensions. You can search for available Measures using the Discovery functions, or by viewing the Data Catalog. Measures can be requested for Point locations, or can be summarized for Polygons (regions). In general, Point location requests will return raw aggregate values (e.g. Median Rent), or will provide amounts per square kilometer (e.g. Population). The total square kilometers of the area searched will be returned, allowing you to get raw counts, if needed. Alternatively, if you search over a polygon, raw counts will be returned.
|
||||||
|
|
||||||
|
The following table indicates where Measures data results are available. Measures can include raw measures and when indicated, can provide geometries.
|
||||||
|
|
||||||
|
Data Category | Examples | Type of Data Response | Availability
|
||||||
|
--- | ---
|
||||||
|
Housing | Vacant Housing Units, Median Rent, Units for Sale, Mortgage Count | Point measurement, Area measurement, With Geo Border | United States
|
||||||
|
Income | Median Household Income, Gini Index | Point measurement, Area measurement, With Geo Border | United States
|
||||||
|
Education | Students Enrolled in School, Population Completed H.S | Point measurement, Area measurement, With Geo Border | United States
|
||||||
|
Languages | Speaks Spanish at Home, Speaks only English at Home | Point measurement, Area measurement, With Geo Border | United States
|
||||||
|
Employment | Workers over the Age of 16 | Point measurement, Area measurement, With Geo Border | United States
|
||||||
|
Jobs and Workforce | Origin-Destination of Workforce, Job Wages by job type | Point measurement, Area measurement, With Geo Border | United States
|
||||||
|
Transportation | Commuters by Public Transportation, Work at Home | Point measurement, Area measurement, With Geo Border | United States
|
||||||
|
Race, Age and Gender | Asian Population, Median Age, Job wages by race | Point measurement, Area measurement, With Geo Border | United States, Spain
|
||||||
|
Population | Population per Square Kilometer | Point measurement, Area measurement | United States, Spain
|
||||||
|
|
||||||
|
#### Boundary Data
|
||||||
|
|
||||||
|
The following table indicates where Boundary data results are available.
|
||||||
|
|
||||||
|
Boundary Name | Availability
|
||||||
|
--- | ---
|
||||||
|
Countries | Global
|
||||||
|
First-level administrative subdivisions | Global
|
||||||
|
Second-level administrative subdivisions | United States
|
||||||
|
Zip Code Tabulation Areas (ZCTA) | United States
|
||||||
|
Congressional Districts | United States
|
||||||
|
Digital Marketing Areas | United States
|
||||||
|
Census Public Use Microdata Areas | United States
|
||||||
|
Census Tracts |United States
|
||||||
|
Census Block Groups | United States
|
||||||
|
US Census Blocks | United States
|
||||||
|
Disputed Areas | Global
|
||||||
|
Marine Area | Global
|
||||||
|
Oceans | Global
|
||||||
|
Continents | Global
|
||||||
|
Timezones | Global
|
||||||
|
|
||||||
|
##### Water Clipping Levels
|
||||||
|
|
||||||
|
Many geometries come with various degrees of water accuracy (how closely they follow features such as coastlines). Water clipping refers to how the level of accuracy is returned by the Data Observatory. Data results can either include no clip (no water areas are clipped in the geometry), or high clip (coastlines and inland waterways are clipped out of the final geometry). For example, US Census data might only show coastlines as a straight border line, and not as an inland water area. To find out which levels of water clipping are available for Boundary layers, refer to the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html).
|
||||||
|
|
||||||
|
**Note:** While high clip water levels may be better for some kinds of maps and analysis, this type of data consumes more account storage space and may be subject to quota limitations.
|
||||||
|
|
||||||
|
For details about how to access any of this data, see [Accessing the Data Observatory]({{ site.dataobservatory_docs }}/guides/accessing-the-data-observatory/).
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
## Accessing the Data Observatory
|
||||||
|
|
||||||
|
The workflow for accessing the Data Observatory includes using a SQL query to apply a specific method of data enrichment or analysis to your data. You can access the Data Observatory by applying a custom query in CARTO Builder, or directly through the SQL API.
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
|
You must have an Enterprise account and be familiar with using SQL requests.
|
||||||
|
|
||||||
|
- The Data Observatory catalog includes data that is managed by CARTO, on a SaaS cloud platform. For Enterprise users, the Data Observatory can be enabled by contacting CARTO.
|
||||||
|
|
||||||
|
- A set of Data Observatory functions (prefaced with "OBS" for Observatory), allow you to retrieve boundaries and measures data through a SQL request. These functions should be used with UPDATE and INSERT statements, not SELECT statements, as we are currently not supporting dynamic use of the Data Observatory
|
||||||
|
|
||||||
|
**Tip:** See the recommended [Best Practices](#best-practices) for using the Data Observatory.
|
||||||
|
|
||||||
|
### Enrich from Data Observatory
|
||||||
|
|
||||||
|
As an alternative to using SQL queries, you can apply the _Enrich from Data Observatory_ ANALYSIS to a selected map layer in CARTO Builder. This enables you add a new column with contextual demographic and economic measures, without having to apply the code yourself. For details, see the [Enrich from Data Observatory Guide](https://carto.com/learn/guides/analysis/enrich-from-data-observatory) in our Learn hub.
|
||||||
|
|
||||||
|
### Apply OBS Functions to a Dataset
|
||||||
|
|
||||||
|
This procedure describes how to access the Data Observatory functions by applying SQL queries in a selected dataset.
|
||||||
|
|
||||||
|
1) Review the [prerequisites](#prerequisites) section before attempting to access any of the Data Observatory functions
|
||||||
|
|
||||||
|
2) [View the Data Observatory Catalog](https://cartodb.github.io/bigmetadata/index.html)
|
||||||
|
|
||||||
|
An overview for each of the analyzed functions of data appears, and indicates the unique function signature needed to access the catalog item. You can copy the OBS function from the Data Observatory catalog and modify the placeholder parameters shown in curly brackets (e.g. "{table_name}").
|
||||||
|
|
||||||
|
3) From _Your datasets_ dashboard in CARTO, click _NEW DATASET_ and _CREATE EMPTY DATASET_.
|
||||||
|
|
||||||
|
This creates an untitled table. You can get population measurements from the Data Observatory to build your dataset and create a map.
|
||||||
|
|
||||||
|
4) The SQL view is available when you are viewing your dataset in table view (Data View). Click the slider to switch between viewing your data by METADATA (table) to _SQL_ (opens the SQL view).
|
||||||
|
|
||||||
|
5) Apply the OBS function to modify your table.
|
||||||
|
|
||||||
|
For example, the following image displays a SQL query using the Boundary function, [`OBS_GetBoundariesByGeometry(geom geometry, geometry_id text)`](https://carto.com/docs/carto-engine/data/boundary-functions/#obsgetboundariesbygeometrygeom-geometry-geometryid-text) function. The SQL query inserts the boundary data as a single polygon geometry for each row of data.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
**Tip:** Want to insert population data to create a dataset? Replace `{my table name}` with your dataset name, and apply the SQL query:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO {my table name} (the_geom, name)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetBoundariesByGeometry(
|
||||||
|
st_makeenvelope(-73.97257804870605,40.671134192879286,-73.89052391052246,40.722868115036974, 4326),
|
||||||
|
'us.census.tiger.census_tract'
|
||||||
|
) As m(the_geom, geoid);
|
||||||
|
```
|
||||||
|
|
||||||
|
Another example shows how to get the local male population into your dataset. Before applying the SQL query, click _ADD COLUMN_ to create and name a column to store the [`OBS_GetMeasure`]({{ site.dataobservatory_docs}}/reference/#obsgetmeasurepolygon-geometry-measureid-text) data.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Tip:** Want to update your dataset to include the local male population from the Data Observatory? Replace `{my table name}` with your dataset name, and apply the SQL query:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE {my table name}
|
||||||
|
SET local_male_population = OBS_GetMeasure(the_geom, 'us.census.acs.B01001002')
|
||||||
|
```
|
||||||
|
6) Click _CREATE MAP_ from your dataset, to visualize the Data Observatory results. You can add custom styling, and add widgets to better visualize your data
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
### SQL API and OBS Functions
|
||||||
|
|
||||||
|
This procedure describes how to access the Data Observatory functions directly through the SQL API.
|
||||||
|
|
||||||
|
1. In order to use the SQL API, you must be [authenticated]({{ site.bdataobservatory_docs }}/guides/authentication/#authentication) using API keys
|
||||||
|
|
||||||
|
**Note:** Review the [prerequisites](#prerequisites) section before attempting to access any of the Data Observatory functions and [view the Data Observatory Catalog](https://cartodb.github.io/bigmetadata/index.html) to identify the OBS function you are looking for.
|
||||||
|
|
||||||
|
2. Query the Data Observatory directly with a specified `OBS` function to apply the results (Measures/Boundaries data) to your table, with the INSERT or UPDATE function
|
||||||
|
|
||||||
|
```sql
|
||||||
|
https://{username}.carto.com/api/v2/sql?q=UPDATE {tablename}
|
||||||
|
SET local_male_population = OBS_GetMeasure(the_geom, 'us.census.acs.B01001002')&api_key={api_key}
|
||||||
|
```
|
||||||
|
### Tips
|
||||||
|
|
||||||
|
Other useful tips about OBS functions:
|
||||||
|
|
||||||
|
- Some Data Observatory functions return geometries, enabling you to apply an UPDATE statement with an OBS function, to update `the_geom` column
|
||||||
|
- To include [water clipping levels]({{ site.dataobservatory_docs }}/guides/overview/#water-clipping-levels) as part of your results, append `_clipped` as part of the OBS function. For example:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE {tablename}
|
||||||
|
SET local_male_population = OBS_GetMeasure(the_geom, 'us.census.acs.B01001002','area','us.census.tiger.census_tract_clipped')
|
||||||
|
```
|
||||||
|
|
||||||
|
### Best Practices
|
||||||
|
|
||||||
|
The following usage notes are recommended when using the Data Observatory functions in SQL queries:
|
||||||
|
|
||||||
|
- It is discouraged to use the SELECT operation with the Data Observatory functions in your map layers. The results may be visible, but CARTO may not support dynamic rendering of the Data Observatory in the future, so your visualizations may break
|
||||||
|
|
||||||
|
The Data Observatory is **recommended** to be used with INSERT or UPDATE operations, for applying analyzed measures and boundaries data to your tables. While SELECT (retrieve) is standard for SQL API requests, be mindful of quota consumption and use INSERT (to insert a new record) or UPDATE (to update an existing record), for best practices.
|
||||||
|
|
||||||
|
**Exception:** [Discovery Functions]({{ site.dataobservatory_docs }}/guides/overview/#discovery-functions) are the exception. You can use SELECT as these functions are not actually retrieving data, they are retrieving ids that you can use for other functions.
|
||||||
|
|
||||||
|
- You can reduce storage space for unneeded geometries and optimize query optimizations by applying the PostGIS [`ST_Simplify`](http://www.postgis.org/docs/ST_Simplify.html) function. For example, you can simplify the `the_geom` for a large table of polygons and reduce the size of them for quicker rendering. For other tips, see the [most commonly used PostGIS functions](https://carto.com/docs/faqs/postgresql-and-postgis/#what-are-the-most-common-postgis-functions) that you can apply with CARTO
|
||||||
|
|
||||||
|
- Only point or polygon geometries are supported for OBS functions. If you attempt to apply Measures or Boundary results to line geometries, an error appears
|
||||||
|
|
||||||
|
- The Data Observatory is optimal for modifying existing tables with analytical results, not for building new tables of data
|
||||||
|
|
||||||
|
**Exception:** Exceptions apply for the following boundary functions, since they were designed to return multiple responses of geographical identifiers, as opposed to a single geometry. Create an empty dataset and build a new dataset from a SQL query, using any one of these boundary functions.
|
||||||
|
|
||||||
|
- [`OBS_GetBoundariesByGeometry(geom geometry, geometry_id text)`]({{ site.dataobservatory_docs }}/reference/#boundary-functions#obsgetboundariesbygeometrygeom-geometry-geometryid-text)
|
||||||
|
- [`OBS_GetPointsByGeometry(polygon geometry, geometry_id text)`]({{ site.dataobservatory_docs }}/reference/#boundary-functions#obsgetpointsbygeometrypolygon-geometry-geometryid-text)
|
||||||
|
- [`OBS_GetBoundariesByPointAndRadius(point geometry, radius numeric, boundary_id text`]({{ site.dataobservatory_docs }}/reference/#boundary-functions#obsgetboundariesbypointandradiuspoint-geometry-radius-numeric-boundaryid-text)
|
||||||
|
- [`OBS_GetPointsByPointAndRadius(point geometry, radius numeric, boundary_id text`]({{ site.dataobservatory_docs }}/reference/#boundary-functions#obsgetpointsbypointandradiuspoint-geometry-radius-numeric-boundaryid-text)
|
||||||
|
|
||||||
|
- For optimal performance, each SQL request should not exceed 100 rows. As an alternative, you can use a [SQL Batch Query](/docs/carto-engine/sql-api/batch-queries) for queries with long-running CPU processing times
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
View our [CARTO Blogs](https://carto.com/blog/categories/product/) for examples that highlight the benefits of using the Data Observatory.
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
## Glossary
|
||||||
|
|
||||||
|
A list of boundary ids and measure_names for Data Observatory functions. For US based boundaries, the Shoreline Clipped version provides a high-quality shoreline clipping for mapping uses.
|
||||||
|
|
||||||
|
### Boundary IDs
|
||||||
|
|
||||||
|
Boundary Name | Boundary ID | Shoreline Clipped Boundary ID
|
||||||
|
--------------------- | --------------------- | ---
|
||||||
|
US States | us.census.tiger.state | us.census.tiger.state_clipped
|
||||||
|
US County | us.census.tiger.county | us.census.tiger.county_clipped
|
||||||
|
US Census Zip Code Tabulation Areas | us.census.tiger.zcta5 | us.census.tiger.zcta5_clipped
|
||||||
|
US Census Tracts | us.census.tiger.census_tract | us.census.tiger.census_tract_clipped
|
||||||
|
US Elementary School District | us.census.tiger.school_district_elementary | us.census.tiger.school_district_elementary_clipped
|
||||||
|
US Secondary School District | us.census.tiger.school_district_secondary | us.census.tiger.school_district_secondary_clipped
|
||||||
|
US Unified School District | us.census.tiger.school_district_unified | us.census.tiger.school_district_unified_clipped
|
||||||
|
US Congressional Districts | us.census.tiger.congressional_district | us.census.tiger.congressional_district_clipped
|
||||||
|
US Census Blocks | us.census.tiger.block | us.census.tiger.block_clipped
|
||||||
|
US Census Block Groups | us.census.tiger.block_group | us.census.tiger.block_group_clipped
|
||||||
|
US Census PUMAs | us.census.tiger.puma | us.census.tiger.puma_clipped
|
||||||
|
US Incorporated Places | us.census.tiger.place | us.census.tiger.place_clipped
|
||||||
|
ES Sección Censal | es.ine.geom | none
|
||||||
|
Regions (First-level Administrative) | whosonfirst.wof_region_geom | none
|
||||||
|
Continents | whosonfirst.wof_continent_geom | none
|
||||||
|
Countries | whosonfirst.wof_country_geom | none
|
||||||
|
Marine Areas | whosonfirst.wof_marinearea_geom | none
|
||||||
|
Disputed Areas | whosonfirst.wof_disputed_geom | none
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### OBS_GetUSCensusMeasure Names Table
|
||||||
|
|
||||||
|
This list contains human readable names accepted in the ```OBS_GetUSCensusMeasure``` function. For the more comprehensive list of columns available to the ```OBS_GetMeasure``` function, see the [Data Observatory Catalog](https://cartodb.github.io/bigmetadata/index.html).
|
||||||
|
|
||||||
|
Measure ID | Measure Name | Measure Description
|
||||||
|
--------------------- | --------------------- | ---
|
||||||
|
us.census.acs.B01002001 | Median Age | The median age of all people in a given geographic area.
|
||||||
|
us.census.acs.B15003021 | Population Completed Associate’s Degree | The number of people in a geographic area over the age of 25 who obtained a associate’s degree, and did not complete a more advanced degree.
|
||||||
|
us.census.acs.B15003022 | Population Completed Bachelor’s Degree | The number of people in a geographic area over the age of 25 who obtained a bachelor’s degree, and did not complete a more advanced degree.
|
||||||
|
us.census.acs.B15003023 | Population Completed Master’s Degree | The number of people in a geographic area over the age of 25 who obtained a master’s degree, but did not complete a more advanced degree.
|
||||||
|
us.census.acs.B14001007 | Students Enrolled in Grades 9 to 12 | The total number of people in each geography currently enrolled in grades 9 through 12 inclusive. This corresponds roughly to high school.
|
||||||
|
us.census.acs.B05001006 | Not a U.S. Citizen Population | The number of people within each geography who indicated that they are not U.S. citizens.
|
||||||
|
us.census.acs.B19001012 | Households with income of $60,000 To $74,999 | The number of households in a geographic area whose annual income was between $60,000 and $74,999.
|
||||||
|
us.census.acs.B01003001 | Total Population | The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.
|
||||||
|
us.census.acs.B01001002 | Male Population | The number of people within each geography who are male.
|
||||||
|
us.census.acs.B01001026 | Female Population | The number of people within each geography who are female.
|
||||||
|
us.census.acs.B03002003 | White Population | The number of people identifying as white, non-Hispanic in each geography.
|
||||||
|
us.census.acs.B03002004 | Black or African American Population | The number of people identifying as black or African American, non-Hispanic in each geography.
|
||||||
|
us.census.acs.B03002006 | Asian Population | The number of people identifying as Asian, non-Hispanic in each geography.
|
||||||
|
us.census.acs.B03002012 | Hispanic Population | The number of people identifying as Hispanic or Latino in each geography.
|
||||||
|
us.census.acs.B03002005 | American Indian and Alaska Native Population | The number of people identifying as American Indian or Alaska native in each geography.
|
||||||
|
us.census.acs.B03002008 | Other Race population | The number of people identifying as another race in each geography.
|
||||||
|
us.census.acs.B03002009 | Two or more races population | The number of people identifying as two or more races in each geography.
|
||||||
|
us.census.acs.B03002002 | Population not Hispanic | The number of people not identifying as Hispanic or Latino in each geography.
|
||||||
|
us.census.acs.B23025001 | Population age 16 and over | The number of people in each geography who are age 16 or over.
|
||||||
|
us.census.acs.B08006001 | Workers over the Age of 16 | The number of people in each geography who work. Workers include those employed at private for-profit companies, the self-employed, government workers and non-profit employees.
|
||||||
|
us.census.acs.B08006002 | Commuters by Car, Truck, or Van | The number of workers age 16 years and over within a geographic area who primarily traveled to work by car, truck or van. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.
|
||||||
|
us.census.acs.B08006003 | Commuters who drove alone | The number of workers age 16 years and over within a geographic area who primarily traveled by car driving alone. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.
|
||||||
|
us.census.acs.B11001001 | Households | A count of the number of households in each geography. A household consists of one or more people who live in the same dwelling and also share at meals or living accommodation, and may consist of a single family or some other grouping of people.
|
||||||
|
us.census.acs.B08006004 | Commuters by Carpool | The number of workers age 16 years and over within a geographic area who primarily traveled to work by carpool. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.
|
||||||
|
us.census.acs.B08301010 | Commuters by Public Transportation | The number of workers age 16 years and over within a geographic area who primarily traveled to work by public transportation. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.
|
||||||
|
us.census.acs.B08006009 | Commuters by Bus | The number of workers age 16 years and over within a geographic area who primarily traveled to work by bus. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport.
|
||||||
|
us.census.acs.B08006011 | Commuters by Subway or Elevated | The number of workers age 16 years and over within a geographic area who primarily traveled to work by subway or elevated train. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport.
|
||||||
|
us.census.acs.B08006015 | Walked to Work | The number of workers age 16 years and over within a geographic area who primarily walked to work. This would mean that of any way of getting to work, they travelled the most distance walking.
|
||||||
|
us.census.acs.B08006017 | Worked at Home | The count within a geographical area of workers over the age of 16 who worked at home.
|
||||||
|
us.census.acs.B09001001 | Children under 18 Years of Age | The number of people within each geography who are under 18 years of age.
|
||||||
|
us.census.acs.B14001001 | Population 3 Years and Over | The total number of people in each geography age 3 years and over. This denominator is mostly used to calculate rates of school enrollment.
|
||||||
|
us.census.acs.B14001002 | Students Enrolled in School | The total number of people in each geography currently enrolled at any level of school, from nursery or pre-school to advanced post-graduate education. Only includes those over the age of 3.
|
||||||
|
us.census.acs.B14001005 | Students Enrolled in Grades 1 to 4 | The total number of people in each geography currently enrolled in grades 1 through 4 inclusive. This corresponds roughly to elementary school.
|
||||||
|
us.census.acs.B14001006 | Students Enrolled in Grades 5 to 8 | The total number of people in each geography currently enrolled in grades 5 through 8 inclusive. This corresponds roughly to middle school.
|
||||||
|
us.census.acs.B14001008 | Students Enrolled as Undergraduate in College | The number of people in a geographic area who are enrolled in college at the undergraduate level. Enrollment refers to being registered or listed as a student in an educational program leading to a college degree. This may be a public school or college, a private school or college.
|
||||||
|
us.census.acs.B15003001 | Population 25 Years and Over | The number of people in a geographic area who are over the age of 25. This is used mostly as a denominator of educational attainment.
|
||||||
|
us.census.acs.B15003017 | Population Completed High School | The number of people in a geographic area over the age of 25 who completed high school, and did not complete a more advanced degree.
|
||||||
|
us.census.acs.B15003019 | Population completed less than one year of college, no degree | The number of people in a geographic area over the age of 25 who attended college for less than one year and no further.
|
||||||
|
us.census.acs.B15003020 | Population completed more than one year of college, no degree | The number of people in a geographic area over the age of 25 who attended college for more than one year but did not obtain a degree.
|
||||||
|
us.census.acs.B16001001 | Population 5 Years and Over | The number of people in a geographic area who are over the age of 5. This is primarily used as a denominator of measures of language spoken at home.
|
||||||
|
us.census.acs.B16001002 | Speaks only English at Home | The number of people in a geographic area over age 5 who speak only English at home.
|
||||||
|
us.census.acs.B16001003 | Speaks Spanish at Home | The number of people in a geographic area over age 5 who speak Spanish at home, possibly in addition to other languages.
|
||||||
|
us.census.acs.B17001001 | Population for Whom Poverty Status Determined | The number of people in each geography who could be identified as either living in poverty or not. This should be used as the denominator when calculating poverty rates, as it excludes people for whom it was not possible to determine poverty.
|
||||||
|
us.census.acs.B17001002 | Income In The Past 12 Months Below Poverty Level | The number of people in a geographic area who are part of a family (which could be just them as an individual) determined to be in poverty following the Office of Management and Budget’s Directive 14. (https://www.census.gov/hhes/povmeas/methodology/ombdir14.html)
|
||||||
|
us.census.acs.B08134010 | Number of workers with a commute of over 60 minutes | The number of workers over the age of 16 who do not work from home and commute in over 60 minutes in a geographic area.
|
||||||
|
us.census.acs.B12005002 | Never Married | The number of people in a geographic area who have never been married.
|
||||||
|
us.census.acs.B12005005 | Currently married | The number of people in a geographic area who are currently married.
|
||||||
|
us.census.acs.B12005008 | Married but separated | The number of people in a geographic area who are married but separated.
|
||||||
|
us.census.acs.B12005012 | Widowed | The number of people in a geographic area who are widowed.
|
||||||
|
us.census.acs.B12005015 | Divorced | The number of people in a geographic area who are divorced.
|
||||||
|
us.census.acs.B19013001 | Median Household Income in the past 12 Months | Within a geographic area, the median income received by every household on a regular basis before payments for personal income taxes, social security, union dues, medicare deductions, etc. It includes income received from wages, salary, commissions, bonuses, and tips; self-employment income from own nonfarm or farm businesses, including proprietorships and partnerships; interest, dividends, net rental income, royalty income, or income from estates and trusts; Social Security or Railroad Retirement income; Supplemental Security Income (SSI); any cash public assistance or welfare payments from the state or local welfare office; retirement, survivor, or disability benefits; and any other sources of income received regularly such as Veterans’ (VA) payments, unemployment and/or worker’s compensation, child support, and alimony.
|
||||||
|
us.census.acs.B25001001 | Housing Units | A count of housing units in each geography. A housing unit is a house, an apartment, a mobile home or trailer, a group of rooms, or a single room occupied as separate living quarters, or if vacant, intended for occupancy as separate living quarters.
|
||||||
|
us.census.acs.B25002003 | Vacant Housing Units | The count of vacant housing units in a geographic area. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.
|
||||||
|
us.census.acs.B25004002 | Vacant Housing Units for Rent | The count of vacant housing units in a geographic area that are for rent. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.
|
||||||
|
us.census.acs.B19001013 | Households with income of $75,000 To $99,999 | The number of households in a geographic area whose annual income was between $75,000 and $99,999.
|
||||||
|
us.census.acs.B19001014 | Households with income of $100,000 To $124,999 | The number of households in a geographic area whose annual income was between $100,000 and $124,999.
|
||||||
|
us.census.acs.B25004004 | Vacant Housing Units for Sale | The count of vacant housing units in a geographic area that are for sale. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.
|
||||||
|
us.census.acs.B25058001 | Median Rent | The median contract rent within a geographic area. The contract rent is the monthly rent agreed to or contracted for, regardless of any furnishings, utilities, fees, meals, or services that may be included. For vacant units, it is the monthly rent asked for the rental unit at the time of interview.
|
||||||
|
us.census.acs.B25071001 | Percent of Household Income Spent on Rent | Within a geographic area, the median percentage of household income which was spent on gross rent. Gross rent is the amount of the contract rent plus the estimated average monthly cost of utilities (electricity, gas, water, sewer etc.) and fuels (oil, coal, wood, etc.) if these are paid by the renter. Household income is the sum of the income of all people 15 years and older living in the household.
|
||||||
|
us.census.acs.B25075025 | Owner-occupied Housing Units valued at $1,000,000 or more. | The count of owner occupied housing units in a geographic area that are valued at $1,000,000 or more. Value is the respondent’s estimate of how much the property (house and lot, mobile home and lot, or condominium unit) would sell for if it were for sale.
|
||||||
|
us.census.acs.B25081002 | Owner-occupied Housing Units with a Mortgage | The count of housing units within a geographic area that are mortagaged. Mortgage refers to all forms of debt where the property is pledged as security for repayment of the debt, including deeds of trust, trust deed, contracts to purchase, land contracts, junior mortgages, and home equity loans.
|
||||||
|
us.census.acs.B23025002 | Population in Labor Force | The number of people in each geography who are either in the civilian labor force or are members of the U.S. Armed Forces (people on active duty with the United States Army, Air Force, Navy, Marine Corps, or Coast Guard).
|
||||||
|
us.census.acs.B23025003 | Population in Civilian Labor Force | The number of civilians 16 years and over in each geography who can be classified as either employed or unemployed below.
|
||||||
|
us.census.acs.B08135001 | Aggregate travel time to work | The total number of minutes every worker over the age of 16 who did not work from home spent spent commuting to work in one day in a geographic area.
|
||||||
|
us.census.acs.B19001002 | Households with income less than $10,000 | The number of households in a geographic area whose annual income was less than $10,000.
|
||||||
|
us.census.acs.B19001003 | Households with income of $10,000 to $14,999 | The number of households in a geographic area whose annual income was between $10,000 and $14,999.
|
||||||
|
us.census.acs.B19001004 | Households with income of $15,000 to $19,999 | The number of households in a geographic area whose annual income was between $15,000 and $19,999.
|
||||||
|
us.census.acs.B23025004 | Employed Population | The number of civilians 16 years old and over in each geography who either (1) were at work, that is, those who did any work at all during the reference week as paid employees, worked in their own business or profession, worked on their own farm, or worked 15 hours or more as unpaid workers on a family farm or in a family business; or (2) were with a job but not at work, that is, those who did not work during the reference week but had jobs or businesses from which they were temporarily absent due to illness, bad weather, industrial dispute, vacation, or other personal reasons. Excluded from the employed are people whose only activity consisted of work around the house or unpaid volunteer work for religious, charitable, and similar organizations; also excluded are all institutionalized people and people on active duty in the United States Armed Forces.
|
||||||
|
us.census.acs.B23025005 | Unemployed Population | The number of civilians in each geography who are 16 years old and over and are classified as unemployed.
|
||||||
|
us.census.acs.B23025006 | Population in Armed Forces | The number of people in each geography who are members of the U.S. Armed Forces (people on active duty with the United States Army, Air Force, Navy, Marine Corps, or Coast Guard).
|
||||||
|
us.census.acs.B23025007 | Population Not in Labor Force | The number of people in each geography who are 16 years old and over who are not classified as members of the labor force. This category consists mainly of students, homemakers, retired workers, seasonal workers interviewed in an off season who were not looking for work, institutionalized people, and people doing only incidental unpaid family work.
|
||||||
|
us.census.acs.B12005001 | Population 15 Years and Over | The number of people in a geographic area who are over the age of 15. This is used mostly as a denominator of marital status.
|
||||||
|
us.census.acs.B08134001 | Workers age 16 and over who do not work from home | The number of workers over the age of 16 who do not work from home in a geographic area.
|
||||||
|
us.census.acs.B08134002 | Number of workers with less than 10 minute commute | The number of workers over the age of 16 who do not work from home and commute in less than 10 minutes in a geographic area.
|
||||||
|
us.census.acs.B08303004 | Number of workers with a commute between 10 and 14 minutes | The number of workers over the age of 16 who do not work from home and commute in between 10 and 14 minutes in a geographic area.
|
||||||
|
us.census.acs.B08303005 | Number of workers with a commute between 15 and 19 minutes | The number of workers over the age of 16 who do not work from home and commute in between 15 and 19 minutes in a geographic area.
|
||||||
|
us.census.acs.B08303006 | Number of workers with a commute between 20 and 24 minutes | The number of workers over the age of 16 who do not work from home and commute in between 20 and 24 minutes in a geographic area.
|
||||||
|
us.census.acs.B08303007 | Number of workers with a commute between 25 and 29 minutes | The number of workers over the age of 16 who do not work from home and commute in between 25 and 29 minutes in a geographic area.
|
||||||
|
us.census.acs.B08303008 | Number of workers with a commute between 30 and 34 minutes | The number of workers over the age of 16 who do not work from home and commute in between 30 and 34 minutes in a geographic area.
|
||||||
|
us.census.acs.B08134008 | Number of workers with a commute between 35 and 44 minutes | The number of workers over the age of 16 who do not work from home and commute in between 35 and 44 minutes in a geographic area.
|
||||||
|
us.census.acs.B08303011 | Number of workers with a commute between 45 and 59 minutes | The number of workers over the age of 16 who do not work from home and commute in between 45 and 59 minutes in a geographic area.
|
||||||
|
us.census.acs.B19001005 | Households with income of $20,000 To $24,999 | The number of households in a geographic area whose annual income was between $20,000 and $24,999.
|
||||||
|
us.census.acs.B19001006 | Households with income of $25,000 To $29,999 | The number of households in a geographic area whose annual income was between $20,000 and $24,999.
|
||||||
|
us.census.acs.B19001007 | Households with income of $30,000 To $34,999 | The number of households in a geographic area whose annual income was between $30,000 and $34,999.
|
||||||
|
us.census.acs.B19001008 | Households with income of $35,000 To $39,999 | The number of households in a geographic area whose annual income was between $35,000 and $39,999.
|
||||||
|
us.census.acs.B19001009 | Households with income of $40,000 To $44,999 | The number of households in a geographic area whose annual income was between $40,000 and $44,999.
|
||||||
|
us.census.acs.B19001010 | Households with income of $45,000 To $49,999 | The number of households in a geographic area whose annual income was between $45,000 and $49,999.
|
||||||
|
us.census.acs.B19001011 | Households with income of $50,000 To $59,999 | The number of households in a geographic area whose annual income was between $50,000 and $59,999.
|
||||||
|
us.census.acs.B19001015 | Households with income of $125,000 To $149,999 | The number of households in a geographic area whose annual income was between $125,000 and $149,999.
|
||||||
|
us.census.acs.B19001016 | Households with income of $150,000 To $199,999 | The number of households in a geographic area whose annual income was between $150,000 and $1999,999.
|
||||||
|
us.census.acs.B19001017 | Households with income of $200,000 Or More | The number of households in a geographic area whose annual income was more than $200,000.
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
## Introduction
|
||||||
|
|
||||||
|
The Data Observatory, available for Enterprise accounts, provides access to a catalog of analyzed data methods, and enables you to apply the results to your own datasets.
|
||||||
|
|
||||||
|
The contents described in this document are subject to CARTO's [Terms of Service](https://carto.com/legal/)
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
## Authentication
|
||||||
|
|
||||||
|
Data Observatory, like any other [CARTO platform's component]({{site.fundamental_docs}}/components/), requires using an API Key. From your CARTO dashboard, click _[Your API keys](https://carto.com/login)_ from the avatar drop-down menu to view your uniquely generated API Key for managing data with CARTO Engine.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Learn more about the [basics of authorization]({{site.fundamental_docs}}/authorization/), or dig into the details of [Auth API]({{site.authapi_docs}}/), if you want to know more about this part of CARTO platform.
|
||||||
|
|
||||||
|
The examples in this documentation may include a placeholder for the API Key. Ensure that you modify any placeholder parameters with your own credentials.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
## Versioning
|
||||||
|
|
||||||
|
Data Observartory uses [Semantic Versioning](http://semver.org/). View our Github repository to find tags for each [release](https://github.com/CartoDB/observatory-extension/releases).
|
||||||
@@ -0,0 +1,539 @@
|
|||||||
|
## Measures Functions
|
||||||
|
|
||||||
|
[Data Observatory Measures]({{site.dataobservatory_docs}}/guides/overview/#methods-overview) are the numerical location data you can access. The measure functions allow you to access individual measures to augment your own data or integrate in your analysis workflows. Measures are used by sending an identifier or a geometry (point or polygon) and receiving back a measure (an absolute value) for that location.
|
||||||
|
|
||||||
|
There are hundreds of measures and the list is growing with each release. You can currently discover and learn about measures contained in the Data Observatory by downloading our [Data Catalog](https://cartodb.github.io/bigmetadata/index.html).
|
||||||
|
|
||||||
|
You can [access]({{site.dataobservatory_docs}}/guides/overview/accessing-the-data-observatory/) measures through CARTO Builder. The same methods will work if you are using the CARTO Engine to develop your application. We [encourage you]({{site.dataobservatory_docs}}/guides/overview/accessing-the-data-observatory/) to use table modifying methods (UPDATE and INSERT) over dynamic methods (SELECT).
|
||||||
|
|
||||||
|
### OBS_GetUSCensusMeasure(point geometry, measure_name text)
|
||||||
|
|
||||||
|
The ```OBS_GetUSCensusMeasure(point, measure_name)``` function returns a measure based on a subset of the US Census variables at a point location. The ```OBS_GetUSCensusMeasure``` function is limited to only a subset of all measures that are available in the Data Observatory. To access the full list, use measure IDs with the ```OBS_GetMeasure``` function below.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry (the_geom)
|
||||||
|
measure_name | a human-readable name of a US Census variable. The list of measure_names is [available in the Glossary](https://carto.com/docs/carto-engine/data/glossary/#obsgetuscensusmeasure-names-table).
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'area' and response comes back as a rate per square kilometer. Other options are 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html) (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty numeric column based on point locations in your table.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET total_population = OBS_GetUSCensusMeasure(the_geom, 'Total Population')
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetUSCensusMeasure(polygon geometry, measure_name text)
|
||||||
|
|
||||||
|
The ```OBS_GetUSCensusMeasure(polygon, measure_name)``` function returns a measure based on a subset of the US Census variables within a given polygon. The ```OBS_GetUSCensusMeasure``` function is limited to only a subset of all measures that are available in the Data Observatory. To access the full list, use the ```OBS_GetMeasure``` function below.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
polygon | a WGS84 polygon geometry (the_geom)
|
||||||
|
measure_name | a human readable string name of a US Census variable. The list of measure_names is [available in the Glossary](https://carto.com/docs/carto-engine/data/glossary/#obsgetuscensusmeasure-names-table).
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'none' and response comes back as a raw value. Other options are 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html) (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty numeric column based on polygons in your table
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET local_male_population = OBS_GetUSCensusMeasure(the_geom, 'Male Population')
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetMeasure(point geometry, measure_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetMeasure(point, measure_id)``` function returns any Data Observatory measure at a point location. You can browse all available Measures in the [Catalog](https://cartodb.github.io/bigmetadata/index.html).
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry (the_geom)
|
||||||
|
measure_id | a measure identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf)). It is important to note that these are different than 'measure_name' used in the Census based functions above.
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'area' and response comes back as a rate per square kilometer. The other option is 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html). (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty numeric column based on point locations in your table
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET median_home_value_sqft = OBS_GetMeasure(the_geom, 'us.zillow.AllHomes_MedianValuePerSqft')
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetMeasure(polygon geometry, measure_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetMeasure(polygon, measure_id)``` function returns any Data Observatory measure calculated within a polygon.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
polygon_geometry | a WGS84 polygon geometry (the_geom)
|
||||||
|
measure_id | a measure identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf))
|
||||||
|
normalize | for measures that are **sums** (e.g. population) the default normalization is 'none' and response comes back as a raw value. Other options are 'denominator', which will use the denominator specified in the [Data Catalog](https://cartodb.github.io/bigmetadata/index.html) (optional)
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span | time span of interest (e.g., 2010 - 2014)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw or normalized measure
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty column based on polygons in your table
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET household_count = OBS_GetMeasure(the_geom, 'us.census.acs.B11001001')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If an unrecognized normalization type is input, raises error: `'Only valid inputs for "normalize" are "area" (default) and "denominator".`
|
||||||
|
|
||||||
|
### OBS_GetMeasureById(geom_ref text, measure_id text, boundary_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetMeasureById(geom_ref, measure_id, boundary_id)``` function returns any Data Observatory measure that corresponds to the boundary in ```boundary_id``` that has a geometry reference of ```geom_ref```.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
geom_ref | a geometry reference (e.g., a US Census geoid)
|
||||||
|
measure_id | a measure identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf))
|
||||||
|
boundary_id | source of geometries to pull measure from (e.g., 'us.census.tiger.census_tract')
|
||||||
|
time_span (optional) | time span of interest (e.g., 2010 - 2014). If `NULL` is passed, the measure from the most recent data will be used.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A NUMERIC value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | the raw measure associated with `geom_ref`
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add a measure to an empty column based on county geoids in your table
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET household_count = OBS_GetMeasureById(geoid_column, 'us.census.acs.B11001001', 'us.census.tiger.county')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* Returns `NULL` if there is a mismatch between the geometry reference and the boundary id such as using the geoid of a county with the boundary of block groups
|
||||||
|
|
||||||
|
## OBS_GetCategory(point geometry, category_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetCategory(point, category_id)``` function returns any Data Observatory Category value at a point location. The Categories available are currently limited to Segmentation categories. See the Segmentation section of the [Catalog](https://cartodb.github.io/bigmetadata/index.html) for more detail.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry (the_geom)
|
||||||
|
category_id | a category identifier from the Data Observatory ([see available measures](https://cartodb.github.io/bigmetadata/observatory.pdf)).
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TEXT value
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
value | a text based category found at the supplied point
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Add the Category to an empty column text column based on point locations in your table
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET segmentation = OBS_GetCategory(the_geom, 'us.census.spielman_singleton_segments.X55')
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetMeta(extent geometry, metadata json, max_timespan_rank, max_score_rank, target_geoms)
|
||||||
|
|
||||||
|
The ```OBS_GetMeta(extent, metadata)``` function returns a completed Data
|
||||||
|
Observatory metadata JSON Object for use in ```OBS_GetData(geomvals,
|
||||||
|
metadata)``` or ```OBS_GetData(ids, metadata)```. It is not possible to pass
|
||||||
|
metadata to those functions if it is not processed by ```OBS_GetMeta(extent,
|
||||||
|
metadata)``` first.
|
||||||
|
|
||||||
|
`OBS_GetMeta` makes it possible to automatically select appropriate timespans
|
||||||
|
and boundaries for the measurement you want.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
extent | A geometry of the extent of the input geometries
|
||||||
|
metadata | A JSON array composed of metadata input objects. Each indicates one desired measure for an output column, and optionally additional parameters about that column
|
||||||
|
num_timespan_options | How many historical time periods to include. Defaults to 1
|
||||||
|
num_score_options | How many alternative boundary levels to include. Defaults to 1
|
||||||
|
target_geoms | Target number of geometries. Boundaries with close to this many objects within `extent` will be ranked highest.
|
||||||
|
|
||||||
|
The schema of the metadata input objects are as follows:
|
||||||
|
|
||||||
|
Metadata Input Key | Description
|
||||||
|
--- | -----------
|
||||||
|
numer_id | The identifier for the desired measurement. If left blank, but a `geom_id` is specified, the column will return a geometry instead of a measurement.
|
||||||
|
geom_id | Identifier for a desired geographic boundary level to use when calculating measures. Will be automatically assigned if undefined. If defined but `numer_id` is blank, then the column will return a geometry instead of a measurement.
|
||||||
|
normalization | The desired normalization. One of 'area', 'prenormalized', or 'denominated'. 'Area' will normalize the measure per square kilometer, 'prenormalized' will return the original value, and 'denominated' will normalize by a denominator. Ignored if this metadata object specifies a geometry.
|
||||||
|
denom_id | Identifier for a desired normalization column in case `normalization` is 'denominated'. Will be automatically assigned if necessary. Ignored if this metadata object specifies a geometry.
|
||||||
|
numer_timespan | The desired timespan for the measurement. Defaults to most recent timespan available if left unspecified.
|
||||||
|
geom_timespan | The desired timespan for the geometry. Defaults to timespan matching numer_timespan if left unspecified.
|
||||||
|
target_area | Instead of aiming to have `target_geoms` in the area of the geometry passed as `extent`, fill this area. Unit is square degrees WGS84. Set this to `0` if you want to use the smallest source geometry for this element of metadata, for example if you're passing in points.
|
||||||
|
target_geoms | Override global `target_geoms` for this element of metadata
|
||||||
|
max_timespan_rank | Only include timespans of this recency (for example, `1` is only the most recent timespan). No limit by default
|
||||||
|
max_score_rank | Only include boundaries of this relevance (for example, `1` is the most relevant boundary). Is `1` by default
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A JSON array composed of metadata output objects.
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
meta | A JSON array with completed metadata for the requested data, including all keys below
|
||||||
|
|
||||||
|
The schema of the metadata output objects are as follows. You should pass this
|
||||||
|
array as-is to ```OBS_GetData```. If you modify any values the function will
|
||||||
|
fail.
|
||||||
|
|
||||||
|
Metadata Output Key | Description
|
||||||
|
--- | -----------
|
||||||
|
suggested_name | A suggested column name for adding this to an existing table
|
||||||
|
numer_id | Identifier for desired measurement
|
||||||
|
numer_timespan | Timespan that will be used of the desired measurement
|
||||||
|
numer_name | Human-readable name of desired measure
|
||||||
|
numer_description | Long human-readable description of the desired measure
|
||||||
|
numer_t_description | Further information about the source table
|
||||||
|
numer_type | PostgreSQL/PostGIS type of desired measure
|
||||||
|
numer_colname | Internal identifier for column name
|
||||||
|
numer_tablename | Internal identifier for table
|
||||||
|
numer_geomref_colname | Internal identifier for geomref column name
|
||||||
|
denom_id | Identifier for desired normalization
|
||||||
|
denom_timespan | Timespan that will be used of the desired normalization
|
||||||
|
denom_name | Human-readable name of desired measure's normalization
|
||||||
|
denom_description | Long human-readable description of the desired measure's normalization
|
||||||
|
denom_t_description | Further information about the source table
|
||||||
|
denom_type | PostgreSQL/PostGIS type of desired measure's normalization
|
||||||
|
denom_colname | Internal identifier for normalization column name
|
||||||
|
denom_tablename | Internal identifier for normalization table
|
||||||
|
denom_geomref_colname | Internal identifier for normalization geomref column name
|
||||||
|
geom_id | Identifier for desired boundary geometry
|
||||||
|
geom_timespan | Timespan that will be used of the desired boundary geometry
|
||||||
|
geom_name | Human-readable name of desired boundary geometry
|
||||||
|
geom_description | Long human-readable description of the desired boundary geometry
|
||||||
|
geom_t_description | Further information about the source table
|
||||||
|
geom_type | PostgreSQL/PostGIS type of desired boundary geometry
|
||||||
|
geom_colname | Internal identifier for boundary geometry column name
|
||||||
|
geom_tablename | Internal identifier for boundary geometry table
|
||||||
|
geom_geomref_colname | Internal identifier for boundary geometry ref column name
|
||||||
|
timespan_rank | Ranking of this measurement by time, most recent is 1, second most recent 2, etc.
|
||||||
|
score | The score of this measurement's boundary compared to the `extent` and `target_geoms` passed in. Between 0 and 100.
|
||||||
|
score_rank | The ranking of this measurement's boundary, highest ranked is 1, second is 2, etc.
|
||||||
|
numer_aggregate | The aggregate type of the numerator, either `sum`, `average`, `median`, or blank
|
||||||
|
denom_aggregate | The aggregate type of the denominator, either `sum`, `average`, `median`, or blank
|
||||||
|
normalization | The sort of normalization that will be used for this measure, either `area`, `predenominated`, or `denominated`
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain metadata that can augment with one additional column of US population
|
||||||
|
data, using a boundary relevant for the geometry provided and latest timespan.
|
||||||
|
Limit to only the most recent column most relevant to the extent & density of
|
||||||
|
input geometries in `tablename`.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain metadata that can augment with one additional column of US population
|
||||||
|
data, using census tract boundaries.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.census_tract"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain metadata that can augment with two additional columns, one for total
|
||||||
|
population and one for male population.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}, {"numer_id": "us.census.acs.B01001002"}]',
|
||||||
|
1, 1,
|
||||||
|
COUNT(*)
|
||||||
|
) FROM tablename
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_MetadataValidation(extent geometry, geometry_type text, metadata json, target_geoms)
|
||||||
|
|
||||||
|
The ```OBS_MetadataValidation``` function performs a validation check over the known issues using the extent, type of geometry, and metadata that is being used in the ```OBS_GetMeta``` function.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
extent | A geometry of the extent of the input geometries
|
||||||
|
geometry_type | The geometry type of the source data
|
||||||
|
metadata | A JSON array composed of metadata input objects. Each indicates one desired measure for an output column, and optional additional parameters about that column
|
||||||
|
target_geoms | Target number of geometries. Boundaries with close to this many objects within `extent` will be ranked highest
|
||||||
|
|
||||||
|
The schema of the metadata input objects are as follows:
|
||||||
|
|
||||||
|
Metadata Input Key | Description
|
||||||
|
--- | -----------
|
||||||
|
numer_id | The identifier for the desired measurement. If left blank, a `geom_id` is specified and the column returns a geometry, instead of a measurement
|
||||||
|
geom_id | Identifier for a desired geographic boundary level used to calculate measures. If undefined, this is automatically assigned. If defined, `numer_id` is blank and the column returns a geometry, instead of a measurement
|
||||||
|
normalization | The desired normalization. One of 'area', 'prenormalized', or 'denominated'. 'Area' will normalize the measure per square kilometer, 'prenormalized' will return the original value, and 'denominated' will normalize by a denominator. If the metadata object specifies a geometry, this is ignored
|
||||||
|
denom_id | When `normalization` is 'denominated', this is the identifier for a desired normalization column. This is automatically assigned. If the metadata object specifies a geometry, this is ignored
|
||||||
|
numer_timespan | The desired timespan for the measurement. If left unspecified, it defaults to the most recent timespan available
|
||||||
|
geom_timespan | The desired timespan for the geometry. If left unspecified, it defaults to the timespan matching `numer_timespan`
|
||||||
|
target_area | Instead of aiming to have `target_geoms` in the area of the geometry passed as `extent`, fill this area. Unit is square degrees WGS84. Set this to `0` if you want to use the smallest source geometry for this element of metadata. For example, if you are passing in points
|
||||||
|
target_geoms | Override global `target_geoms` for this element of metadata
|
||||||
|
max_timespan_rank | Only include timespans of this recency (For example, `1` is only the most recent timespan). There is no limit by default
|
||||||
|
max_score_rank | Only include boundaries of this relevance (for example, `1` is the most relevant boundary). The default is `1`
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
valid | A boolean field that represents if the validation was successful or not
|
||||||
|
errors | A text array with all possible errors
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Validate metadata with two additional columns of US census data; using a boundary relevant for the geometry provided and the latest timespan. Limited to the most recent column, and the most relevant, based on the extent and density of input geometries in `tablename`.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT OBS_MetadataValidation(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
ST_GeometryType(the_geom),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}, {"numer_id": "us.census.acs.B01001002"}]',
|
||||||
|
COUNT(*)::INTEGER
|
||||||
|
) FROM tablename
|
||||||
|
GROUP BY ST_GeometryType(the_geom)
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetData(geomvals array[geomval], metadata json)
|
||||||
|
|
||||||
|
The ```OBS_GetData(geomvals, metadata)``` function returns a measure and/or
|
||||||
|
geometry corresponding to the `metadata` JSON array for each every Geometry of
|
||||||
|
the `geomval` element in the `geomvals` array. The metadata argument must be
|
||||||
|
obtained from ```OBS_GetMeta(extent, metadata)```.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
geomvals | An array of `geomval` elements, which are obtained by casting together a `Geometry` and a `Numeric`. This should be obtained by using `ARRAY_AGG((the_geom, cartodb_id)::geomval)` from the CARTO table one wishes to obtain data for.
|
||||||
|
metadata | A JSON array composed of metadata output objects from ```OBS_GetMeta(extent, metadata)```. The schema of the elements of the `metadata` JSON array corresponds to that of the output of ```OBS_GetMeta(extent, metadata)```, and this argument must be obtained from that function in order for the call to be valid.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE with the following schema, where each element of the input `geomvals`
|
||||||
|
array corresponds to one row:
|
||||||
|
|
||||||
|
Column | Type | Description
|
||||||
|
------ | ---- | -----------
|
||||||
|
id | Numeric | ID corresponding to the `val` component of an element of the input `geomvals` array
|
||||||
|
data | JSON | A JSON array with elements corresponding to the input `metadata` JSON array
|
||||||
|
|
||||||
|
Each `data` object has the following keys:
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
value | The value of the measurement or geometry for the geometry corresponding to this row and measurement corresponding to this position in the `metadata` JSON array
|
||||||
|
|
||||||
|
To determine the appropriate cast for `value`, one can use the `numer_type`
|
||||||
|
or `geom_type` key corresponding to that value in the input `metadata` JSON
|
||||||
|
array.
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain population densities for every geometry in a table, keyed by cartodb_id:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta FROM tablename)
|
||||||
|
SELECT id AS cartodb_id, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta))
|
||||||
|
```
|
||||||
|
|
||||||
|
Update a table with a blank numeric column called `pop_density` with population
|
||||||
|
densities:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta FROM tablename),
|
||||||
|
data AS (
|
||||||
|
SELECT id AS cartodb_id, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density
|
||||||
|
FROM data
|
||||||
|
WHERE cartodb_id = data.id
|
||||||
|
```
|
||||||
|
|
||||||
|
Update a table with two measurements at once, population density and household
|
||||||
|
density. The table should already have a Numeric column `pop_density` and
|
||||||
|
`household_density`.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom),4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"},{"numer_id": "us.census.acs.B11001001"}]',
|
||||||
|
1, 1, COUNT(*)
|
||||||
|
) meta from tablename),
|
||||||
|
data AS (
|
||||||
|
SELECT id,
|
||||||
|
data->0->>'value' AS pop_density,
|
||||||
|
data->1->>'value' AS household_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG((the_geom, cartodb_id)::geomval) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density,
|
||||||
|
household_density = data.household_density
|
||||||
|
FROM data
|
||||||
|
WHERE cartodb_id = data.id
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetData(ids array[text], metadata json)
|
||||||
|
|
||||||
|
The ```OBS_GetData(ids, metadata)``` function returns a measure and/or
|
||||||
|
geometry corresponding to the `metadata` JSON array for each every id of
|
||||||
|
the `ids` array. The metadata argument must be obtained from
|
||||||
|
`OBS_GetMeta(extent, metadata)`. When obtaining metadata, one must include
|
||||||
|
the `geom_id` corresponding to the boundary that the `ids` refer to.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
---- | -----------
|
||||||
|
ids | An array of `TEXT` elements. This should be obtained by using `ARRAY_AGG(col_of_geom_refs)` from the CARTO table one wishes to obtain data for.
|
||||||
|
metadata | A JSON array composed of metadata output objects from ```OBS_GetMeta(extent, metadata)```. The schema of the elements of the `metadata` JSON array corresponds to that of the output of ```OBS_GetMeta(extent, metadata)```, and this argument must be obtained from that function in order for the call to be valid.
|
||||||
|
|
||||||
|
For this function to work, the `metadata` argument must include a `geom_id`
|
||||||
|
that corresponds to the ids found in `col_of_geom_refs`.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE with the following schema, where each element of the input `ids` array
|
||||||
|
corresponds to one row:
|
||||||
|
|
||||||
|
Column | Type | Description
|
||||||
|
------ | ---- | -----------
|
||||||
|
id | Text | ID corresponding to an element of the input `ids` array
|
||||||
|
data | JSON | A JSON array with elements corresponding to the input `metadata` JSON array
|
||||||
|
|
||||||
|
Each `data` object has the following keys:
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | -----------
|
||||||
|
value | The value of the measurement or geometry for the geometry corresponding to this row and measurement corresponding to this position in the `metadata` JSON array
|
||||||
|
|
||||||
|
To determine the appropriate cast for `value`, one can use the `numer_type`
|
||||||
|
or `geom_type` key corresponding to that value in the input `metadata` JSON
|
||||||
|
array.
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain population densities for every row of a table with FIPS code county IDs
|
||||||
|
(USA).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.county"}]'
|
||||||
|
) meta FROM tablename)
|
||||||
|
SELECT id AS fips, (data->0->>'value')::Numeric AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG(fips) FROM tablename),
|
||||||
|
(SELECT meta FROM meta))
|
||||||
|
```
|
||||||
|
|
||||||
|
Update a table with population densities for every FIPS code county ID (USA).
|
||||||
|
This table has a blank column called `pop_density` and fips codes stored in a
|
||||||
|
column `fips`.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
WITH meta AS (
|
||||||
|
SELECT OBS_GetMeta(
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.county"}]'
|
||||||
|
) meta FROM tablename),
|
||||||
|
data as (
|
||||||
|
SELECT id AS fips, (data->0->>'value') AS pop_density
|
||||||
|
FROM OBS_GetData((SELECT ARRAY_AGG(fips) FROM tablename),
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
UPDATE tablename
|
||||||
|
SET pop_density = data.pop_density
|
||||||
|
FROM data
|
||||||
|
WHERE fips = data.id
|
||||||
|
```
|
||||||
@@ -0,0 +1,273 @@
|
|||||||
|
## Boundary Functions
|
||||||
|
|
||||||
|
Use the following functions to retrieve [Boundary](https://carto.com/docs/carto-engine/data/overview/#boundary-data) data. Data ranges from small areas (e.g. US Census Block Groups) to large areas (e.g. Countries). You can access boundaries by point location lookup, bounding box lookup, direct ID access and several other methods described below.
|
||||||
|
|
||||||
|
You can [access](https://carto.com/docs/carto-engine/data/accessing) boundaries through CARTO Builder. The same methods will work if you are using the CARTO Engine to develop your application. We [encourage you](https://carto.com/docs/carto-engine/data/accessing/#best-practices) to use table modifying methods (UPDATE and INSERT) over dynamic methods (SELECT).
|
||||||
|
|
||||||
|
### OBS_GetBoundariesByGeometry(geom geometry, geometry_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundariesByGeometry(geometry, geometry_id)``` method returns a set of boundary geometries that intersect a supplied geometry. This can be used to find all boundaries that are within or overlap a bounding box. You have the ability to choose whether to retrieve all boundaries that intersect your supplied bounding box or only those that fall entirely inside of your bounding box.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
geom | a WGS84 geometry
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from ('NULL' (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a boundary geometry (e.g., US Census tract boundaries)
|
||||||
|
geom_refs | a string identifier for the geometry (e.g., geoids of US Census tracts)
|
||||||
|
|
||||||
|
If geometries are not found for the requested `geom`, `geometry_id`, `timespan`, or `overlap_type`, then null values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert all Census Tracts from Lower Manhattan and nearby areas within the supplied bounding box to a table named `manhattan_census_tracts` which has columns `the_geom` (geometry) and `geom_refs` (text).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO manhattan_census_tracts(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetBoundariesByGeometry(
|
||||||
|
ST_MakeEnvelope(-74.0251922607,40.6945658517,
|
||||||
|
-73.9651107788,40.7377626342,
|
||||||
|
4326),
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If an `overlap_type` other than the valid ones listed above is entered, then an error is thrown
|
||||||
|
|
||||||
|
## OBS_GetPointsByGeometry(polygon geometry, geometry_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetPointsByGeometry(polygon, geometry_id)``` method returns point geometries and their geographical identifiers that intersect (or are contained by) a bounding box polygon and lie on the surface of a boundary corresponding to the boundary with same geographical identifiers (e.g., a point that is on a census tract with the same geoid). This is a useful alternative to ```OBS_GetBoundariesByGeometry``` listed above because it returns much less data for each location.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
polygon | a bounding box or other geometry
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a point geometry on a boundary (e.g., a point that lies on a US Census tract)
|
||||||
|
geom_refs| a string identifier for the geometry (e.g., the geoid of a US Census tract)
|
||||||
|
|
||||||
|
If geometries are not found for the requested geometry, `geometry_id`, `timespan`, or `overlap_type`, then NULL values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert points that lie on Census Tracts from Lower Manhattan and nearby areas within the supplied bounding box to a table named `manhattan_tract_points` which has columns `the_geom` (geometry) and `geom_refs` (text).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO manhattan_tract_points (the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetPointsByGeometry(
|
||||||
|
ST_MakeEnvelope(-74.0251922607,40.6945658517,
|
||||||
|
-73.9651107788,40.7377626342,
|
||||||
|
4326),
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed as the first argument, an error is thrown: `Invalid geometry type (ST_Point), expecting 'ST_MultiPolygon' or 'ST_Polygon'`
|
||||||
|
|
||||||
|
### OBS_GetBoundary(point_geometry, boundary_id)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundary(point_geometry, boundary_id)``` method returns a boundary geometry defined as overlapping the point geometry and from the desired boundary set (e.g. Census Tracts). See the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids). This is a useful method for performing aggregations of points.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
point_geometry | a WGS84 polygon geometry (the_geom)
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids)
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A boundary geometry. If no value is found at the requested `boundary_id` or `timespan`, a null value is returned.
|
||||||
|
|
||||||
|
Value | Description
|
||||||
|
--- | ---
|
||||||
|
geom | WKB geometry
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Overwrite a point geometry with a boundary geometry that contains it in your table
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET the_geom = OBS_GetBoundary(the_geom, 'us.census.tiger.block_group')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown: `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
|
|
||||||
|
### OBS_GetBoundaryId(point_geometry, boundary_id)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundaryId(point_geometry, boundary_id)``` returns a unique geometry_id for the boundary geometry that contains a given point geometry. See the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids). The method can be combined with ```OBS_GetBoundaryById(geometry_id)``` to create a point aggregation workflow.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point_geometry | a WGS84 point geometry (the_geom)
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids)
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TEXT boundary geometry id. If no value is found at the requested `boundary_id` or `timespan`, a null value is returned.
|
||||||
|
|
||||||
|
Value | Description
|
||||||
|
--- | ---
|
||||||
|
geometry_id | a string identifier of a geometry in the Boundaries
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Write the US Census block group geoid that contains the point geometry for every row as a new column in your table.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
UPDATE tablename
|
||||||
|
SET geometry_id = OBS_GetBoundaryId(the_geom, 'us.census.tiger.block_group')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown: `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
|
|
||||||
|
### OBS_GetBoundaryById(geometry_id, boundary_id)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundaryById(geometry_id, boundary_id)``` returns the boundary geometry for a unique geometry_id. A geometry_id can be found using the ```OBS_GetBoundaryId(point_geometry, boundary_id)``` method described above.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
geometry_id | a string identifier for a Boundary geometry
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary](https://carto.com/docs/carto-engine/data/glossary/#boundary-ids)
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A boundary geometry. If a geometry is not found for the requested `geometry_id`, `boundary_id`, or `timespan`, then a null value is returned.
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
geom | a WGS84 polygon geometry
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Use a table of `geometry_id`s (e.g., geoid from the U.S. Census) to select the unique boundaries that they correspond to and insert into a table called, `overlapping_polygons`. This is a useful method for creating new choropleths of aggregate data.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO overlapping_polygons (the_geom, geometry_id, point_count)
|
||||||
|
SELECT
|
||||||
|
OBS_GetBoundaryById(geometry_id, 'us.census.tiger.county') As the_geom,
|
||||||
|
geometry_id,
|
||||||
|
count(*)
|
||||||
|
FROM tablename
|
||||||
|
GROUP BY geometry_id
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetBoundariesByPointAndRadius(point geometry, radius numeric, boundary_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetBoundariesByPointAndRadius(point, radius, boundary_id)``` method returns boundary geometries and their geographical identifiers that intersect (or are contained by) a circle centered on a point with a radius.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry
|
||||||
|
radius | a radius (in meters) from the center point
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a boundary geometry (e.g., a US Census tract)
|
||||||
|
geom_refs| a string identifier for the geometry (e.g., the geoid of a US Census tract)
|
||||||
|
|
||||||
|
If geometries are not found for the requested point and radius, `geometry_id`, `timespan`, or `overlap_type`, then null values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert into table `denver_census_tracts` the census tract boundaries and geom_refs of census tracts which intersect within 10 miles of downtown Denver, Colorado.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO denver_census_tracts(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetBoundariesByPointAndRadius(
|
||||||
|
CDB_LatLng(39.7392, -104.9903), -- Denver, Colorado
|
||||||
|
10000 * 1.609, -- 10 miles (10km * conversion to miles)
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown. E.g., `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
|
|
||||||
|
### OBS_GetPointsByPointAndRadius(point geometry, radius numeric, boundary_id text)
|
||||||
|
|
||||||
|
The ```OBS_GetPointsByPointAndRadius(point, radius, boundary_id)``` method returns point geometries on boundaries (e.g., a point that lies on a Census tract) and their geographical identifiers that intersect (or are contained by) a circle centered on a point with a radius.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name |Description
|
||||||
|
--- | ---
|
||||||
|
point | a WGS84 point geometry
|
||||||
|
radius | radius (in meters)
|
||||||
|
geometry_id | a string identifier for a boundary geometry
|
||||||
|
timespan (optional) | year(s) to request from (`NULL` (default) gives most recent)
|
||||||
|
overlap_type (optional) | one of '[intersects](http://postgis.net/docs/manual-2.2/ST_Intersects.html)' (default), '[contains](http://postgis.net/docs/manual-2.2/ST_Contains.html)', or '[within](http://postgis.net/docs/manual-2.2/ST_Within.html)'.
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A table with the following columns:
|
||||||
|
|
||||||
|
Column Name | Description
|
||||||
|
--- | ---
|
||||||
|
the_geom | a point geometry (e.g., a point on a US Census tract)
|
||||||
|
geom_refs | a string identifier for the geometry (e.g., the geoid of a US Census tract)
|
||||||
|
|
||||||
|
If geometries are not found for the requested point and radius, `geometry_id`, `timespan`, or `overlap_type`, then null values are returned.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
Insert into table `denver_tract_points` points on US census tracts and their corresponding geoids for census tracts which intersect within 10 miles of downtown Denver, Colorado, USA.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
INSERT INTO denver_tract_points(the_geom, geom_refs)
|
||||||
|
SELECT *
|
||||||
|
FROM OBS_GetPointsByPointAndRadius(
|
||||||
|
CDB_LatLng(39.7392, -104.9903), -- Denver, Colorado
|
||||||
|
10000 * 1.609, -- 10 miles (10km * conversion to miles)
|
||||||
|
'us.census.tiger.census_tract')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Errors
|
||||||
|
|
||||||
|
* If a geometry other than a point is passed, an error is thrown. E.g., `Invalid geometry type (ST_Line), expecting 'ST_Point'`
|
||||||
@@ -0,0 +1,365 @@
|
|||||||
|
## Discovery Functions
|
||||||
|
|
||||||
|
If you are using the [discovery methods]({{ site.dataobservatory_docs}}/guides/overview/#discovery-methods) from the Data Observatory, use the following functions to retrieve [boundary]({{ site.dataobservatory_docs}}/guides/overview/#boundary-data) and [measures]({{ site.dataobservatory_docs}}/guides/overview/#measures-data) data.
|
||||||
|
|
||||||
|
### OBS_Search(search_term)
|
||||||
|
|
||||||
|
Use arbitrary text to search all available measures
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
search_term | a string to search for available measures
|
||||||
|
boundary_id | a string identifier for a boundary geometry (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
id | the unique id of the measure for use with the ```OBS_GetMeasure``` function
|
||||||
|
name | the human readable name of the measure
|
||||||
|
description | a brief description of the measure
|
||||||
|
aggregate | **sum** are raw count values, **median** are statistical medians, **average** are statistical averages, **undefined** other (e.g. an index value)
|
||||||
|
source | where the data came from (e.g. US Census Bureau)
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_Search('home value')
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetAvailableBoundaries(point_geometry)
|
||||||
|
|
||||||
|
Returns available `boundary_id`s at a given point geometry.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
point_geometry | a WGS84 point geometry (e.g. the_geom)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Description
|
||||||
|
--- | ---
|
||||||
|
boundary_id | a boundary identifier from the [Boundary ID Glossary]({{ site.dataobservatory_docs}}/guides/glossary/#boundary-ids)
|
||||||
|
description | a brief description of the boundary dataset
|
||||||
|
time_span | the timespan attached the boundary. this does not mean that the boundary is invalid outside of the timespan, but is the explicit timespan published with the geometry.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableBoundaries(CDB_LatLng(40.7, -73.9))
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetAvailableNumerators(bounds, filter_tags, denom_id, geom_id, timespan)
|
||||||
|
|
||||||
|
Return available numerators within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which some of the numerator's data must intersect with
|
||||||
|
filter_tags | Text[] | a list of filters. Only numerators for which all of these apply are returned `NULL` to ignore (optional)
|
||||||
|
denom_id | Text | the ID of a denominator to check whether the numerator is valid against. Will not reduce length of returned table, but will change values for `valid_denom` (optional)
|
||||||
|
geom_id | Text | the ID of a geometry to check whether the numerator is valid against. Will not reduce length of returned table, but will change values for `valid_geom` (optional)
|
||||||
|
timespan | Text | the ID of a timespan to check whether the numerator is valid against. Will not reduce length of returned table, but will change values for `valid_timespan` (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
numer_id | Text | The ID of the numerator
|
||||||
|
numer_name | Text | A human readable name for the numerator
|
||||||
|
numer_description | Text | Description of the numerator. Is sometimes NULL
|
||||||
|
numer_weight | Numeric | Numeric "weight" of the numerator. Ignored.
|
||||||
|
numer_license | Text | ID of the license for the numerator
|
||||||
|
numer_source | Text | ID of the source for the numerator
|
||||||
|
numer_type | Text | Postgres type of the numerator
|
||||||
|
numer_aggregate | Text | Aggregate type of the numerator. If `'SUM'`, this can be normalized by area
|
||||||
|
numer_extra | JSONB | Extra information about the numerator column. Ignored.
|
||||||
|
numer_tags | Text[] | Array of all tags applying to this numerator
|
||||||
|
valid_denom | Boolean | True if the `denom_id` argument is a valid denominator for this numerator, False otherwise
|
||||||
|
valid_geom | Boolean | True if the `geom_id` argument is a valid geometry for this numerator, False otherwise
|
||||||
|
valid_timespan | Boolean | True if the `timespan` argument is a valid timespan for this numerator, False otherwise
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326))
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle and are
|
||||||
|
employment related for the United States only.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that are available within a small rectangle and are
|
||||||
|
related to both employment and age & gender for the United States only.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states, subsection/tags.employment, subsection/tags.age_gender}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that work with US population (`us.census.acs.B01003001`)
|
||||||
|
as a denominator.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_denom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all numerators available in the timespan `2011 - 2015`.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableNumerators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetAvailableDenominators(bounds, filter_tags, numer_id, geom_id, timespan)
|
||||||
|
|
||||||
|
Return available denominators within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which some of the denominator's data must intersect with
|
||||||
|
filter_tags | Text[] | a list of filters. Only denominators for which all of these apply are returned `NULL` to ignore (optional)
|
||||||
|
numer_id | Text | the ID of a numerator to check whether the denominator is valid against. Will not reduce length of returned table, but will change values for `valid_numer` (optional)
|
||||||
|
geom_id | Text | the ID of a geometry to check whether the denominator is valid against. Will not reduce length of returned table, but will change values for `valid_geom` (optional)
|
||||||
|
timespan | Text | the ID of a timespan to check whether the denominator is valid against. Will not reduce length of returned table, but will change values for `valid_timespan` (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
denom_id | Text | The ID of the denominator
|
||||||
|
denom_name | Text | A human readable name for the denominator
|
||||||
|
denom_description | Text | Description of the denominator. Is sometimes NULL
|
||||||
|
denom_weight | Numeric | Numeric "weight" of the denominator. Ignored.
|
||||||
|
denom_license | Text | ID of the license for the denominator
|
||||||
|
denom_source | Text | ID of the source for the denominator
|
||||||
|
denom_type | Text | Postgres type of the denominator
|
||||||
|
denom_aggregate | Text | Aggregate type of the denominator. If `'SUM'`, this can be normalized by area
|
||||||
|
denom_extra | JSONB | Extra information about the denominator column. Ignored.
|
||||||
|
denom_tags | Text[] | Array of all tags applying to this denominator
|
||||||
|
valid_numer | Boolean | True if the `numer_id` argument is a valid numerator for this denominator, False otherwise
|
||||||
|
valid_geom | Boolean | True if the `geom_id` argument is a valid geometry for this denominator, False otherwise
|
||||||
|
valid_timespan | Boolean | True if the `timespan` argument is a valid timespan for this denominator, False otherwise
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all denominators that are available within a small rectangle.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators for male population (`us.census.acs.B01001002`).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01001002')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all denominators available in the timespan `2011 - 2015`.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableDenominators(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2011 - 2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
### OBS_GetAvailableGeometries(bounds, filter_tags, numer_id, denom_id, timespan, number_geometries)
|
||||||
|
|
||||||
|
Return available geometries within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which must intersect the geometry
|
||||||
|
filter_tags | Text[] | a list of filters. Only geometries for which all of these apply are returned `NULL` to ignore (optional)
|
||||||
|
numer_id | Text | the ID of a numerator to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_numer` (optional)
|
||||||
|
denom_id | Text | the ID of a denominator to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_denom` (optional)
|
||||||
|
timespan | Text | the ID of a timespan to check whether the geometry is valid against. Will not reduce length of returned table, but will change values for `valid_timespan` (optional)
|
||||||
|
number_geometries | Integer | an additional variable that is used to adjust the calculation of the [score]({{ site.dataobservatory_docs}}/guides/discovery-functions/#returns-4) (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
geom_id | Text | The ID of the geometry
|
||||||
|
geom_name | Text | A human readable name for the geometry
|
||||||
|
geom_description | Text | Description of the geometry. Is sometimes NULL
|
||||||
|
geom_weight | Numeric | Numeric "weight" of the geometry. Ignored.
|
||||||
|
geom_aggregate | Text | Aggregate type of the geometry. Ignored.
|
||||||
|
geom_license | Text | ID of the license for the geometry
|
||||||
|
geom_source | Text | ID of the source for the geometry
|
||||||
|
geom_type | Text | Postgres type of the geometry
|
||||||
|
geom_extra | JSONB | Extra information about the geometry column. Ignored.
|
||||||
|
geom_tags | Text[] | Array of all tags applying to this geometry
|
||||||
|
valid_numer | Boolean | True if the `numer_id` argument is a valid numerator for this geometry, False otherwise
|
||||||
|
valid_denom | Boolean | True if the `geom_id` argument is a valid geometry for this geometry, False otherwise
|
||||||
|
valid_timespan | Boolean | True if the `timespan` argument is a valid timespan for this geometry, False otherwise
|
||||||
|
score | Numeric | Score between 0 and 100 for this geometry, higher numbers mean that this geometry is a better choice for the passed extent
|
||||||
|
numtiles | Numeric | How many raster tiles were read for score, numgeoms, and percentfill estimates
|
||||||
|
numgeoms | Numeric | About how many of these geometries fit inside the passed extent
|
||||||
|
percentfill | Numeric | About what percentage of the passed extent is filled with these geometries
|
||||||
|
estnumgeoms | Numeric | Ignored
|
||||||
|
meanmediansize | Numeric | Ignored
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all geometries that are available within a small rectangle.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all geometries that are available within a small rectangle and are for
|
||||||
|
the United States only.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), '{section/tags.united_states}');
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all geometries that work with total population (`us.census.acs.B01003001`).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all geometries with timespan `2015`.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableGeometries(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, '2015')
|
||||||
|
WHERE valid_timespan IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
## OBS_GetAvailableTimespans(bounds, filter_tags, numer_id, denom_id, geom_id)
|
||||||
|
|
||||||
|
Return available timespans within a boundary and with the specified
|
||||||
|
`filter_tags`.
|
||||||
|
|
||||||
|
#### Arguments
|
||||||
|
|
||||||
|
Name | Type | Description
|
||||||
|
--- | --- | ---
|
||||||
|
bounds | Geometry(Geometry, 4326) | a geometry which some of the timespan's data must intersect with
|
||||||
|
filter_tags | Text[] | a list of filters. Ignore
|
||||||
|
numer_id | Text | the ID of a numerator to check whether the timespans is valid against. Will not reduce length of returned table, but will change values for `valid_numer` (optional)
|
||||||
|
denom_id | Text | the ID of a denominator to check whether the timespans is valid against. Will not reduce length of returned table, but will change values for `valid_denom` (optional)
|
||||||
|
geom_id | Text | the ID of a geometry to check whether the timespans is valid against. Will not reduce length of returned table, but will change values for `valid_geom` (optional)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
A TABLE containing the following properties
|
||||||
|
|
||||||
|
Key | Type | Description
|
||||||
|
--- | ---- | -----------
|
||||||
|
timespan_id | Text | The ID of the timespan
|
||||||
|
timespan_name | Text | A human readable name for the timespan
|
||||||
|
timespan_description | Text | Ignored
|
||||||
|
timespan_weight | Numeric | Ignored
|
||||||
|
timespan_aggregate | Text | Ignored
|
||||||
|
timespan_license | Text | Ignored
|
||||||
|
timespan_source | Text | Ignored
|
||||||
|
timespan_type | Text | Ignored
|
||||||
|
timespan_extra | JSONB | Ignored
|
||||||
|
timespan_tags | JSONB | Ignored
|
||||||
|
valid_numer | Boolean | True if the `numer_id` argument is a valid numerator for this timespan, False otherwise
|
||||||
|
valid_denom | Boolean | True if the `timespan` argument is a valid timespan for this timespan, False otherwise
|
||||||
|
valid_geom | Boolean | True if the `geom_id` argument is a valid geometry for this timespan, False otherwise
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
Obtain all timespans that are available within a small rectangle.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326));
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all timespans for total population (`us.census.acs.B01003001`).
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, 'us.census.acs.B01003001')
|
||||||
|
WHERE valid_numer IS True;
|
||||||
|
```
|
||||||
|
|
||||||
|
Obtain all timespans that work with US states (`us.census.tiger.state`)
|
||||||
|
as a geometry.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT * FROM OBS_GetAvailableTimespans(
|
||||||
|
ST_MakeEnvelope(-74, 41, -73, 40, 4326), NULL, NULL, NULL, 'us.census.tiger.state')
|
||||||
|
WHERE valid_geom IS True;
|
||||||
|
```
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
## Support Options
|
||||||
|
|
||||||
|
Feeling stuck? There are many ways to find help.
|
||||||
|
|
||||||
|
* Ask a question on [GIS StackExchange](https://gis.stackexchange.com/questions/tagged/carto) using the `CARTO` tag.
|
||||||
|
* [Report an issue](https://github.com/CartoDB/cartodb.js/issues) in Github.
|
||||||
|
* Engine Plan customers have additional access to enterprise-level support through CARTO's support representatives.
|
||||||
|
|
||||||
|
If you just want to describe an issue or share an idea, just <a class="typeform-share" href="https://cartohq.typeform.com/to/mH6RRl" data-mode="popup" target="_blank"> send your feedback</a>.
|
||||||
|
|
||||||
|
### Issues on Github
|
||||||
|
|
||||||
|
If you think you may have found a bug, or if you have a feature request that you would like to share with the CARTO.js team, please [open an issue](https://github.com/cartodb/cartodb.js/issues/new).
|
||||||
|
|
||||||
|
Before opening an issue, review the [contributing guidelines](https://github.com/CartoDB/cartodb.js/blob/develop/CONTRIBUTING.md#filling-a-ticket).
|
||||||
|
|
||||||
|
|
||||||
|
### Community support on GIS Stack Exchange
|
||||||
|
|
||||||
|
GIS Stack Exchange is the most popular community in the geospatial industry. This is a collaboratively-edited question and answer site for geospatial programmers and technicians. It is a fantastic resource for asking technical questions about developing and maintaining your application.
|
||||||
|
|
||||||
|
When posting a new question, please consider the following:
|
||||||
|
|
||||||
|
* Read the GIS Stack Exchange [help](https://gis.stackexchange.com/help) and [how to ask](https://gis.stackexchange.com/help/how-to-ask) pages for guidelines and tips about posting questions.
|
||||||
|
* Be very clear about your question in the subject. A clear explanation helps those trying to answer your question, as well as those who may be looking for information in the future.
|
||||||
|
* Be informative in your post. Details, code snippets, logs, screenshots, etc. help others to understand your problem.
|
||||||
|
* Use code that demonstrates the problem. It is very hard to debug errors without sample code to reproduce the problem.
|
||||||
|
|
||||||
|
### Engine Plan Customers
|
||||||
|
|
||||||
|
Engine Plan customers have additional support options beyond general community support. As per your account Terms of Service, you have access to enterprise-level support through CARTO's support representatives available at [enterprise-support@carto.com](mailto:enterprise-support@carto.com)
|
||||||
|
|
||||||
|
In order to speed up the resolution of your issue, provide as much information as possible (even if it is a link from community support). This allows our engineers to investigate your problem as soon as possible.
|
||||||
|
|
||||||
|
If you are not yet CARTO customer, browse our [plans & pricing](https://carto.com/pricing/) and find the right plan for you.
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
## Contribute
|
||||||
|
|
||||||
|
CARTO platform is an open-source ecosystem. You can read about the [fundamentals]({{site.fundamental_docs}}/components/) of CARTO architecture and its components.
|
||||||
|
We are more than happy to receive your contributions to the code and the documentation as well.
|
||||||
|
|
||||||
|
## Filling a ticket
|
||||||
|
|
||||||
|
If you want to open a new issue in our repository, please follow these instructions:
|
||||||
|
|
||||||
|
1. Descriptive title.
|
||||||
|
2. Write a good description, it always helps.
|
||||||
|
3. Specify the steps to reproduce the problem.
|
||||||
|
4. Try to add an example showing the problem.
|
||||||
|
|
||||||
|
## Contributing code
|
||||||
|
|
||||||
|
Best part of open source, collaborate in Data Observatory code!. We like hearing from you, so if you have any bug fixed, or a new feature ready to be merged, those are the steps you should follow:
|
||||||
|
|
||||||
|
1. Fork the repository.
|
||||||
|
2. Create a new branch in your forked repository.
|
||||||
|
3. Commit your changes. Add new tests if it is necessary.
|
||||||
|
4. Open a pull request.
|
||||||
|
5. Any of the maintainers will take a look.
|
||||||
|
6. If everything works, it will merged and released \o/.
|
||||||
|
|
||||||
|
If you want more detailed information, this [GitHub guide](https://guides.github.com/activities/contributing-to-open-source/) is a must.
|
||||||
|
|
||||||
|
## Completing documentation
|
||||||
|
|
||||||
|
Data Observatory documentation is located in ```docs/```. That folder is the content that appears in the [Developer Center](http://carto.com/developers/data-observatory/). Just follow the instructions described in [contributing code](#contributing-code) and after accepting your pull request, we will make it appear online :).
|
||||||
|
|
||||||
|
**Tip:** A convenient, easy way of proposing changes in documentation is by using the GitHub editor directly on the web. You can easily create a branch with your changes and make a PR from there.
|
||||||
|
|
||||||
|
## Submitting contributions
|
||||||
|
|
||||||
|
You will need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions).
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
## License
|
||||||
|
|
||||||
|
The Data Observatory is a collection of data sources with varying licenses and terms of use. We have endeavored to find you data that will work for the broadest set of use-cases. The following third-party data sources are used in the Data Observatory, and we have included the links to the terms governing their use.
|
||||||
|
|
||||||
|
_**Legal Note**: The Data Observatory makes use of a variety of third party data and databases (collectively, the “Data”). You acknowledge that the included Data, and the licenses and terms of use, may be amended from time to time. Whenever you use the Data, you agree to the current relevant terms or license. Some Data will require that you provide attribution to the data source. Other Data may be protected by US or international copyright laws, treaties, or conventions. The Data and associated metadata are provided 'as-is', without express or implied warranty of any kind, including, but not limited to, infringement, merchantability and fitness for a particular purpose. CartoDB is not responsible for the accuracy, completeness, timeliness or quality of the Data._
|
||||||
|
|
||||||
|
Name | Terms link
|
||||||
|
-------|---------
|
||||||
|
ACS | [https://www.usa.gov/government-works](https://www.usa.gov/government-works)
|
||||||
|
Australian Bureau of Statistics DataPacks | [https://creativecommons.org/licenses/by/2.5/au/](https://creativecommons.org/licenses/by/2.5/au/)
|
||||||
|
Bureau of Labor Statistics Quarterly Census of Employment and Wages (QCEW) | [https://www.usa.gov/government-works](https://www.usa.gov/government-works)
|
||||||
|
Censo Demográfico of the Instituto Brasileiro de Geografia e Estatística (IBGE) | Statistics are provided by the federal Institute of Applied Economic Research (IPEA), many of which are reproduced from another source. Some series are regularly updated, others are not. Licensing information is similar to CC-BY, allowing copying and reuse, but requiring attribution.<br /><br />[http://www.ipeadata.gov.br/iframe_direitouso.aspx](http://www.ipeadata.gov.br/iframe_direitouso.aspx?width=1009&height=767)
|
||||||
|
Consumer Data Research Centre | [http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/)
|
||||||
|
El Instituto Nacional de Estadística (INE) | The National Statistics Institute (INE) of Spain includes data from multiple sources. If you are re-using their data, they explicitly require that you reference them accordingly<br /><br />[http://www.ine.es/ss/Satellite?L=0&c=Page&cid=1254735849170&p=1254735849170&pagename=Ayuda%2FINELayout](http://www.ine.es/ss/Satellite?L=0&c=Page&cid=1254735849170&p=1254735849170&pagename=Ayuda%2FINELayout)
|
||||||
|
EuroGraphics EuroGlobalMap | [http://www.eurogeographics.org/content/eurogeographics-euroglobalmap-opendata](http://www.eurogeographics.org/content/eurogeographics-euroglobalmap-opendata)<br /><br />This product includes Intellectual Property from European National Mapping and Cadastral Authorities and is licensed on behalf of these by EuroGeographics. Original product is available for free at [www.eurogeographics.org](http://www.eurogeographics.org/). Terms of the license available at [http://www.eurogeographics.org/form/topographic-data-eurogeographics](http://www.eurogeographics.org/form/topographic-data-eurogeographics)
|
||||||
|
GeoNames | [http://www.geonames.org/](http://www.geonames.org/)
|
||||||
|
GeoPlanet | [https://developer.yahoo.com/geo/geoplanet/](https://developer.yahoo.com/geo/geoplanet/)
|
||||||
|
Instituto Nacional de Estadística y Geografía | The National Statistics and Geography Institute (INEGI) of Mexico requires credit be given to INEGI as an author<br /><br />[http://www.inegi.org.mx/terminos/terminos_info.aspx](http://www.inegi.org.mx/terminos/terminos_info.aspx)
|
||||||
|
National Center for Geographic Information (CNIG) | [https://www.cnig.es/propiedadIntelectual.do](https://www.cnig.es/propiedadIntelectual.do)
|
||||||
|
National Institute of Statistics and Economic Studies (INSEE) | [http://www.insee.fr/en/service/default.asp?page=rediffusion/copyright.htm](http://www.insee.fr/en/service/default.asp?page=rediffusion/copyright.htm)
|
||||||
|
Natural Earth | [http://www.naturalearthdata.com/about/terms-of-use/](http://www.naturalearthdata.com/about/terms-of-use/)
|
||||||
|
Northern Ireland Statistics and Research Agency | [https://www.nisra.gov.uk/statistics/terms-and-conditions](https://www.nisra.gov.uk/statistics/terms-and-conditions)
|
||||||
|
Office for National Statistics (ONS) | [http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/)
|
||||||
|
Quattroshapes | [https://github.com/foursquare/quattroshapes/blob/master/LICENSE.md](https://github.com/foursquare/quattroshapes/blob/master/LICENSE.md)
|
||||||
|
Scotland's Census Data Warehouse by National Records of Scotland | [https://www.nrscotland.gov.uk/copyright-and-disclaimer](https://www.nrscotland.gov.uk/copyright-and-disclaimer)
|
||||||
|
Spielman & Singleton | [https://www.openicpsr.org/openicpsr/project/100235/version/V5/view](https://www.openicpsr.org/openicpsr/project/100235/version/V5/view)
|
||||||
|
Statistics Canada Census of Population 2011 | [http://www.statcan.gc.ca/eng/reference/licence](http://www.statcan.gc.ca/eng/reference/licence)
|
||||||
|
Statistics Canada National Household Survey 2011 | [http://www.statcan.gc.ca/eng/reference/licence](http://www.statcan.gc.ca/eng/reference/licence)
|
||||||
|
TIGER | [https://www.usa.gov/government-works](https://www.usa.gov/government-works)
|
||||||
|
Who's on First | [http://whosonfirst.mapzen.com#License](http://whosonfirst.mapzen.com#License)
|
||||||
|
Zetashapes | [http://zetashapes.com/license](http://zetashapes.com/license)
|
||||||
|
Zillow Home Value Index | This data is "Aggregate Data", per the Zillow Terms of Use<br /><br />[http://www.zillow.com/corp/Terms.htm](http://www.zillow.com/corp/Terms.htm)
|
||||||
@@ -0,0 +1,866 @@
|
|||||||
|
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
|
||||||
|
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
|
\echo Use "CREATE EXTENSION observatory" to load this file. \quit
|
||||||
|
-- Version number of the extension release
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory_version()
|
||||||
|
RETURNS text AS $$
|
||||||
|
SELECT '0.0.1'::text;
|
||||||
|
$$ language 'sql' STABLE STRICT;
|
||||||
|
|
||||||
|
-- Internal identifier of the installed extension instence
|
||||||
|
-- e.g. 'dev' for current development version
|
||||||
|
CREATE OR REPLACE FUNCTION _cdb_observatory_internal_version()
|
||||||
|
RETURNS text AS $$
|
||||||
|
SELECT installed_version FROM pg_available_extensions where name='observatory' and pg_available_extensions IS NOT NULL;
|
||||||
|
$$ language 'sql' STABLE STRICT;
|
||||||
|
|
||||||
|
-- Returns the table name with geoms for the given geometry_id
|
||||||
|
-- TODO probably needs to take in the column_id array to get the relevant
|
||||||
|
-- table where there is multiple sources for a column from multiple
|
||||||
|
-- geometries.
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GeomTable(
|
||||||
|
geom geometry,
|
||||||
|
geometry_id text
|
||||||
|
)
|
||||||
|
RETURNS TEXT
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
result text;
|
||||||
|
BEGIN
|
||||||
|
EXECUTE '
|
||||||
|
SELECT tablename FROM observatory.OBS_table
|
||||||
|
WHERE id IN (
|
||||||
|
SELECT table_id
|
||||||
|
FROM observatory.OBS_table tab,
|
||||||
|
observatory.OBS_column_table coltable,
|
||||||
|
observatory.OBS_column col
|
||||||
|
WHERE type ILIKE ''geometry''
|
||||||
|
AND coltable.column_id = col.id
|
||||||
|
AND coltable.table_id = tab.id
|
||||||
|
AND col.id = $1
|
||||||
|
)
|
||||||
|
'
|
||||||
|
USING geometry_id, geom
|
||||||
|
INTO result;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- A type for use with the OBS_GetColumnData function
|
||||||
|
CREATE TYPE cdb_observatory.OBS_ColumnData AS (colname text, tablename text, aggregate text);
|
||||||
|
|
||||||
|
|
||||||
|
-- A function that gets the column data for multiple columns
|
||||||
|
-- Old: OBS_GetColumnData
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetColumnData(
|
||||||
|
geometry_id text,
|
||||||
|
column_ids text[],
|
||||||
|
timespan text
|
||||||
|
)
|
||||||
|
RETURNS cdb_observatory.OBS_ColumnData[]
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
result cdb_observatory.OBS_ColumnData[];
|
||||||
|
BEGIN
|
||||||
|
EXECUTE '
|
||||||
|
WITH geomref AS (
|
||||||
|
SELECT t.table_id id
|
||||||
|
FROM observatory.OBS_column_to_column c2c, observatory.OBS_column_table t
|
||||||
|
WHERE c2c.reltype = ''geom_ref''
|
||||||
|
AND c2c.target_id = $1
|
||||||
|
AND c2c.source_id = t.column_id
|
||||||
|
),
|
||||||
|
column_ids as (
|
||||||
|
select row_number() over () as no, a.column_id as column_id from (select unnest($2) as column_id) a
|
||||||
|
)
|
||||||
|
SELECT array_agg(ROW(colname, tablename, aggregate)::cdb_observatory.OBS_ColumnData order by column_ids.no)
|
||||||
|
FROM column_ids, observatory.OBS_column c, observatory.OBS_column_table ct, observatory.OBS_table t
|
||||||
|
WHERE column_ids.column_id = c.id
|
||||||
|
AND c.id = ct.column_id
|
||||||
|
AND t.id = ct.table_id
|
||||||
|
AND t.timespan = $3
|
||||||
|
AND t.id in (SELECT id FROM geomref)
|
||||||
|
'
|
||||||
|
USING geometry_id, column_ids, timespan
|
||||||
|
INTO result;
|
||||||
|
RETURN result;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
--Gets the column id for a census variable given a human readable version of it
|
||||||
|
-- Old: OBS_LOOKUP_CENSUS_HUMAN
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_LookupCensusHuman(
|
||||||
|
column_names text[],
|
||||||
|
-- TODO: change variable name table_name to table_id
|
||||||
|
table_name text DEFAULT '"us.census.acs".extract_block_group_5yr_2013_69b156927c'
|
||||||
|
)
|
||||||
|
RETURNS text[] as $$
|
||||||
|
DECLARE
|
||||||
|
column_id text;
|
||||||
|
result text;
|
||||||
|
BEGIN
|
||||||
|
EXECUTE format('
|
||||||
|
WITH col_names AS (
|
||||||
|
select row_number() over() as no, a.column_name as column_name from(
|
||||||
|
select unnest($1) as column_name
|
||||||
|
) a
|
||||||
|
)
|
||||||
|
select array_agg(column_id order by col_names.no)
|
||||||
|
FROM observatory.OBS_column_table,col_names
|
||||||
|
where colname = col_names.column_name
|
||||||
|
and table_id = %L limit 1
|
||||||
|
', table_name)
|
||||||
|
INTO result
|
||||||
|
using column_names;
|
||||||
|
RETURN result;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
--Test point cause Stuart always seems to make random points in the water
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._TestPoint()
|
||||||
|
RETURNS geometry
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
-- new york city
|
||||||
|
RETURN CDB_LatLng(40.704512, -73.936669);
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
--Test polygon cause Stuart always seems to make random points in the water
|
||||||
|
-- TODO: remove as it's not used anywhere?
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._TestArea()
|
||||||
|
RETURNS geometry
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
-- Buffer NYC point by 500 meters
|
||||||
|
RETURN ST_Buffer(cdb_observatory._TestPoint()::geography, 500)::geometry;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
--Used to expand a column based response to a table based one. Give it the desired
|
||||||
|
--columns and it will return a partial query for rolling them out to a table.
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_BuildSnapshotQuery(names text[])
|
||||||
|
RETURNS TEXT
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
q text;
|
||||||
|
i numeric;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
q := 'SELECT ';
|
||||||
|
|
||||||
|
FOR i IN 1..array_upper(names,1)
|
||||||
|
LOOP
|
||||||
|
q = q || format(' vals[%s] As %I', i, names[i]);
|
||||||
|
IF i < array_upper(names, 1) THEN
|
||||||
|
q= q || ',';
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
RETURN q;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
--For Longer term Dev
|
||||||
|
|
||||||
|
|
||||||
|
--Break out table definitions to types
|
||||||
|
--Automate type creation from a script, something like
|
||||||
|
----CREATE OR REPLACE FUNCTION OBS_Get<%=tag_name%>(geom GEOMETRY)
|
||||||
|
----RETURNS TABLE(
|
||||||
|
----<%=get_dimensions_for_tag(tag_name)%>
|
||||||
|
----AS $$
|
||||||
|
----DECLARE
|
||||||
|
----target_cols text[];
|
||||||
|
----names text[];
|
||||||
|
----vals NUMERIC[];-
|
||||||
|
----q text;
|
||||||
|
----BEGIN
|
||||||
|
----target_cols := Array[<%=get_dimensions_for_tag(tag_name)%>],
|
||||||
|
|
||||||
|
|
||||||
|
--Functions for augmenting specific tables
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- Creates a table of demographic snapshot
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetDemographicSnapshot(geom geometry, time_span text default '2009 - 2013', geometry_level text default '"us.census.tiger".block_group')
|
||||||
|
RETURNS json
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
RETURN row_to_json(cdb_observatory._OBS_GetDemographicSnapshot(geom, time_span, geometry_level));
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetDemographicSnapshot(geom geometry, time_span text default '2009 - 2013', geometry_level text default '"us.census.tiger".block_group' )
|
||||||
|
RETURNS TABLE(
|
||||||
|
total_pop NUMERIC,
|
||||||
|
male_pop NUMERIC,
|
||||||
|
female_pop NUMERIC,
|
||||||
|
median_age NUMERIC,
|
||||||
|
white_pop NUMERIC,
|
||||||
|
black_pop NUMERIC,
|
||||||
|
asian_pop NUMERIC,
|
||||||
|
hispanic_pop NUMERIC,
|
||||||
|
amerindian_pop NUMERIC,
|
||||||
|
other_race_pop NUMERIC,
|
||||||
|
two_or_more_races_pop NUMERIC,
|
||||||
|
not_hispanic_pop NUMERIC,
|
||||||
|
--not_us_citizen_pop NUMERIC,
|
||||||
|
--workers_16_and_over NUMERIC,
|
||||||
|
--commuters_by_car_truck_van NUMERIC,
|
||||||
|
--commuters_drove_alone NUMERIC,
|
||||||
|
--commuters_by_carpool NUMERIC,
|
||||||
|
--commuters_by_public_transportation NUMERIC,
|
||||||
|
--commuters_by_bus NUMERIC,
|
||||||
|
--commuters_by_subway_or_elevated NUMERIC,
|
||||||
|
--walked_to_work NUMERIC,
|
||||||
|
--worked_at_home NUMERIC,
|
||||||
|
--children NUMERIC, -- TODO we should be able to get this at BG
|
||||||
|
households NUMERIC,
|
||||||
|
--population_3_years_over NUMERIC,
|
||||||
|
--in_school NUMERIC,
|
||||||
|
--in_grades_1_to_4 NUMERIC,
|
||||||
|
--in_grades_5_to_8 NUMERIC,
|
||||||
|
--in_grades_9_to_12 NUMERIC,
|
||||||
|
--in_undergrad_college NUMERIC,
|
||||||
|
pop_25_years_over NUMERIC,
|
||||||
|
high_school_diploma NUMERIC,
|
||||||
|
less_one_year_college NUMERIC,
|
||||||
|
one_year_more_college NUMERIC,
|
||||||
|
associates_degree NUMERIC,
|
||||||
|
bachelors_degree NUMERIC,
|
||||||
|
masters_degree NUMERIC,
|
||||||
|
--pop_5_years_over NUMERIC,
|
||||||
|
--speak_only_english_at_home NUMERIC,
|
||||||
|
--speak_spanish_at_home NUMERIC,
|
||||||
|
--pop_determined_poverty_status NUMERIC,
|
||||||
|
--poverty NUMERIC,
|
||||||
|
median_income NUMERIC,
|
||||||
|
gini_index NUMERIC,
|
||||||
|
income_per_capita NUMERIC,
|
||||||
|
housing_units NUMERIC,
|
||||||
|
vacant_housing_units NUMERIC,
|
||||||
|
vacant_housing_units_for_rent NUMERIC,
|
||||||
|
vacant_housing_units_for_sale NUMERIC,
|
||||||
|
median_rent NUMERIC,
|
||||||
|
percent_income_spent_on_rent NUMERIC,
|
||||||
|
owner_occupied_housing_units NUMERIC,
|
||||||
|
million_dollar_housing_units NUMERIC,
|
||||||
|
mortgaged_housing_units NUMERIC,
|
||||||
|
--pop_15_and_over NUMERIC,
|
||||||
|
--pop_never_married NUMERIC,
|
||||||
|
--pop_now_married NUMERIC,
|
||||||
|
--pop_separated NUMERIC,
|
||||||
|
--pop_widowed NUMERIC,
|
||||||
|
--pop_divorced NUMERIC,
|
||||||
|
commuters_16_over NUMERIC,
|
||||||
|
commute_less_10_mins NUMERIC,
|
||||||
|
commute_10_14_mins NUMERIC,
|
||||||
|
commute_15_19_mins NUMERIC,
|
||||||
|
commute_20_24_mins NUMERIC,
|
||||||
|
commute_25_29_mins NUMERIC,
|
||||||
|
commute_30_34_mins NUMERIC,
|
||||||
|
commute_35_44_mins NUMERIC,
|
||||||
|
commute_45_59_mins NUMERIC,
|
||||||
|
commute_60_more_mins NUMERIC,
|
||||||
|
aggregate_travel_time_to_work NUMERIC,
|
||||||
|
income_less_10000 NUMERIC,
|
||||||
|
income_10000_14999 NUMERIC,
|
||||||
|
income_15000_19999 NUMERIC,
|
||||||
|
income_20000_24999 NUMERIC,
|
||||||
|
income_25000_29999 NUMERIC,
|
||||||
|
income_30000_34999 NUMERIC,
|
||||||
|
income_35000_39999 NUMERIC,
|
||||||
|
income_40000_44999 NUMERIC,
|
||||||
|
income_45000_49999 NUMERIC,
|
||||||
|
income_50000_59999 NUMERIC,
|
||||||
|
income_60000_74999 NUMERIC,
|
||||||
|
income_75000_99999 NUMERIC,
|
||||||
|
income_100000_124999 NUMERIC,
|
||||||
|
income_125000_149999 NUMERIC,
|
||||||
|
income_150000_199999 NUMERIC,
|
||||||
|
income_200000_or_more NUMERIC,
|
||||||
|
land_area NUMERIC)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
target_cols text[];
|
||||||
|
names text[];
|
||||||
|
vals NUMERIC[];
|
||||||
|
q text;
|
||||||
|
BEGIN
|
||||||
|
target_cols := Array['total_pop',
|
||||||
|
'male_pop',
|
||||||
|
'female_pop',
|
||||||
|
'median_age',
|
||||||
|
'white_pop',
|
||||||
|
'black_pop',
|
||||||
|
'asian_pop',
|
||||||
|
'hispanic_pop',
|
||||||
|
'amerindian_pop',
|
||||||
|
'other_race_pop',
|
||||||
|
'two_or_more_races_pop',
|
||||||
|
'not_hispanic_pop',
|
||||||
|
--'not_us_citizen_pop',
|
||||||
|
--'workers_16_and_over',
|
||||||
|
--'commuters_by_car_truck_van',
|
||||||
|
--'commuters_drove_alone',
|
||||||
|
--'commuters_by_carpool',
|
||||||
|
--'commuters_by_public_transportation',
|
||||||
|
--'commuters_by_bus',
|
||||||
|
--'commuters_by_subway_or_elevated',
|
||||||
|
--'walked_to_work',
|
||||||
|
--'worked_at_home',
|
||||||
|
--'children',
|
||||||
|
'households',
|
||||||
|
--'population_3_years_over',
|
||||||
|
--'in_school',
|
||||||
|
--'in_grades_1_to_4',
|
||||||
|
--'in_grades_5_to_8',
|
||||||
|
--'in_grades_9_to_12',
|
||||||
|
--'in_undergrad_college',
|
||||||
|
'pop_25_years_over',
|
||||||
|
'high_school_diploma',
|
||||||
|
'less_one_year_college',
|
||||||
|
'one_year_more_college',
|
||||||
|
'associates_degree',
|
||||||
|
'bachelors_degree',
|
||||||
|
'masters_degree',
|
||||||
|
--'pop_5_years_over',
|
||||||
|
--'speak_only_english_at_home',
|
||||||
|
--'speak_spanish_at_home',
|
||||||
|
--'pop_determined_poverty_status',
|
||||||
|
--'poverty',
|
||||||
|
'median_income',
|
||||||
|
'gini_index',
|
||||||
|
'income_per_capita',
|
||||||
|
'housing_units',
|
||||||
|
'vacant_housing_units',
|
||||||
|
'vacant_housing_units_for_rent',
|
||||||
|
'vacant_housing_units_for_sale',
|
||||||
|
'median_rent',
|
||||||
|
'percent_income_spent_on_rent',
|
||||||
|
'owner_occupied_housing_units',
|
||||||
|
'million_dollar_housing_units',
|
||||||
|
'mortgaged_housing_units',
|
||||||
|
--'pop_15_and_over',
|
||||||
|
--'pop_never_married',
|
||||||
|
--'pop_now_married',
|
||||||
|
--'pop_separated',
|
||||||
|
--'pop_widowed',
|
||||||
|
--'pop_divorced',
|
||||||
|
'commuters_16_over',
|
||||||
|
'commute_less_10_mins',
|
||||||
|
'commute_10_14_mins',
|
||||||
|
'commute_15_19_mins',
|
||||||
|
'commute_20_24_mins',
|
||||||
|
'commute_25_29_mins',
|
||||||
|
'commute_30_34_mins',
|
||||||
|
'commute_35_44_mins',
|
||||||
|
'commute_45_59_mins',
|
||||||
|
'commute_60_more_mins',
|
||||||
|
'aggregate_travel_time_to_work',
|
||||||
|
'income_less_10000',
|
||||||
|
'income_10000_14999',
|
||||||
|
'income_15000_19999',
|
||||||
|
'income_20000_24999',
|
||||||
|
'income_25000_29999',
|
||||||
|
'income_30000_34999',
|
||||||
|
'income_35000_39999',
|
||||||
|
'income_40000_44999',
|
||||||
|
'income_45000_49999',
|
||||||
|
'income_50000_59999',
|
||||||
|
'income_60000_74999',
|
||||||
|
'income_75000_99999',
|
||||||
|
'income_100000_124999',
|
||||||
|
'income_125000_149999',
|
||||||
|
'income_150000_199999',
|
||||||
|
'income_200000_or_more',
|
||||||
|
'land_area'];
|
||||||
|
|
||||||
|
q := 'WITH a As (
|
||||||
|
SELECT
|
||||||
|
dimension As names,
|
||||||
|
dimension_value As vals
|
||||||
|
FROM cdb_observatory._OBS_GetCensus($1,$2,$3,$4)
|
||||||
|
)' ||
|
||||||
|
cdb_observatory._OBS_BuildSnapshotQuery(target_cols) ||
|
||||||
|
' FROM a';
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
q
|
||||||
|
USING geom, target_cols, time_span, geometry_level;
|
||||||
|
|
||||||
|
RETURN;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
--Base functions for performing augmentation
|
||||||
|
----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
--Returns arrays of values for the given census dimension names for a given
|
||||||
|
--point or polygon
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetCensus(
|
||||||
|
geom geometry,
|
||||||
|
dimension_names text[],
|
||||||
|
time_span text DEFAULT '2009 - 2013',
|
||||||
|
geometry_level text DEFAULT '"us.census.tiger".block_group'
|
||||||
|
)
|
||||||
|
RETURNS TABLE(dimension text[], dimension_value NUMERIC[])
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
ids text[];
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
ids := cdb_observatory._OBS_LookupCensusHuman(dimension_names);
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
SELECT names, vals FROM cdb_observatory._OBS_Get(geom, ids, time_span, geometry_level);
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Base augmentation fucntion.
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_Get(
|
||||||
|
geom geometry,
|
||||||
|
column_ids text[],
|
||||||
|
time_span text,
|
||||||
|
geometry_level text
|
||||||
|
)
|
||||||
|
RETURNS TABLE(names text[], vals NUMERIC[])
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
results NUMERIC[];
|
||||||
|
geom_table_name text;
|
||||||
|
names text[];
|
||||||
|
query text;
|
||||||
|
data_table_info cdb_observatory.OBS_ColumnData[];
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
geom_table_name := cdb_observatory._OBS_GeomTable(geom, geometry_level);
|
||||||
|
|
||||||
|
IF geom_table_name IS NULL
|
||||||
|
THEN
|
||||||
|
RAISE NOTICE 'Point % is outside of the data region', geom;
|
||||||
|
RETURN QUERY SELECT '{}'::text[], '{}'::NUMERIC[];
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
data_table_info := cdb_observatory._OBS_GetColumnData(geometry_level,
|
||||||
|
column_ids,
|
||||||
|
time_span);
|
||||||
|
|
||||||
|
names := (SELECT array_agg((d).colname)
|
||||||
|
FROM unnest(data_table_info) As d);
|
||||||
|
|
||||||
|
IF ST_GeometryType(geom) = 'ST_Point'
|
||||||
|
THEN
|
||||||
|
results := cdb_observatory._OBS_GetPoints(geom,
|
||||||
|
geom_table_name,
|
||||||
|
data_table_info);
|
||||||
|
|
||||||
|
ELSIF ST_GeometryType(geom) IN ('ST_Polygon', 'ST_MultiPolygon')
|
||||||
|
THEN
|
||||||
|
results := cdb_observatory._OBS_GetPolygons(geom,
|
||||||
|
geom_table_name,
|
||||||
|
data_table_info);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF results IS NULL
|
||||||
|
THEN
|
||||||
|
results := Array[]::numeric[];
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN QUERY SELECT names, results;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
-- If the variable of interest is just a rate return it as such,
|
||||||
|
-- otherwise normalize it to the census block area and return that
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetPoints(
|
||||||
|
geom geometry,
|
||||||
|
geom_table_name text,
|
||||||
|
data_table_info cdb_observatory.OBS_ColumnData[]
|
||||||
|
)
|
||||||
|
RETURNS NUMERIC[]
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
result NUMERIC[];
|
||||||
|
query text;
|
||||||
|
i int;
|
||||||
|
geoid text;
|
||||||
|
area NUMERIC;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
-- TODO: does 'geoid' need to be generalized to geom_ref??
|
||||||
|
EXECUTE
|
||||||
|
format('SELECT geoid
|
||||||
|
FROM observatory.%I
|
||||||
|
WHERE ST_WITHIN($1, the_geom)',
|
||||||
|
geom_table_name)
|
||||||
|
USING geom
|
||||||
|
INTO geoid;
|
||||||
|
|
||||||
|
RAISE NOTICE 'geoid is %, geometry table is % ', geoid, geom_table_name;
|
||||||
|
|
||||||
|
EXECUTE
|
||||||
|
format('SELECT ST_Area(the_geom::geography) / (1000 * 1000)
|
||||||
|
FROM observatory.%I
|
||||||
|
WHERE geoid = %L',
|
||||||
|
geom_table_name,
|
||||||
|
geoid)
|
||||||
|
INTO area;
|
||||||
|
|
||||||
|
IF area IS NULL
|
||||||
|
THEN
|
||||||
|
RAISE NOTICE 'No geometry at %', ST_AsText(geom);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
query := 'SELECT Array[';
|
||||||
|
FOR i IN 1..array_upper(data_table_info, 1)
|
||||||
|
LOOP
|
||||||
|
IF area is NULL OR area = 0
|
||||||
|
THEN
|
||||||
|
-- give back null values
|
||||||
|
query := query || format('NULL::numeric ');
|
||||||
|
ELSIF ((data_table_info)[i]).aggregate != 'sum'
|
||||||
|
THEN
|
||||||
|
-- give back full variable
|
||||||
|
query := query || format('%I ', ((data_table_info)[i]).colname);
|
||||||
|
ELSE
|
||||||
|
-- give back variable normalized by area of geography
|
||||||
|
query := query || format('%I/%s ',
|
||||||
|
((data_table_info)[i]).colname,
|
||||||
|
area);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF i < array_upper(data_table_info, 1)
|
||||||
|
THEN
|
||||||
|
query := query || ',';
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
query := query || format(' ]::numeric[]
|
||||||
|
FROM observatory.%I
|
||||||
|
WHERE %I.geoid = %L
|
||||||
|
',
|
||||||
|
((data_table_info)[1]).tablename,
|
||||||
|
((data_table_info)[1]).tablename,
|
||||||
|
geoid
|
||||||
|
);
|
||||||
|
|
||||||
|
EXECUTE
|
||||||
|
query
|
||||||
|
INTO result
|
||||||
|
USING geom;
|
||||||
|
|
||||||
|
RETURN result;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetPolygons(
|
||||||
|
geom geometry,
|
||||||
|
geom_table_name text,
|
||||||
|
data_table_info cdb_observatory.OBS_ColumnData[]
|
||||||
|
)
|
||||||
|
RETURNS NUMERIC[]
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
result NUMERIC[];
|
||||||
|
q_select text;
|
||||||
|
q_sum text;
|
||||||
|
q text;
|
||||||
|
i NUMERIC;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
q_select := 'SELECT geoid, ';
|
||||||
|
q_sum := 'SELECT Array[';
|
||||||
|
|
||||||
|
FOR i IN 1..array_upper(data_table_info, 1)
|
||||||
|
LOOP
|
||||||
|
q_select := q_select || format( '%I ', ((data_table_info)[i]).colname);
|
||||||
|
|
||||||
|
IF ((data_table_info)[i]).aggregate ='sum'
|
||||||
|
THEN
|
||||||
|
q_sum := q_sum || format('sum(overlap_fraction * COALESCE(%I, 0)) ',((data_table_info)[i]).colname,((data_table_info)[i]).colname);
|
||||||
|
ELSE
|
||||||
|
q_sum := q_sum || ' NULL::numeric ';
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF i < array_upper(data_table_info,1)
|
||||||
|
THEN
|
||||||
|
q_select := q_select || format(',');
|
||||||
|
q_sum := q_sum || format(',');
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
q = format('
|
||||||
|
WITH _overlaps As (
|
||||||
|
SELECT ST_Area(
|
||||||
|
ST_Intersection($1, a.the_geom)
|
||||||
|
) / ST_Area(a.the_geom) As overlap_fraction,
|
||||||
|
geoid
|
||||||
|
FROM observatory.%I As a
|
||||||
|
WHERE $1 && a.the_geom
|
||||||
|
),
|
||||||
|
values As (
|
||||||
|
', geom_table_name);
|
||||||
|
|
||||||
|
q := q || q_select || format('FROM observatory.%I ', ((data_table_info)[1].tablename));
|
||||||
|
|
||||||
|
q := q || ' ) ' || q_sum || ' ]::numeric[] FROM _overlaps, values
|
||||||
|
WHERE values.geoid = _overlaps.geoid';
|
||||||
|
|
||||||
|
EXECUTE
|
||||||
|
q
|
||||||
|
INTO result
|
||||||
|
USING geom;
|
||||||
|
|
||||||
|
RETURN result;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION OBS_GetSegmentSnapshot(geom geometry, geometry_level text default '"us.census.tiger".census_tract')
|
||||||
|
RETURNS json
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
RETURN row_to_json(cdb_observatory._OBS_GetSegmentSnapshot(geom, geometry_level));
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION _OBS_GetSegmentSnapshot(
|
||||||
|
geom geometry,
|
||||||
|
geometry_level text DEFAULT '"us.census.tiger".census_tract'
|
||||||
|
)
|
||||||
|
RETURNS TABLE(
|
||||||
|
segment_name TEXT,
|
||||||
|
total_pop_quantile NUMERIC,
|
||||||
|
male_pop_quantile NUMERIC,
|
||||||
|
female_pop_quantile NUMERIC,
|
||||||
|
median_age_quantile NUMERIC,
|
||||||
|
white_pop_quantile NUMERIC,
|
||||||
|
black_pop_quantile NUMERIC,
|
||||||
|
asian_pop_quantile NUMERIC,
|
||||||
|
hispanic_pop_quantile NUMERIC,
|
||||||
|
not_us_citizen_pop_quantile NUMERIC,
|
||||||
|
workers_16_and_over_quantile NUMERIC,
|
||||||
|
commuters_by_car_truck_van_quantile NUMERIC,
|
||||||
|
commuters_by_public_transportation_quantile NUMERIC,
|
||||||
|
commuters_by_bus_quantile NUMERIC,
|
||||||
|
commuters_by_subway_or_elevated_quantile NUMERIC,
|
||||||
|
walked_to_work_quantile NUMERIC,
|
||||||
|
worked_at_home_quantile NUMERIC,
|
||||||
|
children_quantile NUMERIC,
|
||||||
|
households_quantile NUMERIC,
|
||||||
|
population_3_years_over_quantile NUMERIC,
|
||||||
|
in_school_quantile NUMERIC,
|
||||||
|
in_grades_1_to_4_quantile NUMERIC,
|
||||||
|
in_grades_5_to_8_quantile NUMERIC,
|
||||||
|
in_grades_9_to_12_quantile NUMERIC,
|
||||||
|
in_undergrad_college_quantile NUMERIC,
|
||||||
|
pop_25_years_over_quantile NUMERIC,
|
||||||
|
high_school_diploma_quantile NUMERIC,
|
||||||
|
bachelors_degree_quantile NUMERIC,
|
||||||
|
masters_degree_quantile NUMERIC,
|
||||||
|
pop_5_years_over_quantile NUMERIC,
|
||||||
|
speak_only_english_at_home_quantile NUMERIC,
|
||||||
|
speak_spanish_at_home_quantile NUMERIC,
|
||||||
|
pop_determined_poverty_status_quantile NUMERIC,
|
||||||
|
poverty_quantile NUMERIC,
|
||||||
|
median_income_quantile NUMERIC,
|
||||||
|
gini_index_quantile NUMERIC,
|
||||||
|
income_per_capita_quantile NUMERIC,
|
||||||
|
housing_units_quantile NUMERIC,
|
||||||
|
vacant_housing_units_quantile NUMERIC,
|
||||||
|
vacant_housing_units_for_rent_quantile NUMERIC,
|
||||||
|
vacant_housing_units_for_sale_quantile NUMERIC,
|
||||||
|
median_rent_quantile NUMERIC,
|
||||||
|
percent_income_spent_on_rent_quantile NUMERIC,
|
||||||
|
owner_occupied_housing_units_quantile NUMERIC,
|
||||||
|
million_dollar_housing_units_quantile NUMERIC
|
||||||
|
)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
target_cols text[];
|
||||||
|
seg_name Text;
|
||||||
|
geom_id Text;
|
||||||
|
q Text;
|
||||||
|
BEGIN
|
||||||
|
target_cols := Array[
|
||||||
|
'"us.census.acs".B01001001_quantile',
|
||||||
|
'"us.census.acs".B01001002_quantile',
|
||||||
|
'"us.census.acs".B01001026_quantile',
|
||||||
|
'"us.census.acs".B01002001_quantile',
|
||||||
|
'"us.census.acs".B03002003_quantile',
|
||||||
|
'"us.census.acs".B03002004_quantile',
|
||||||
|
'"us.census.acs".B03002006_quantile',
|
||||||
|
'"us.census.acs".B03002012_quantile',
|
||||||
|
'"us.census.acs".B05001006_quantile',--
|
||||||
|
'"us.census.acs".B08006001_quantile',--
|
||||||
|
'"us.census.acs".B08006002_quantile',--
|
||||||
|
'"us.census.acs".B08006008_quantile',--
|
||||||
|
'"us.census.acs".B08006009_quantile',--
|
||||||
|
'"us.census.acs".B08006011_quantile',--
|
||||||
|
'"us.census.acs".B08006015_quantile',--
|
||||||
|
'"us.census.acs".B08006017_quantile',--
|
||||||
|
'"us.census.acs".B09001001_quantile',--
|
||||||
|
'"us.census.acs".B11001001_quantile',
|
||||||
|
'"us.census.acs".B14001001_quantile',--
|
||||||
|
'"us.census.acs".B14001002_quantile',--
|
||||||
|
'"us.census.acs".B14001005_quantile',--
|
||||||
|
'"us.census.acs".B14001006_quantile',--
|
||||||
|
'"us.census.acs".B14001007_quantile',--
|
||||||
|
'"us.census.acs".B14001008_quantile',--
|
||||||
|
'"us.census.acs".B15003001_quantile',
|
||||||
|
'"us.census.acs".B15003017_quantile',
|
||||||
|
'"us.census.acs".B15003022_quantile',
|
||||||
|
'"us.census.acs".B15003023_quantile',
|
||||||
|
'"us.census.acs".B16001001_quantile',--
|
||||||
|
'"us.census.acs".B16001002_quantile',--
|
||||||
|
'"us.census.acs".B16001003_quantile',--
|
||||||
|
'"us.census.acs".B17001001_quantile',--
|
||||||
|
'"us.census.acs".B17001002_quantile',--
|
||||||
|
'"us.census.acs".B19013001_quantile',
|
||||||
|
'"us.census.acs".B19083001_quantile',
|
||||||
|
'"us.census.acs".B19301001_quantile',
|
||||||
|
'"us.census.acs".B25001001_quantile',
|
||||||
|
'"us.census.acs".B25002003_quantile',
|
||||||
|
'"us.census.acs".B25004002_quantile',
|
||||||
|
'"us.census.acs".B25004004_quantile',
|
||||||
|
'"us.census.acs".B25058001_quantile',
|
||||||
|
'"us.census.acs".B25071001_quantile',
|
||||||
|
'"us.census.acs".B25075001_quantile',
|
||||||
|
'"us.census.acs".B25075025_quantile'
|
||||||
|
];
|
||||||
|
|
||||||
|
EXECUTE
|
||||||
|
$query$
|
||||||
|
SELECT (categories)[1]
|
||||||
|
FROM cdb_observatory._OBS_GetCategories(
|
||||||
|
$1,
|
||||||
|
Array['"us.census.spielman_singleton_segments".X10'],
|
||||||
|
$2)
|
||||||
|
LIMIT 1
|
||||||
|
$query$
|
||||||
|
INTO segment_name
|
||||||
|
USING geom, geometry_level;
|
||||||
|
|
||||||
|
q :=
|
||||||
|
format($query$
|
||||||
|
WITH a As (
|
||||||
|
SELECT
|
||||||
|
names As names,
|
||||||
|
vals As vals
|
||||||
|
FROM cdb_observatory._OBS_Get($1,
|
||||||
|
$2,
|
||||||
|
'2009 - 2013',
|
||||||
|
$3)
|
||||||
|
|
||||||
|
), percentiles As (
|
||||||
|
%s
|
||||||
|
FROM a)
|
||||||
|
SELECT $4, percentiles.*
|
||||||
|
FROM percentiles
|
||||||
|
$query$, cdb_observatory._OBS_BuildSnapshotQuery(target_cols));
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
q
|
||||||
|
USING geom, target_cols, geometry_level, segment_name;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
--Get categorical variables from point
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetCategories(
|
||||||
|
geom geometry,
|
||||||
|
dimension_names text[],
|
||||||
|
geometry_level text DEFAULT '"us.census.tiger".block_group',
|
||||||
|
time_span text DEFAULT '2009 - 2013'
|
||||||
|
)
|
||||||
|
RETURNS TABLE(names text[], categories text[]) as $$
|
||||||
|
DECLARE
|
||||||
|
geom_table_name text;
|
||||||
|
geoid text;
|
||||||
|
names text[];
|
||||||
|
results text[];
|
||||||
|
query text;
|
||||||
|
data_table_info cdb_observatory.OBS_ColumnData[];
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
geom_table_name := cdb_observatory._OBS_GeomTable(geom, geometry_level);
|
||||||
|
|
||||||
|
IF geom_table_name IS NULL
|
||||||
|
THEN
|
||||||
|
RAISE NOTICE 'Point % is outside of the data region', ST_AsText(geom);
|
||||||
|
RETURN QUERY SELECT '{}'::text[], '{}'::text[];
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
data_table_info := cdb_observatory._OBS_GetColumnData(geometry_level,
|
||||||
|
dimension_names,
|
||||||
|
time_span);
|
||||||
|
|
||||||
|
|
||||||
|
names := (SELECT array_agg((d).colname)
|
||||||
|
FROM unnest(data_table_info) As d);
|
||||||
|
|
||||||
|
|
||||||
|
EXECUTE
|
||||||
|
format('SELECT geoid
|
||||||
|
FROM observatory.%I
|
||||||
|
WHERE the_geom && $1',
|
||||||
|
geom_table_name)
|
||||||
|
USING geom
|
||||||
|
INTO geoid;
|
||||||
|
|
||||||
|
query := 'SELECT ARRAY[';
|
||||||
|
FOR i IN 1..array_upper(data_table_info, 1)
|
||||||
|
LOOP
|
||||||
|
query = query || format('%I ', lower(((data_table_info)[i]).colname));
|
||||||
|
IF i < array_upper(data_table_info, 1)
|
||||||
|
THEN
|
||||||
|
query := query || ',';
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
query := query || format(' ]::text[]
|
||||||
|
FROM observatory.%I
|
||||||
|
WHERE %I.geoid = %L
|
||||||
|
',
|
||||||
|
((data_table_info)[1]).tablename,
|
||||||
|
((data_table_info)[1]).tablename,
|
||||||
|
geoid
|
||||||
|
);
|
||||||
|
|
||||||
|
EXECUTE
|
||||||
|
query
|
||||||
|
INTO results
|
||||||
|
USING geom;
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
SELECT names,results
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
-- Placeholder for permission tweaks at creation time.
|
||||||
|
-- Make sure by default there are no permissions for publicuser
|
||||||
|
-- NOTE: this happens at extension creation time, as part of an implicit transaction.
|
||||||
|
-- REVOKE ALL PRIVILEGES ON SCHEMA cdb_observatory FROM PUBLIC, publicuser CASCADE;
|
||||||
|
|
||||||
|
-- Grant permissions on the schema to publicuser (but just the schema)
|
||||||
|
-- GRANT USAGE ON SCHEMA cdb_crankshaft TO publicuser;
|
||||||
|
|
||||||
|
-- Revoke execute permissions on all functions in the schema by default
|
||||||
|
-- REVOKE EXECUTE ON ALL FUNCTIONS IN SCHEMA cdb_observatory FROM PUBLIC, publicuser;
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
|
|||||||
|
comment = 'CartoDB Observatory backend extension'
|
||||||
|
default_version = '1.9.0'
|
||||||
|
requires = 'postgis'
|
||||||
|
superuser = true
|
||||||
|
schema = cdb_observatory
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
## Automatic tests and utilities
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
Python 2.7 should cover you. Virtualenv recommended.
|
||||||
|
|
||||||
|
virtualenv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
### Execution
|
||||||
|
|
||||||
|
Currently, we don't have direct access to the metadata end-to-end. This only
|
||||||
|
affects the generation of tests. As a stopgap, we have to define a connection
|
||||||
|
to the test Observatory account.
|
||||||
|
|
||||||
|
Run automated tests against a hostname:
|
||||||
|
|
||||||
|
(venv) OBS_HOSTNAME=<hostname.cartodb.com> OBS_API_KEY=<api_key> OBS_META_HOSTNAME=observatory.cartodb.com OBS_META_API_KEY= nosetests scripts/autotest.py
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker run -e PGHOST=localhost -e PGPORT=5432 -v `pwd`:/srv --entrypoint="/bin/bash" ${1} /srv/scripts/ci/run_tests_docker.sh && \
|
||||||
|
docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# echo commands
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# exit on error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
dpkg -l | grep postgresql
|
||||||
|
|
||||||
|
# Add the PDGD repository
|
||||||
|
apt-key adv --keyserver keys.gnupg.net --recv-keys 7FCC7D46ACCC4CF8
|
||||||
|
add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
# Remove those all PgSQL versions except the one we're testing
|
||||||
|
PGSQL_VERSIONS=(9.2 9.3 9.4 9.5 9.6 10)
|
||||||
|
/etc/init.d/postgresql stop # stop travis default instance
|
||||||
|
for V in "${PGSQL_VERSIONS[@]}"; do
|
||||||
|
if [ "$V" != "$PGSQL_VERSION" ]; then
|
||||||
|
apt-get -y remove --purge postgresql-${V} postgresql-client-${V} postgresql-contrib-${V} postgresql-${V}-postgis-2.3-scripts
|
||||||
|
else
|
||||||
|
apt-get -y remove --purge postgresql-${V}-postgis-2.3-scripts
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
apt-get -y autoremove
|
||||||
|
|
||||||
|
# Install PostgreSQL
|
||||||
|
apt-get -y install postgresql-${PGSQL_VERSION} postgresql-${PGSQL_VERSION}-postgis-${POSTGIS_VERSION} postgresql-server-dev-${PGSQL_VERSION} postgresql-plpython-${PGSQL_VERSION}
|
||||||
|
|
||||||
|
# Configure it to accept local connections from postgres
|
||||||
|
echo -e "# TYPE DATABASE USER ADDRESS METHOD \nlocal all postgres trust\nlocal all all trust\nhost all all 127.0.0.1/32 trust" > /etc/postgresql/${PGSQL_VERSION}/main/pg_hba.conf
|
||||||
|
|
||||||
|
# Restart PostgreSQL
|
||||||
|
/etc/init.d/postgresql restart ${PGSQL_VERSION}
|
||||||
|
|
||||||
|
dpkg -l | grep postgresql
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
/etc/init.d/postgresql start
|
||||||
|
|
||||||
|
cd /srv
|
||||||
|
|
||||||
|
make clean-all
|
||||||
|
make install
|
||||||
|
|
||||||
|
cd /srv/src/pg
|
||||||
|
|
||||||
|
make test || { cat /srv/src/pg/test/regression.diffs; false; }
|
||||||
@@ -0,0 +1,384 @@
|
|||||||
|
import os
|
||||||
|
import psycopg2
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
PGUSER = os.environ.get('PGUSER', 'postgres')
|
||||||
|
PGPASSWORD = os.environ.get('PGPASSWORD', '')
|
||||||
|
PGHOST=os.environ.get('PGHOST', 'localhost')
|
||||||
|
PGPORT=os.environ.get('PGPORT', '5432')
|
||||||
|
PGDATABASE=os.environ.get('PGDATABASE', 'postgres')
|
||||||
|
|
||||||
|
DB_CONN = psycopg2.connect('postgres://{user}:{password}@{host}:{port}/{database}'.format(
|
||||||
|
user=PGUSER,
|
||||||
|
password=PGPASSWORD,
|
||||||
|
host=PGHOST,
|
||||||
|
port=PGPORT,
|
||||||
|
database=PGDATABASE
|
||||||
|
))
|
||||||
|
CURSOR = DB_CONN.cursor()
|
||||||
|
|
||||||
|
|
||||||
|
def query(q):
|
||||||
|
'''
|
||||||
|
Query the database.
|
||||||
|
'''
|
||||||
|
try:
|
||||||
|
CURSOR.execute(q)
|
||||||
|
return CURSOR
|
||||||
|
except:
|
||||||
|
DB_CONN.rollback()
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def commit():
|
||||||
|
try:
|
||||||
|
DB_CONN.commit()
|
||||||
|
except:
|
||||||
|
DB_CONN.rollback()
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def get_tablename_query(column_id, boundary_id, timespan):
|
||||||
|
"""
|
||||||
|
given a column_id, boundary-id (us.census.tiger.block_group), and
|
||||||
|
timespan, give back the current table hash from the data observatory
|
||||||
|
"""
|
||||||
|
return """
|
||||||
|
SELECT numer_tablename, numer_geomref_colname, numer_tid,
|
||||||
|
geom_tablename, geom_geomref_colname, geom_tid
|
||||||
|
FROM observatory.obs_meta
|
||||||
|
WHERE numer_id = '{numer_id}' AND
|
||||||
|
geom_id = '{geom_id}' AND
|
||||||
|
numer_timespan = '{numer_timespan}'
|
||||||
|
""".format(numer_id=column_id,
|
||||||
|
geom_id=boundary_id,
|
||||||
|
numer_timespan=timespan)
|
||||||
|
|
||||||
|
|
||||||
|
METADATA_TABLES = ['obs_table', 'obs_column_table', 'obs_column', 'obs_column_tag',
|
||||||
|
'obs_tag', 'obs_column_to_column', 'obs_dump_version', 'obs_meta',
|
||||||
|
'obs_table_to_table', 'obs_meta_numer', 'obs_meta_denom',
|
||||||
|
'obs_meta_geom', 'obs_meta_timespan', 'obs_meta_geom_numer_timespan',
|
||||||
|
'obs_column_table_tile', 'obs_column_table_tile_simple']
|
||||||
|
|
||||||
|
FIXTURES = [
|
||||||
|
('us.census.acs.B01003001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01001002_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01001026_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01002001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002003_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002004_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002006_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002012_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B05001006_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08006001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08006002_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08301010_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08006009_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08006011_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08006015_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08006017_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B09001001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B11001001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B14001001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B14001002_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B14001005_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B14001006_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B14001007_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B14001008_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003017_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003022_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003023_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B16001001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B16001002_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B16001003_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B17001001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B17001002_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19013001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19083001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19301001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25001001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25002003_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25004002_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25004004_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25058001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25071001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25075001_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25075025_quantile', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01003001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01001002', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01001026', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01002001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002003', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002004', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002006', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002012', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002005', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002008', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002009', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002002', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B11001001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003017', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003019', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003020', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003021', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003022', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003023', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19013001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19301001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25001001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25002003', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25004002', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25004004', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25058001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25071001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25075001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25075025', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25081002', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08134001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08134002', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001002', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001003', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001004', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001005', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001006', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001007', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001008', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001009', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001010', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001011', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001012', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001013', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001014', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001015', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001016', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001017', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01001002', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01003001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01001002', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01001026', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01002001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002003', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002004', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002006', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002012', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002005', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002008', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002009', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B03002002', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B11001001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003017', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003019', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003020', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003021', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003022', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B15003023', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19013001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19083001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19301001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25001001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25002003', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25004002', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25004004', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25058001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25071001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25075001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25075025', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B25081002', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08134001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08134002', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08134008', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08134008', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B08134010', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001002', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001003', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001004', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001005', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001006', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001007', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001008', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001009', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001010', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001011', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001012', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001013', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001014', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001015', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001016', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.acs.B19001017', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.spielman_singleton_segments.X10', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.spielman_singleton_segments.X55', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.zillow.AllHomes_Zhvi', 'us.census.tiger.zcta5', '2014-01'),
|
||||||
|
('us.zillow.AllHomes_Zhvi', 'us.census.tiger.zcta5', '2016-06'),
|
||||||
|
('us.census.acs.B01003001', 'us.census.tiger.zcta5', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01003001', 'us.census.tiger.block_group', '2010 - 2014'),
|
||||||
|
('us.census.acs.B01003001', 'us.census.tiger.census_tract', '2010 - 2014'),
|
||||||
|
('us.census.tiger.place_geoname', 'us.census.tiger.place_clipped', '2015'),
|
||||||
|
('us.census.tiger.county_geoname', 'us.census.tiger.county_clipped', '2015'),
|
||||||
|
('us.census.tiger.county_geoname', 'us.census.tiger.county', '2015'),
|
||||||
|
('us.census.tiger.block_group_geoname', 'us.census.tiger.block_group', '2015'),
|
||||||
|
]
|
||||||
|
|
||||||
|
OUTFILE_PATH = os.path.join(os.path.dirname(__file__), '..',
|
||||||
|
'src/pg/test/fixtures/load_fixtures.sql')
|
||||||
|
DROPFILE_PATH = os.path.join(os.path.dirname(__file__), '..',
|
||||||
|
'src/pg/test/fixtures/drop_fixtures.sql')
|
||||||
|
|
||||||
|
def dump(cols, tablename, where=''):
|
||||||
|
|
||||||
|
with open(DROPFILE_PATH, 'a') as dropfile:
|
||||||
|
dropfile.write('DROP TABLE IF EXISTS observatory.{tablename};\n'.format(
|
||||||
|
tablename=tablename,
|
||||||
|
))
|
||||||
|
|
||||||
|
subprocess.check_call('PGPASSWORD={pgpassword} PGUSER={pguser} PGHOST={pghost} PGDATABASE={pgdb} '
|
||||||
|
'pg_dump -x --section=pre-data -t observatory.{tablename} '
|
||||||
|
' | sed "s:SET search_path.*::" '
|
||||||
|
' | sed "s:ALTER TABLE.*OWNER.*::" '
|
||||||
|
' | sed "s:SET idle_in_transaction_session_timeout.*::" '
|
||||||
|
' >> {outfile}'.format(
|
||||||
|
tablename=tablename,
|
||||||
|
outfile=OUTFILE_PATH,
|
||||||
|
pgpassword=PGPASSWORD,
|
||||||
|
pghost=PGHOST,
|
||||||
|
pgdb=PGDATABASE,
|
||||||
|
pguser=PGUSER
|
||||||
|
), shell=True)
|
||||||
|
|
||||||
|
with open(OUTFILE_PATH, 'a') as outfile:
|
||||||
|
outfile.write('COPY observatory."{}" FROM stdin WITH CSV HEADER;\n'.format(tablename))
|
||||||
|
|
||||||
|
subprocess.check_call('''
|
||||||
|
PGPASSWORD={pgpassword} psql -U {pguser} -d {pgdb} -h {pghost} -c "COPY (SELECT {cols} \
|
||||||
|
FROM observatory.{tablename} {where}) \
|
||||||
|
TO STDOUT WITH CSV HEADER" >> {outfile}'''.format(
|
||||||
|
cols=cols,
|
||||||
|
tablename=tablename,
|
||||||
|
where=where,
|
||||||
|
outfile=OUTFILE_PATH,
|
||||||
|
pgpassword=PGPASSWORD,
|
||||||
|
pghost=PGHOST,
|
||||||
|
pgdb=PGDATABASE,
|
||||||
|
pguser=PGUSER
|
||||||
|
), shell=True)
|
||||||
|
|
||||||
|
with open(OUTFILE_PATH, 'a') as outfile:
|
||||||
|
outfile.write('\\.\n\n')
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
unique_tables = set()
|
||||||
|
|
||||||
|
for f in FIXTURES:
|
||||||
|
column_id, boundary_id, timespan = f
|
||||||
|
tablename_query = get_tablename_query(column_id, boundary_id, timespan)
|
||||||
|
resp = query(tablename_query).fetchone()
|
||||||
|
if resp:
|
||||||
|
numer_tablename, numer_colname, numer_table_id = resp[0:3]
|
||||||
|
geom_tablename, geom_colname, geom_table_id = resp[3:6]
|
||||||
|
else:
|
||||||
|
raise Exception("Could not find table for {}, {}, {}".format(
|
||||||
|
column_id, boundary_id, timespan))
|
||||||
|
numer = (numer_tablename, numer_colname, numer_table_id, )
|
||||||
|
geom = (geom_tablename, geom_colname, geom_table_id, )
|
||||||
|
if numer not in unique_tables:
|
||||||
|
print(numer)
|
||||||
|
unique_tables.add(numer)
|
||||||
|
if geom not in unique_tables:
|
||||||
|
print(geom)
|
||||||
|
unique_tables.add(geom)
|
||||||
|
|
||||||
|
print unique_tables
|
||||||
|
|
||||||
|
with open(OUTFILE_PATH, 'w') as outfile:
|
||||||
|
outfile.write('SET client_min_messages TO WARNING;\n\\set ECHO none\n')
|
||||||
|
outfile.write('CREATE SCHEMA IF NOT EXISTS observatory;\n\n')
|
||||||
|
|
||||||
|
with open(DROPFILE_PATH, 'w') as dropfile:
|
||||||
|
dropfile.write('SET client_min_messages TO WARNING;\n\\set ECHO none\n')
|
||||||
|
|
||||||
|
for tablename in METADATA_TABLES:
|
||||||
|
print(tablename)
|
||||||
|
if tablename == 'obs_meta':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"(numer_id, geom_id, numer_timespan) = ('{}', '{}', '{}')".format(
|
||||||
|
numer_id, geom_id, timespan)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename == 'obs_meta_numer':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"numer_id IN ('{}', '{}')".format(numer_id, geom_id)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename == 'obs_meta_denom':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"denom_id IN ('{}', '{}')".format(numer_id, geom_id)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename == 'obs_meta_geom':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"geom_id IN ('{}', '{}')".format(numer_id, geom_id)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename == 'obs_meta_timespan':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"timespan_id = ('{}')".format(timespan)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename == 'obs_column':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"id IN ('{}', '{}')".format(numer_id, geom_id)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename == 'obs_column_tag':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"column_id IN ('{}', '{}')".format(numer_id, geom_id)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename in ('obs_column_table', 'obs_column_table_tile',
|
||||||
|
'obs_column_table_tile_simple'):
|
||||||
|
where = '''WHERE table_id IN ({table_ids}) AND
|
||||||
|
(column_id IN ({numer_ids}) OR column_id IN ({geom_ids}))
|
||||||
|
'''.format(
|
||||||
|
numer_ids=','.join(["'{}'".format(x) for x, _, _ in FIXTURES]),
|
||||||
|
geom_ids=','.join(["'{}'".format(x) for _, x, _ in FIXTURES]),
|
||||||
|
table_ids=','.join(["'{}'".format(x) for _, _, x in unique_tables])
|
||||||
|
)
|
||||||
|
elif tablename == 'obs_column_to_column':
|
||||||
|
where = "WHERE " + " OR ".join([
|
||||||
|
"source_id IN ('{}', '{}') OR target_id IN ('{}', '{}')".format(
|
||||||
|
numer_id, geom_id, numer_id, geom_id)
|
||||||
|
for numer_id, geom_id, timespan in FIXTURES
|
||||||
|
])
|
||||||
|
elif tablename == 'obs_table':
|
||||||
|
where = 'WHERE timespan IN ({timespans}) ' \
|
||||||
|
'OR id IN ({table_ids}) '.format(
|
||||||
|
timespans=','.join(["'{}'".format(x) for _, _, x in FIXTURES]),
|
||||||
|
table_ids=','.join(["'{}'".format(x) for _, _, x in unique_tables])
|
||||||
|
)
|
||||||
|
elif tablename in ('obs_table_to_table'):
|
||||||
|
where = '''WHERE source_id IN ({table_ids})'''.format(
|
||||||
|
table_ids=','.join(["'{}'".format(x) for _, _, x in unique_tables])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
where = ''
|
||||||
|
dump('*', tablename, where)
|
||||||
|
|
||||||
|
for tablename, colname, table_id in unique_tables:
|
||||||
|
if 'zcta5' in table_id or 'zillow_zip' in table_id:
|
||||||
|
where = '\'11%\''
|
||||||
|
compare = 'LIKE'
|
||||||
|
elif 'county' in table_id and 'tiger' in table_id:
|
||||||
|
where = "('48061', '36047')"
|
||||||
|
compare = 'IN'
|
||||||
|
else:
|
||||||
|
where = '\'36047%\''
|
||||||
|
compare = 'LIKE'
|
||||||
|
print ' '.join(['*', tablename, "WHERE {}::text {} {}".format(colname, compare, where)])
|
||||||
|
dump('*', tablename, "WHERE {}::text {} {}".format(colname, compare, where))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
requests
|
||||||
|
nose
|
||||||
|
nose_parameterized
|
||||||
|
psycopg2
|
||||||
+1
-1
@@ -24,7 +24,7 @@ $(DATA): $(SOURCES_DATA)
|
|||||||
$(SED) $(REPLACEMENTS) $(SOURCES_DATA_DIR)/*.sql > $@
|
$(SED) $(REPLACEMENTS) $(SOURCES_DATA_DIR)/*.sql > $@
|
||||||
|
|
||||||
TEST_DIR = test
|
TEST_DIR = test
|
||||||
REGRESS = $(notdir $(basename $(wildcard $(TEST_DIR)/sql/*test.sql)))
|
REGRESS = $(sort $(notdir $(basename $(wildcard $(TEST_DIR)/sql/*test.sql))))
|
||||||
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)'
|
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)'
|
||||||
|
|
||||||
PG_CONFIG = pg_config
|
PG_CONFIG = pg_config
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
comment = 'CartoDB Observatory backend extension'
|
comment = 'CartoDB Observatory backend extension'
|
||||||
default_version = '0.0.1'
|
default_version = '1.9.0'
|
||||||
requires = 'postgis, cartodb'
|
requires = 'postgis'
|
||||||
superuser = true
|
superuser = true
|
||||||
schema = cdb_observatory
|
schema = cdb_observatory
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,614 @@
|
|||||||
|
|
||||||
|
-- TODO: implement search for timespan
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_SearchTables(
|
||||||
|
search_term text,
|
||||||
|
time_span text DEFAULT NULL
|
||||||
|
)
|
||||||
|
RETURNS table(tablename text, timespan text)
|
||||||
|
As $$
|
||||||
|
DECLARE
|
||||||
|
out_var text[];
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
IF time_span IS NULL
|
||||||
|
THEN
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
'SELECT tablename::text, timespan::text
|
||||||
|
FROM observatory.obs_table t
|
||||||
|
JOIN observatory.obs_column_table ct
|
||||||
|
ON ct.table_id = t.id
|
||||||
|
JOIN observatory.obs_column c
|
||||||
|
ON ct.column_id = c.id
|
||||||
|
WHERE c.type ILIKE ''geometry''
|
||||||
|
AND c.id = $1'
|
||||||
|
USING search_term;
|
||||||
|
RETURN;
|
||||||
|
ELSE
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
'SELECT tablename::text, timespan::text
|
||||||
|
FROM observatory.obs_table t
|
||||||
|
JOIN observatory.obs_column_table ct
|
||||||
|
ON ct.table_id = t.id
|
||||||
|
JOIN observatory.obs_column c
|
||||||
|
ON ct.column_id = c.id
|
||||||
|
WHERE c.type ILIKE ''geometry''
|
||||||
|
AND c.id = $1
|
||||||
|
AND t.timespan = $2'
|
||||||
|
USING search_term, time_span;
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql IMMUTABLE;
|
||||||
|
|
||||||
|
-- Functions used to search the observatory for measures
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- TODO allow the user to specify the boundary to search for measures
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_Search(
|
||||||
|
search_term text,
|
||||||
|
relevant_boundary text DEFAULT null
|
||||||
|
)
|
||||||
|
RETURNS TABLE(id text, description text, name text, aggregate text, source text) as $$
|
||||||
|
DECLARE
|
||||||
|
boundary_term text;
|
||||||
|
BEGIN
|
||||||
|
IF relevant_boundary then
|
||||||
|
boundary_term = '';
|
||||||
|
else
|
||||||
|
boundary_term = '';
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE format($string$
|
||||||
|
SELECT id::text, description::text,
|
||||||
|
name::text,
|
||||||
|
aggregate::text,
|
||||||
|
NULL::TEXT source -- TODO use tags
|
||||||
|
FROM observatory.OBS_column
|
||||||
|
where name ilike '%%' || %L || '%%'
|
||||||
|
or description ilike '%%' || %L || '%%'
|
||||||
|
%s
|
||||||
|
$string$, search_term, search_term,boundary_term);
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
-- Functions to return the geometry levels that a point is part of
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- TODO add test response
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetAvailableBoundaries(
|
||||||
|
geom geometry(Geometry, 4326),
|
||||||
|
timespan text DEFAULT null)
|
||||||
|
RETURNS TABLE(boundary_id text, description text, time_span text, tablename text) as $$
|
||||||
|
DECLARE
|
||||||
|
timespan_query TEXT DEFAULT '';
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
IF timespan != NULL
|
||||||
|
THEN
|
||||||
|
timespan_query = format('AND timespan = %L', timespan);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
$string$
|
||||||
|
SELECT
|
||||||
|
column_id::text As column_id,
|
||||||
|
obs_column.description::text As description,
|
||||||
|
timespan::text As timespan,
|
||||||
|
tablename::text As tablename
|
||||||
|
FROM
|
||||||
|
observatory.OBS_table,
|
||||||
|
observatory.OBS_column_table,
|
||||||
|
observatory.OBS_column
|
||||||
|
WHERE
|
||||||
|
observatory.OBS_column_table.column_id = observatory.obs_column.id AND
|
||||||
|
observatory.OBS_column_table.table_id = observatory.obs_table.id
|
||||||
|
AND
|
||||||
|
observatory.OBS_column.type = 'Geometry'
|
||||||
|
AND
|
||||||
|
ST_Intersects($1, st_setsrid(observatory.obs_table.the_geom, 4326))
|
||||||
|
$string$ || timespan_query
|
||||||
|
USING geom;
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- Functions the interface works from to identify available numerators,
|
||||||
|
-- denominators, geometries, and timespans
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
bounds GEOMETRY DEFAULT NULL,
|
||||||
|
filter_tags TEXT[] DEFAULT NULL,
|
||||||
|
denom_id TEXT DEFAULT NULL,
|
||||||
|
geom_id TEXT DEFAULT NULL,
|
||||||
|
timespan TEXT DEFAULT NULL
|
||||||
|
) RETURNS TABLE (
|
||||||
|
numer_id TEXT,
|
||||||
|
numer_name TEXT,
|
||||||
|
numer_description TEXT,
|
||||||
|
numer_weight NUMERIC,
|
||||||
|
numer_license TEXT,
|
||||||
|
numer_source TEXT,
|
||||||
|
numer_type TEXT,
|
||||||
|
numer_aggregate TEXT,
|
||||||
|
numer_extra JSONB,
|
||||||
|
numer_tags JSONB,
|
||||||
|
valid_denom BOOLEAN,
|
||||||
|
valid_geom BOOLEAN,
|
||||||
|
valid_timespan BOOLEAN
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
geom_clause TEXT;
|
||||||
|
BEGIN
|
||||||
|
filter_tags := COALESCE(filter_tags, (ARRAY[])::TEXT[]);
|
||||||
|
denom_id := COALESCE(denom_id, '');
|
||||||
|
geom_id := COALESCE(geom_id, '');
|
||||||
|
timespan := COALESCE(timespan, '');
|
||||||
|
IF bounds IS NULL THEN
|
||||||
|
geom_clause := '';
|
||||||
|
ELSE
|
||||||
|
geom_clause := 'ST_Intersects(the_geom, $5) AND';
|
||||||
|
END IF;
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
format($string$
|
||||||
|
SELECT numer_id::TEXT,
|
||||||
|
numer_name::TEXT,
|
||||||
|
numer_description::TEXT,
|
||||||
|
numer_weight::NUMERIC,
|
||||||
|
NULL::TEXT license,
|
||||||
|
NULL::TEXT source,
|
||||||
|
numer_type numer_type,
|
||||||
|
numer_aggregate numer_aggregate,
|
||||||
|
numer_extra::JSONB numer_extra,
|
||||||
|
numer_tags numer_tags,
|
||||||
|
$1 = ANY(denoms) valid_denom,
|
||||||
|
$2 = ANY(geoms) valid_geom,
|
||||||
|
$3 = ANY(timespans) valid_timespan
|
||||||
|
FROM observatory.obs_meta_numer
|
||||||
|
WHERE %s (numer_tags ?& $4 OR CARDINALITY($4) = 0)
|
||||||
|
$string$, geom_clause)
|
||||||
|
USING denom_id, geom_id, timespan, filter_tags, bounds;
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetNumerators(
|
||||||
|
bounds GEOMETRY DEFAULT NULL,
|
||||||
|
section_tags TEXT[] DEFAULT ARRAY[]::TEXT[],
|
||||||
|
subsection_tags TEXT[] DEFAULT ARRAY[]::TEXT[],
|
||||||
|
other_tags TEXT[] DEFAULT ARRAY[]::TEXT[],
|
||||||
|
ids TEXT[] DEFAULT ARRAY[]::TEXT[],
|
||||||
|
name TEXT DEFAULT NULL,
|
||||||
|
denom_id TEXT DEFAULT '',
|
||||||
|
geom_id TEXT DEFAULT '',
|
||||||
|
timespan TEXT DEFAULT ''
|
||||||
|
) RETURNS TABLE (
|
||||||
|
numer_id TEXT,
|
||||||
|
numer_name TEXT,
|
||||||
|
numer_description TEXT,
|
||||||
|
numer_weight NUMERIC,
|
||||||
|
numer_license TEXT,
|
||||||
|
numer_source TEXT,
|
||||||
|
numer_type TEXT,
|
||||||
|
numer_aggregate TEXT,
|
||||||
|
numer_extra JSONB,
|
||||||
|
numer_tags JSONB,
|
||||||
|
valid_denom BOOLEAN,
|
||||||
|
valid_geom BOOLEAN,
|
||||||
|
valid_timespan BOOLEAN
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
where_clause_elements TEXT[];
|
||||||
|
geom_clause TEXT;
|
||||||
|
where_clause TEXT;
|
||||||
|
BEGIN
|
||||||
|
where_clause_elements := (ARRAY[])::TEXT[];
|
||||||
|
where_clause := '';
|
||||||
|
|
||||||
|
IF bounds IS NOT NULL THEN
|
||||||
|
where_clause_elements := array_append(where_clause_elements, format($data$ST_Intersects(the_geom, '%s'::geometry)$data$, bounds));
|
||||||
|
END IF;
|
||||||
|
IF cardinality(section_tags) > 0 THEN
|
||||||
|
where_clause_elements := array_append(where_clause_elements, format($data$numer_tags ?| '%s'$data$, section_tags));
|
||||||
|
END IF;
|
||||||
|
IF cardinality(subsection_tags) > 0 THEN
|
||||||
|
where_clause_elements := array_append(where_clause_elements, format($data$numer_tags ?| '%s'$data$, subsection_tags));
|
||||||
|
END IF;
|
||||||
|
IF cardinality(other_tags) > 0 THEN
|
||||||
|
where_clause_elements := array_append(where_clause_elements, format($data$numer_tags ?| '%s'$data$, other_tags));
|
||||||
|
END IF;
|
||||||
|
IF cardinality(ids) > 0 THEN
|
||||||
|
where_clause_elements := array_append(where_clause_elements, format($data$numer_id IN (array_to_string('%s'::text[], ','))$data$, ids));
|
||||||
|
END IF;
|
||||||
|
IF name IS NOT NULL AND name != '' THEN
|
||||||
|
where_clause_elements := array_append(where_clause_elements, format($data$numer_name ilike '%%%s%%'$data$, name));
|
||||||
|
END IF;
|
||||||
|
IF cardinality(where_clause_elements) > 0 THEN
|
||||||
|
where_clause := format($clause$WHERE %s$clause$, array_to_string(where_clause_elements, ' AND '));
|
||||||
|
END IF;
|
||||||
|
RAISE DEBUG '%', array_to_string(where_clause_elements, ' AND ');
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
format($string$
|
||||||
|
SELECT numer_id::TEXT,
|
||||||
|
numer_name::TEXT,
|
||||||
|
numer_description::TEXT,
|
||||||
|
numer_weight::NUMERIC,
|
||||||
|
NULL::TEXT license,
|
||||||
|
NULL::TEXT source,
|
||||||
|
numer_type numer_type,
|
||||||
|
numer_aggregate numer_aggregate,
|
||||||
|
numer_extra::JSONB numer_extra,
|
||||||
|
numer_tags numer_tags,
|
||||||
|
$1 = ANY(denoms) valid_denom,
|
||||||
|
$2 = ANY(geoms) valid_geom,
|
||||||
|
$3 = ANY(timespans) valid_timespan
|
||||||
|
FROM observatory.obs_meta_numer
|
||||||
|
%s
|
||||||
|
$string$, where_clause)
|
||||||
|
USING denom_id, geom_id, timespan;
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
bounds GEOMETRY DEFAULT NULL,
|
||||||
|
filter_tags TEXT[] DEFAULT NULL,
|
||||||
|
numer_id TEXT DEFAULT NULL,
|
||||||
|
geom_id TEXT DEFAULT NULL,
|
||||||
|
timespan TEXT DEFAULT NULL
|
||||||
|
) RETURNS TABLE (
|
||||||
|
denom_id TEXT,
|
||||||
|
denom_name TEXT,
|
||||||
|
denom_description TEXT,
|
||||||
|
denom_weight NUMERIC,
|
||||||
|
denom_license TEXT,
|
||||||
|
denom_source TEXT,
|
||||||
|
denom_type TEXT,
|
||||||
|
denom_aggregate TEXT,
|
||||||
|
denom_extra JSONB,
|
||||||
|
denom_tags JSONB,
|
||||||
|
valid_numer BOOLEAN,
|
||||||
|
valid_geom BOOLEAN,
|
||||||
|
valid_timespan BOOLEAN
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
geom_clause TEXT;
|
||||||
|
BEGIN
|
||||||
|
filter_tags := COALESCE(filter_tags, (ARRAY[])::TEXT[]);
|
||||||
|
numer_id := COALESCE(numer_id, '');
|
||||||
|
geom_id := COALESCE(geom_id, '');
|
||||||
|
timespan := COALESCE(timespan, '');
|
||||||
|
IF bounds IS NULL THEN
|
||||||
|
geom_clause := '';
|
||||||
|
ELSE
|
||||||
|
geom_clause := 'ST_Intersects(the_geom, $5) AND';
|
||||||
|
END IF;
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
format($string$
|
||||||
|
SELECT denom_id::TEXT,
|
||||||
|
denom_name::TEXT,
|
||||||
|
denom_description::TEXT,
|
||||||
|
denom_weight::NUMERIC,
|
||||||
|
NULL::TEXT license,
|
||||||
|
NULL::TEXT source,
|
||||||
|
denom_type::TEXT,
|
||||||
|
denom_aggregate::TEXT,
|
||||||
|
denom_extra::JSONB,
|
||||||
|
denom_tags::JSONB,
|
||||||
|
$1 = ANY(numers) valid_numer,
|
||||||
|
$2 = ANY(geoms) valid_geom,
|
||||||
|
$3 = ANY(timespans) valid_timespan
|
||||||
|
FROM observatory.obs_meta_denom
|
||||||
|
WHERE %s (denom_tags ?& $4 OR CARDINALITY($4) = 0)
|
||||||
|
$string$, geom_clause)
|
||||||
|
USING numer_id, geom_id, timespan, filter_tags, bounds;
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
bounds GEOMETRY DEFAULT NULL,
|
||||||
|
filter_tags TEXT[] DEFAULT NULL,
|
||||||
|
numer_id TEXT DEFAULT NULL,
|
||||||
|
denom_id TEXT DEFAULT NULL,
|
||||||
|
timespan TEXT DEFAULT NULL,
|
||||||
|
number_geoms INTEGER DEFAULT NULL
|
||||||
|
) RETURNS TABLE (
|
||||||
|
geom_id TEXT,
|
||||||
|
geom_name TEXT,
|
||||||
|
geom_description TEXT,
|
||||||
|
geom_weight NUMERIC,
|
||||||
|
geom_aggregate TEXT,
|
||||||
|
geom_license TEXT,
|
||||||
|
geom_source TEXT,
|
||||||
|
geom_type TEXT,
|
||||||
|
geom_extra JSONB,
|
||||||
|
geom_tags JSONB,
|
||||||
|
valid_numer BOOLEAN,
|
||||||
|
valid_denom BOOLEAN,
|
||||||
|
valid_timespan BOOLEAN,
|
||||||
|
score NUMERIC,
|
||||||
|
numtiles BIGINT,
|
||||||
|
notnull_percent NUMERIC,
|
||||||
|
numgeoms NUMERIC,
|
||||||
|
percentfill NUMERIC,
|
||||||
|
estnumgeoms NUMERIC,
|
||||||
|
meanmediansize NUMERIC
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
geom_clause TEXT;
|
||||||
|
BEGIN
|
||||||
|
filter_tags := COALESCE(filter_tags, (ARRAY[])::TEXT[]);
|
||||||
|
numer_id := COALESCE(numer_id, '');
|
||||||
|
denom_id := COALESCE(denom_id, '');
|
||||||
|
timespan := COALESCE(timespan, '');
|
||||||
|
IF bounds IS NULL THEN
|
||||||
|
geom_clause := '';
|
||||||
|
ELSE
|
||||||
|
geom_clause := 'ST_Intersects(the_geom, $5) AND';
|
||||||
|
END IF;
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
format($string$
|
||||||
|
WITH available_geoms AS (
|
||||||
|
SELECT geom_id::TEXT,
|
||||||
|
geom_name::TEXT,
|
||||||
|
geom_description::TEXT,
|
||||||
|
geom_weight::NUMERIC,
|
||||||
|
NULL::TEXT geom_aggregate,
|
||||||
|
NULL::TEXT license,
|
||||||
|
NULL::TEXT source,
|
||||||
|
geom_type::TEXT,
|
||||||
|
geom_extra::JSONB,
|
||||||
|
geom_tags::JSONB,
|
||||||
|
$1 = ANY(numers) valid_numer,
|
||||||
|
$2 = ANY(denoms) valid_denom,
|
||||||
|
CASE WHEN $3 IS NOT NULL AND $3 != '' THEN
|
||||||
|
-- Here we are looking for geometries with: a) geometry timespan or b) numerators linked to that geometries that fit in the
|
||||||
|
-- timespan passed. For example it look for geometries with timespan '2015 - 2015' or numerators linked to that geometry that has
|
||||||
|
-- '2015 - 2015' as one of the valid timespans.
|
||||||
|
-- If we pass a numerator_id, we filter by that numerator
|
||||||
|
CASE WHEN $1 IS NOT NULL AND $1 != '' THEN
|
||||||
|
EXISTS (SELECT 1 FROM observatory.obs_meta_geom_numer_timespan onu WHERE o.geom_id = onu.geom_id AND onu.numer_id = $1 AND ($3 = ANY(onu.timespans) OR $3 IN (select(unnest(o.timespans)))))
|
||||||
|
ELSE
|
||||||
|
EXISTS (SELECT 1 FROM observatory.obs_meta_geom_numer_timespan onu WHERE o.geom_id = onu.geom_id AND ($3 = ANY(onu.geom_timespans) OR $3 IN (select(unnest(o.timespans)))))
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
false
|
||||||
|
END as valid_timespan
|
||||||
|
FROM observatory.obs_meta_geom o
|
||||||
|
WHERE %s (geom_tags ?& $4 OR CARDINALITY($4) = 0)
|
||||||
|
), scores AS (
|
||||||
|
SELECT * FROM cdb_observatory._OBS_GetGeometryScores(bounds => $5,
|
||||||
|
filter_geom_ids => (SELECT ARRAY_AGG(geom_id) FROM available_geoms),
|
||||||
|
desired_num_geoms => $6::integer
|
||||||
|
)
|
||||||
|
) SELECT DISTINCT ON (geom_id) available_geoms.*, score, numtiles, notnull_percent, numgeoms,
|
||||||
|
percentfill, estnumgeoms, meanmediansize
|
||||||
|
FROM available_geoms, scores
|
||||||
|
WHERE available_geoms.geom_id = scores.column_id
|
||||||
|
$string$, geom_clause)
|
||||||
|
USING numer_id, denom_id, timespan, filter_tags, bounds, number_geoms;
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
bounds GEOMETRY DEFAULT NULL,
|
||||||
|
filter_tags TEXT[] DEFAULT NULL,
|
||||||
|
numer_id TEXT DEFAULT NULL,
|
||||||
|
denom_id TEXT DEFAULT NULL,
|
||||||
|
geom_id TEXT DEFAULT NULL
|
||||||
|
) RETURNS TABLE (
|
||||||
|
timespan_id TEXT,
|
||||||
|
timespan_name TEXT,
|
||||||
|
timespan_description TEXT,
|
||||||
|
timespan_weight NUMERIC,
|
||||||
|
timespan_aggregate TEXT,
|
||||||
|
timespan_license TEXT,
|
||||||
|
timespan_source TEXT,
|
||||||
|
timespan_type TEXT,
|
||||||
|
timespan_extra JSONB,
|
||||||
|
timespan_tags JSONB,
|
||||||
|
valid_numer BOOLEAN,
|
||||||
|
valid_denom BOOLEAN,
|
||||||
|
valid_geom BOOLEAN
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
geom_clause TEXT;
|
||||||
|
BEGIN
|
||||||
|
filter_tags := COALESCE(filter_tags, (ARRAY[])::TEXT[]);
|
||||||
|
numer_id := COALESCE(numer_id, '');
|
||||||
|
denom_id := COALESCE(denom_id, '');
|
||||||
|
geom_id := COALESCE(geom_id, '');
|
||||||
|
IF bounds IS NULL THEN
|
||||||
|
geom_clause := '';
|
||||||
|
ELSE
|
||||||
|
geom_clause := 'ST_Intersects(the_geom, $5) AND';
|
||||||
|
END IF;
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE
|
||||||
|
format($string$
|
||||||
|
SELECT timespan_id::TEXT,
|
||||||
|
timespan_name::TEXT,
|
||||||
|
timespan_description::TEXT,
|
||||||
|
timespan_weight::NUMERIC,
|
||||||
|
NULL::TEXT timespan_aggregate,
|
||||||
|
NULL::TEXT timespan_license,
|
||||||
|
NULL::TEXT timespan_source,
|
||||||
|
timespan_type::TEXT,
|
||||||
|
NULL::JSONB timespan_extra,
|
||||||
|
NULL::JSONB timespan_tags,
|
||||||
|
COALESCE($1 = ANY(numers), false) valid_numer,
|
||||||
|
COALESCE($2 = ANY(denoms), false) valid_denom,
|
||||||
|
COALESCE($3 = ANY(geoms), false) valid_geom_id
|
||||||
|
FROM observatory.obs_meta_timespan
|
||||||
|
WHERE %s (timespan_tags ?& $4 OR CARDINALITY($4) = 0)
|
||||||
|
$string$, geom_clause)
|
||||||
|
USING numer_id, denom_id, geom_id, filter_tags, bounds;
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
-- Function below should replace SQL in
|
||||||
|
-- https://github.com/CartoDB/cartodb/blob/ab465cb2918c917940e955963b0cd8a050c06600/lib/assets/javascripts/cartodb3/editor/layers/layer-content-views/analyses/data-observatory-metadata.js
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_LegacyBuilderMetadata(
|
||||||
|
aggregate_type TEXT DEFAULT NULL
|
||||||
|
)
|
||||||
|
RETURNS TABLE (
|
||||||
|
name TEXT,
|
||||||
|
subsection JSONB
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
aggregate_condition TEXT DEFAULT '';
|
||||||
|
BEGIN
|
||||||
|
IF LOWER(aggregate_type) ILIKE 'sum' THEN
|
||||||
|
aggregate_condition := ' AND numer_aggregate IN (''sum'', ''median'', ''average'') ';
|
||||||
|
ELSIF aggregate_type IS NOT NULL THEN
|
||||||
|
aggregate_condition := format(' AND numer_aggregate ILIKE %L ', aggregate_type);
|
||||||
|
END IF;
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE format($string$
|
||||||
|
WITH expanded AS (
|
||||||
|
SELECT JSONB_Build_Object('id', numer_id, 'name', numer_name) "column",
|
||||||
|
SUBSTR((sections).key, 9) section_id, (sections).value section_name,
|
||||||
|
SUBSTR((subsections).key, 12) subsection_id, (subsections).value subsection_name
|
||||||
|
FROM (
|
||||||
|
SELECT numer_id, numer_name,
|
||||||
|
jsonb_each_text(numer_tags) as sections,
|
||||||
|
jsonb_each_text as subsections
|
||||||
|
FROM (SELECT numer_id, numer_name, numer_tags,
|
||||||
|
jsonb_each_text(numer_tags)
|
||||||
|
FROM cdb_observatory.obs_getavailablenumerators()
|
||||||
|
WHERE numer_weight > 0 %s
|
||||||
|
) foo
|
||||||
|
) bar
|
||||||
|
WHERE (sections).key LIKE 'section/%%'
|
||||||
|
AND (subsections).key LIKE 'subsection/%%'
|
||||||
|
), grouped_by_subsections AS (
|
||||||
|
SELECT JSONB_Agg(JSONB_Build_Object('f1', "column")) AS columns,
|
||||||
|
section_id, section_name, subsection_id, subsection_name
|
||||||
|
FROM expanded
|
||||||
|
GROUP BY section_id, section_name, subsection_id, subsection_name
|
||||||
|
)
|
||||||
|
SELECT section_name as name, JSONB_Agg(
|
||||||
|
JSONB_Build_Object(
|
||||||
|
'f1', JSONB_Build_Object(
|
||||||
|
'name', subsection_name,
|
||||||
|
'id', subsection_id,
|
||||||
|
'columns', columns
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) as subsection
|
||||||
|
FROM grouped_by_subsections
|
||||||
|
GROUP BY section_name
|
||||||
|
$string$, aggregate_condition);
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
bounds Geometry(Geometry, 4326) DEFAULT NULL,
|
||||||
|
filter_geom_ids TEXT[] DEFAULT NULL,
|
||||||
|
desired_num_geoms INTEGER DEFAULT NULL,
|
||||||
|
desired_area NUMERIC DEFAULT NULL
|
||||||
|
) RETURNS TABLE (
|
||||||
|
score NUMERIC,
|
||||||
|
numtiles BIGINT,
|
||||||
|
table_id TEXT,
|
||||||
|
column_id TEXT,
|
||||||
|
notnull_percent NUMERIC,
|
||||||
|
numgeoms NUMERIC,
|
||||||
|
percentfill NUMERIC,
|
||||||
|
estnumgeoms NUMERIC,
|
||||||
|
meanmediansize NUMERIC
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
num_geoms_multiplier Numeric;
|
||||||
|
BEGIN
|
||||||
|
IF desired_num_geoms IS NULL THEN
|
||||||
|
desired_num_geoms := 3000;
|
||||||
|
END IF;
|
||||||
|
filter_geom_ids := COALESCE(filter_geom_ids, (ARRAY[])::TEXT[]);
|
||||||
|
-- Very complex geometries simply fail. For a boundary check, we can
|
||||||
|
-- comfortably get away with the simplicity of an envelope
|
||||||
|
IF ST_Npoints(bounds) > 10000 THEN
|
||||||
|
bounds := ST_Envelope(bounds);
|
||||||
|
END IF;
|
||||||
|
IF desired_area IS NULL THEN
|
||||||
|
desired_area := ST_Area(bounds);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- In case of points, desired_area will be 0. We still want an accurate
|
||||||
|
-- estimate of numgeoms in that case.
|
||||||
|
IF desired_area = 0 THEN
|
||||||
|
num_geoms_multiplier := 1;
|
||||||
|
ELSE
|
||||||
|
num_geoms_multiplier := Coalesce(desired_area / Nullif(ST_Area(bounds), 0), 1);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN QUERY
|
||||||
|
EXECUTE $string$
|
||||||
|
WITH clipped_geom AS (
|
||||||
|
SELECT column_id, table_id
|
||||||
|
, CASE WHEN $1 IS NOT NULL THEN ST_Clip(tile, $1, True) -- -20
|
||||||
|
ELSE tile END clipped_tile
|
||||||
|
, tile
|
||||||
|
FROM observatory.obs_column_table_tile_simple
|
||||||
|
WHERE ($1 IS NULL OR ST_Intersects($1, tile))
|
||||||
|
AND (column_id = ANY($2) OR cardinality($2) = 0)
|
||||||
|
), clipped_geom_countagg AS (
|
||||||
|
SELECT column_id, table_id
|
||||||
|
, BOOL_AND(ST_BandIsNoData(clipped_tile, 1)) nodata
|
||||||
|
FROM clipped_geom
|
||||||
|
GROUP BY column_id, table_id
|
||||||
|
), clipped_geom_reagg AS (
|
||||||
|
SELECT COUNT(*)::BIGINT cnt, a.column_id, a.table_id,
|
||||||
|
cdb_observatory.FIRST(nodata) first_nodata,
|
||||||
|
cdb_observatory.FIRST(tile) first_tile,
|
||||||
|
(ST_SummaryStatsAgg(clipped_tile, 1, False)).sum::Numeric sum_geoms, -- ND
|
||||||
|
(ST_SummaryStatsAgg(clipped_tile, 2, False)).mean::Numeric / 255 mean_fill --ND
|
||||||
|
FROM clipped_geom_countagg a, clipped_geom b
|
||||||
|
WHERE a.table_id = b.table_id
|
||||||
|
AND a.column_id = b.column_id
|
||||||
|
GROUP BY a.column_id, a.table_id
|
||||||
|
), final AS (
|
||||||
|
SELECT
|
||||||
|
cnt, table_id, column_id
|
||||||
|
, NULL::Numeric AS notnull_percent
|
||||||
|
, (CASE WHEN first_nodata IS FALSE
|
||||||
|
THEN sum_geoms
|
||||||
|
ELSE COALESCE(ST_Value(first_tile, 1, ST_PointOnSurface($1)), 0)
|
||||||
|
* (ST_Area($1) / ST_Area(ST_PixelAsPolygon(first_tile, 0, 0)))
|
||||||
|
END)::Numeric * $4
|
||||||
|
AS numgeoms
|
||||||
|
, (CASE WHEN first_nodata IS FALSE
|
||||||
|
THEN mean_fill
|
||||||
|
ELSE COALESCE(ST_Value(first_tile, 2, ST_PointOnSurface($1))::Numeric / 255, 0) -- -2
|
||||||
|
END)::Numeric
|
||||||
|
AS percentfill
|
||||||
|
, null::numeric estnumgeoms
|
||||||
|
, null::numeric meanmediansize
|
||||||
|
FROM clipped_geom_reagg
|
||||||
|
) SELECT
|
||||||
|
((100.0 / (1+abs(log(0.0001 + $3) - log(0.0001 + numgeoms::Numeric)))) * percentfill)::Numeric
|
||||||
|
AS score, *
|
||||||
|
FROM final
|
||||||
|
$string$ USING bounds, filter_geom_ids, desired_num_geoms, num_geoms_multiplier;
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql IMMUTABLE;
|
||||||
@@ -0,0 +1,415 @@
|
|||||||
|
-- Data Observatory -- Welcome to the Future
|
||||||
|
-- These Data Observatory functions provide access to boundary polyons (and
|
||||||
|
-- their ids) such as those available through the US Census Tiger, Who's on
|
||||||
|
-- First, the Spanish Census, and so on
|
||||||
|
|
||||||
|
|
||||||
|
-- OBS_GetBoundary
|
||||||
|
--
|
||||||
|
-- Returns the boundary polygon(s) that overlap with the input point geometry.
|
||||||
|
-- From an input point geometry, find the boundary which intersects with the
|
||||||
|
-- centroid of the input geometry
|
||||||
|
-- Inputs:
|
||||||
|
-- geom geometry: input point geometry
|
||||||
|
-- boundary_id text: source id of boundaries
|
||||||
|
-- see function OBS_ListGeomColumns for all avaiable
|
||||||
|
-- boundary ids
|
||||||
|
-- time_span text: time span that the geometries were collected (optional)
|
||||||
|
--
|
||||||
|
-- Output:
|
||||||
|
-- boundary geometry: geometry boundary that intersects with geom, is at the
|
||||||
|
-- resolution requested with boundary_id, and time_span
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundary(
|
||||||
|
geom geometry(Point, 4326),
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL)
|
||||||
|
RETURNS geometry(Geometry, 4326)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
boundary geometry(Geometry, 4326);
|
||||||
|
target_table text;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
-- TODO: Check if SRID = 4326, if not transform?
|
||||||
|
|
||||||
|
-- if not a point, raise error
|
||||||
|
IF ST_GeometryType(geom) != 'ST_Point'
|
||||||
|
THEN
|
||||||
|
RAISE EXCEPTION 'Invalid geometry type (%), expecting ''ST_Point''', ST_GeometryType(geom);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- return the first boundary in intersections
|
||||||
|
EXECUTE $query$
|
||||||
|
SELECT * FROM cdb_observatory._OBS_GetBoundariesByGeometry($1, $2, $3) LIMIT 1
|
||||||
|
$query$ INTO boundary
|
||||||
|
USING geom, boundary_id, time_span;
|
||||||
|
|
||||||
|
RETURN boundary;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- OBS_GetBoundaryId
|
||||||
|
--
|
||||||
|
-- retrieves the boundary identifier (e.g., '36047' = Kings County/Brooklyn, NY)
|
||||||
|
-- corresponding to the location geom and boundary types (e.g.,
|
||||||
|
-- us.census.tiger.county)
|
||||||
|
|
||||||
|
-- Inputs:
|
||||||
|
-- geom geometry: location where the boundary is requested to overlap with
|
||||||
|
-- boundary_id text: source id of boundaries (e.g., us.census.tiger.county)
|
||||||
|
-- see function OBS_ListGeomColumns for all avaiable
|
||||||
|
-- boundary ids
|
||||||
|
-- time_span text: time span that the geometries were collected (optional)
|
||||||
|
--
|
||||||
|
-- Output:
|
||||||
|
-- geometry_id text: identifier of the geometry which overlaps with the input
|
||||||
|
-- point geom in the table corresponding to boundary_id and
|
||||||
|
-- time_span
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundaryId(
|
||||||
|
geom geometry(Point, 4326),
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL
|
||||||
|
)
|
||||||
|
RETURNS text
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
result TEXT;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
EXECUTE $query$
|
||||||
|
SELECT geom_refs FROM cdb_observatory._OBS_GetBoundariesByGeometry(
|
||||||
|
$1, $2, $3) LIMIT 1
|
||||||
|
$query$
|
||||||
|
INTO result
|
||||||
|
USING geom, boundary_id, time_span;
|
||||||
|
|
||||||
|
RETURN result;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
-- OBS_GetBoundaryById
|
||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the boundary that corresponds to that geometry_id, boundary_id, and
|
||||||
|
-- time_span
|
||||||
|
|
||||||
|
-- Inputs:
|
||||||
|
-- geometry_id text: geometry id of the requested boundary
|
||||||
|
-- boundary_id text: source id of boundaries (e.g., us.census.tiger.county)
|
||||||
|
-- see function OBS_ListGeomColumns for all avaiable
|
||||||
|
-- boundary ids
|
||||||
|
-- time_span text: time span that the geometries were collected (optional)
|
||||||
|
--
|
||||||
|
-- Output:
|
||||||
|
-- boundary geometry: geometry boundary that matches geometry_id, is at the
|
||||||
|
-- resolution requested with boundary_id, and time_span
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundaryById(
|
||||||
|
geometry_id text, -- ex: '36047'
|
||||||
|
boundary_id text, -- ex: 'us.census.tiger.county'
|
||||||
|
time_span text DEFAULT NULL -- ex: '2009'
|
||||||
|
)
|
||||||
|
RETURNS geometry(geometry, 4326)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
result GEOMETRY;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
EXECUTE $query$
|
||||||
|
SELECT (data->0->>'value')::Geometry
|
||||||
|
FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[$1],
|
||||||
|
cdb_observatory.OBS_GetMeta(
|
||||||
|
ST_MakeEnvelope(-180, -90, 180, 90, 4326),
|
||||||
|
('[{"geom_id": "' || $2 || '"}]')::JSON))
|
||||||
|
$query$
|
||||||
|
INTO result
|
||||||
|
USING geometry_id, boundary_id;
|
||||||
|
|
||||||
|
RETURN result;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- _OBS_GetBoundariesByGeometry
|
||||||
|
-- internal function for retrieving geometries based on an input geometry
|
||||||
|
-- see OBS_GetBoundariesByGeometry or OBS_GetBoundariesByPointAndRadius for
|
||||||
|
-- more information
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetBoundariesByGeometry(
|
||||||
|
geom geometry(Geometry, 4326),
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL,
|
||||||
|
overlap_type text DEFAULT NULL)
|
||||||
|
RETURNS TABLE (
|
||||||
|
the_geom geometry,
|
||||||
|
geom_refs text
|
||||||
|
) AS $$
|
||||||
|
DECLARE
|
||||||
|
meta JSON;
|
||||||
|
BEGIN
|
||||||
|
overlap_type := COALESCE(overlap_type, 'intersects');
|
||||||
|
-- check inputs
|
||||||
|
IF lower(overlap_type) NOT IN ('contains', 'intersects', 'within')
|
||||||
|
THEN
|
||||||
|
-- recognized overlap type (map to ST_Contains, ST_Intersects, and ST_Within)
|
||||||
|
RAISE EXCEPTION 'Overlap type ''%'' is not an accepted type (choose intersects, within, or contains)', overlap_type;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
EXECUTE $query$
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta($1, JSON_Build_Array(JSON_Build_Object(
|
||||||
|
'geom_id', $2, 'geom_timespan', $3)))
|
||||||
|
$query$
|
||||||
|
INTO meta
|
||||||
|
USING geom, boundary_id, time_span;
|
||||||
|
|
||||||
|
IF meta->0->>'geom_id' IS NULL THEN
|
||||||
|
RETURN QUERY EXECUTE 'SELECT NULL::Geometry, NULL::Text LIMIT 0';
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- return first boundary in intersections
|
||||||
|
RETURN QUERY EXECUTE $query$
|
||||||
|
SELECT (data->0->>'value')::Geometry the_geom, data->0->>'geomref' geom_refs
|
||||||
|
FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[($1, 1)::geomval], $2, False
|
||||||
|
)
|
||||||
|
$query$ USING geom, meta;
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- OBS_GetBoundariesByGeometry
|
||||||
|
--
|
||||||
|
-- Given a bounding box (or a polygon), and it's geometry level (see
|
||||||
|
-- OBS_ListGeomColumns() for all available boundary ids), give back the
|
||||||
|
-- boundaries that are contained within the bounding box polygon and the
|
||||||
|
-- associated geometry ids
|
||||||
|
|
||||||
|
-- Inputs:
|
||||||
|
-- geom geometry: bounding box (or polygon) of the region of interest
|
||||||
|
-- boundary_id text: source id of boundaries (e.g., us.census.tiger.county)
|
||||||
|
-- see function OBS_ListGeomColumns for all avaiable
|
||||||
|
-- boundary ids
|
||||||
|
-- time_span text: time span that the geometries were collected (optional)
|
||||||
|
--
|
||||||
|
-- Output:
|
||||||
|
-- table with the following columns
|
||||||
|
-- boundary geometry: geometry boundary that is contained within the input
|
||||||
|
-- bounding box at the requested geometry level
|
||||||
|
-- with boundary_id, and time_span
|
||||||
|
-- geom_refs text: geometry identifiers (e.g., geoid for the US Census)
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundariesByGeometry(
|
||||||
|
geom geometry(Geometry, 4326),
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL,
|
||||||
|
overlap_type text DEFAULT NULL)
|
||||||
|
RETURNS TABLE(the_geom geometry, geom_refs text)
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
RETURN QUERY SELECT *
|
||||||
|
FROM cdb_observatory._OBS_GetBoundariesByGeometry(
|
||||||
|
geom,
|
||||||
|
boundary_id,
|
||||||
|
time_span,
|
||||||
|
overlap_type
|
||||||
|
);
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- OBS_GetBoundariesByPointAndRadius
|
||||||
|
--
|
||||||
|
-- Given a point and radius, and it's geometry level (see
|
||||||
|
-- OBS_ListGeomColumns() for all available boundary ids), give back the
|
||||||
|
-- boundaries that are contained within the point buffered by radius meters and
|
||||||
|
-- the associated geometry ids
|
||||||
|
|
||||||
|
-- Inputs:
|
||||||
|
-- geom geometry: point geometry centered on area of interest
|
||||||
|
-- radius numeric: radius (in meters) of a circle centered on geom for
|
||||||
|
-- selecting polygons
|
||||||
|
-- boundary_id text: source id of boundaries (e.g., us.census.tiger.county)
|
||||||
|
-- see function OBS_ListGeomColumns for all avaiable
|
||||||
|
-- boundary ids
|
||||||
|
-- time_span text: time span that the geometries were collected (optional)
|
||||||
|
--
|
||||||
|
-- Output:
|
||||||
|
-- table with the following columns
|
||||||
|
-- boundary geometry: geometry boundary that is contained within the input
|
||||||
|
-- bounding box at the requested geometry level
|
||||||
|
-- with boundary_id, and time_span
|
||||||
|
-- geom_refs text: geometry identifiers (e.g., geoid for the US Census)
|
||||||
|
--
|
||||||
|
-- TODO: move to ST_DWithin instead of buffer + intersects?
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetBoundariesByPointAndRadius(
|
||||||
|
geom geometry(Point, 4326), -- point
|
||||||
|
radius numeric, -- radius in meters
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL,
|
||||||
|
overlap_type text DEFAULT NULL)
|
||||||
|
RETURNS TABLE(the_geom geometry, geom_refs text)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
circle_boundary geometry(Geometry, 4326);
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
IF ST_GeometryType(geom) != 'ST_Point'
|
||||||
|
THEN
|
||||||
|
RAISE EXCEPTION 'Input geometry ''%'' is not a point', ST_AsText(geom);
|
||||||
|
ELSE
|
||||||
|
circle_boundary := ST_Buffer(geom::geography, radius)::geometry;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN QUERY SELECT *
|
||||||
|
FROM cdb_observatory._OBS_GetBoundariesByGeometry(
|
||||||
|
circle_boundary,
|
||||||
|
boundary_id,
|
||||||
|
time_span,
|
||||||
|
overlap_type);
|
||||||
|
RETURN;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- _OBS_GetPointsByGeometry
|
||||||
|
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetPointsByGeometry(
|
||||||
|
geom geometry(Geometry, 4326),
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL,
|
||||||
|
overlap_type text DEFAULT NULL)
|
||||||
|
RETURNS TABLE(the_geom geometry, geom_refs text)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
boundary geometry(Geometry, 4326);
|
||||||
|
geom_colname text;
|
||||||
|
geoid_colname text;
|
||||||
|
target_table text;
|
||||||
|
BEGIN
|
||||||
|
overlap_type := COALESCE(overlap_type, 'intersects');
|
||||||
|
|
||||||
|
IF lower(overlap_type) NOT IN ('contains', 'within', 'intersects')
|
||||||
|
THEN
|
||||||
|
RAISE EXCEPTION 'Overlap type ''%'' is not an accepted type (choose intersects, within, or contains)', overlap_type;
|
||||||
|
ELSIF ST_GeometryType(geom) NOT IN ('ST_Polygon', 'ST_MultiPolygon')
|
||||||
|
THEN
|
||||||
|
RAISE EXCEPTION 'Invalid geometry type (%), expecting ''ST_MultiPolygon'' or ''ST_Polygon''', ST_GeometryType(geom);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- return first boundary in intersections
|
||||||
|
RETURN QUERY EXECUTE $query$
|
||||||
|
SELECT ST_PointOnSurface(the_geom), geom_refs
|
||||||
|
FROM cdb_observatory._OBS_GetBoundariesByGeometry($1, $2)
|
||||||
|
$query$ USING geom, boundary_id;
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- OBS_GetPointsByGeometry
|
||||||
|
--
|
||||||
|
-- Given a polygon, and it's geometry level (see
|
||||||
|
-- OBS_ListGeomColumns() for all available boundary ids), give back a point
|
||||||
|
-- which lies in a boundary from the requested geometry level that is contained
|
||||||
|
-- within the bounding box polygon and the associated geometry ids
|
||||||
|
--
|
||||||
|
-- Inputs:
|
||||||
|
-- geom geometry: bounding box (or polygon) of the region of interest
|
||||||
|
-- boundary_id text: source id of boundaries (e.g., us.census.tiger.county)
|
||||||
|
-- see function OBS_ListGeomColumns for all avaiable
|
||||||
|
-- boundary ids
|
||||||
|
-- time_span text: time span that the geometries were collected (optional)
|
||||||
|
--
|
||||||
|
-- Output:
|
||||||
|
-- table with the following columns
|
||||||
|
-- boundary geometry: point that lies on a boundary that is contained within
|
||||||
|
-- the input bounding box at the requested geometry
|
||||||
|
-- level with boundary_id, and time_span
|
||||||
|
-- geom_refs text: geometry identifiers (e.g., geoid for the US Census)
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetPointsByGeometry(
|
||||||
|
geom geometry(Geometry, 4326),
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL,
|
||||||
|
overlap_type text DEFAULT NULL)
|
||||||
|
RETURNS TABLE(the_geom geometry, geom_refs text)
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
RETURN QUERY SELECT *
|
||||||
|
FROM cdb_observatory._OBS_GetPointsByGeometry(
|
||||||
|
geom,
|
||||||
|
boundary_id,
|
||||||
|
time_span,
|
||||||
|
overlap_type);
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- OBS_GetBoundariesByPointAndRadius
|
||||||
|
--
|
||||||
|
-- Given a point and radius, and it's geometry level (see
|
||||||
|
-- OBS_ListGeomColumns() for all available boundary ids), give back the
|
||||||
|
-- boundaries that are contained within the point buffered by radius meters and
|
||||||
|
-- the associated geometry ids
|
||||||
|
|
||||||
|
-- Inputs:
|
||||||
|
-- geom geometry: point geometry centered on area of interest
|
||||||
|
-- radius numeric: radius (in meters) of a circle centered on geom for
|
||||||
|
-- selecting polygons
|
||||||
|
-- boundary_id text: source id of boundaries (e.g., us.census.tiger.county)
|
||||||
|
-- see function OBS_ListGeomColumns for all avaiable
|
||||||
|
-- boundary ids
|
||||||
|
-- time_span text: time span that the geometries were collected (optional)
|
||||||
|
--
|
||||||
|
-- Output:
|
||||||
|
-- table with the following columns
|
||||||
|
-- boundary geometry: geometry boundary that is contained within the input
|
||||||
|
-- bounding box at the requested geometry level
|
||||||
|
-- with boundary_id, and time_span
|
||||||
|
-- geom_refs text: geometry identifiers (e.g., geoid for the US Census)
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetPointsByPointAndRadius(
|
||||||
|
geom geometry(Point, 4326), -- point
|
||||||
|
radius numeric, -- radius in meters
|
||||||
|
boundary_id text,
|
||||||
|
time_span text DEFAULT NULL,
|
||||||
|
overlap_type text DEFAULT NULL)
|
||||||
|
RETURNS TABLE(the_geom geometry, geom_refs text)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
circle_boundary geometry(Geometry, 4326);
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
IF ST_GeometryType(geom) != 'ST_Point'
|
||||||
|
THEN
|
||||||
|
RAISE EXCEPTION 'Input geometry ''%'' is not a point', ST_AsText(geom);
|
||||||
|
ELSE
|
||||||
|
circle_boundary := ST_Buffer(geom::geography, radius)::geometry;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RETURN QUERY SELECT *
|
||||||
|
FROM cdb_observatory._OBS_GetPointsByGeometry(
|
||||||
|
ST_Buffer(geom::geography, radius)::geometry,
|
||||||
|
boundary_id,
|
||||||
|
time_span,
|
||||||
|
overlap_type);
|
||||||
|
RETURN;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
@@ -0,0 +1,839 @@
|
|||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetTileBounds(z INTEGER, x INTEGER, y INTEGER)
|
||||||
|
RETURNS NUMERIC[] AS $$
|
||||||
|
import math
|
||||||
|
def tile2lnglat(z, x, y):
|
||||||
|
n = 2.0 ** z
|
||||||
|
y = (1 << z) - y - 1
|
||||||
|
|
||||||
|
lon = x / n * 360.0 - 180.0
|
||||||
|
lat_rad = math.atan(math.sinh(math.pi * (1 - 2 * y / n)))
|
||||||
|
lat = - math.degrees(lat_rad)
|
||||||
|
|
||||||
|
return lon, lat
|
||||||
|
|
||||||
|
lon0, lat0 = tile2lnglat(z, x, y)
|
||||||
|
lon1, lat1 = tile2lnglat(z, x+1, y-1)
|
||||||
|
|
||||||
|
return [lon0, lat0, lon1, lat1]
|
||||||
|
$$ LANGUAGE plpythonu;
|
||||||
|
|
||||||
|
DROP FUNCTION IF EXISTS cdb_observatory.OBS_GetMVT(z INTEGER, x INTEGER, y INTEGER, params JSONB);
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetMVT(z INTEGER, x INTEGER, y INTEGER,
|
||||||
|
params JSON DEFAULT NULL,
|
||||||
|
extent INTEGER DEFAULT 4096, buf INTEGER DEFAULT 256, clip_geom BOOLEAN DEFAULT True)
|
||||||
|
RETURNS TABLE (mvt BYTEA)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
bounds NUMERIC[];
|
||||||
|
geom GEOMETRY;
|
||||||
|
ext BOX2D;
|
||||||
|
meta JSON;
|
||||||
|
|
||||||
|
procgeom_clauses TEXT;
|
||||||
|
val_clauses TEXT;
|
||||||
|
json_clause TEXT;
|
||||||
|
BEGIN
|
||||||
|
bounds := cdb_observatory.OBS_GetTileBounds(z, x, y);
|
||||||
|
geom := ST_MakeEnvelope(bounds[1], bounds[2], bounds[3], bounds[4], 4326);
|
||||||
|
ext := ST_MakeBox2D(ST_Point(bounds[1], bounds[2]), ST_Point(bounds[3], bounds[4]));
|
||||||
|
meta := cdb_observatory.obs_getmeta(geom, params::json, 1::integer, 1::integer, 1::integer);
|
||||||
|
|
||||||
|
/* Read metadata to generate clauses for query */
|
||||||
|
EXECUTE $query$
|
||||||
|
WITH _meta AS (SELECT
|
||||||
|
row_number() over () colid, *
|
||||||
|
FROM json_to_recordset($1)
|
||||||
|
AS x(id TEXT, numer_id TEXT, numer_aggregate TEXT, numer_colname TEXT,
|
||||||
|
numer_geomref_colname TEXT, numer_tablename TEXT, numer_type TEXT,
|
||||||
|
denom_id TEXT, denom_aggregate TEXT, denom_colname TEXT,
|
||||||
|
denom_geomref_colname TEXT, denom_tablename TEXT, denom_type TEXT,
|
||||||
|
denom_reltype TEXT, geom_id TEXT, geom_colname TEXT,
|
||||||
|
geom_geomref_colname TEXT, geom_tablename TEXT, geom_type TEXT,
|
||||||
|
numer_timespan TEXT, geom_timespan TEXT, normalization TEXT,
|
||||||
|
api_method TEXT, api_args JSON)
|
||||||
|
),
|
||||||
|
|
||||||
|
-- Generate procgeom clauses.
|
||||||
|
-- These join the users' geoms to the relevant geometries for the
|
||||||
|
-- asked-for measures in the Observatory.
|
||||||
|
_procgeom_clauses AS (
|
||||||
|
SELECT
|
||||||
|
'_procgeoms_' || Coalesce(left(geom_tablename,40) || '_' || geom_geomref_colname, api_method) || ' AS (' ||
|
||||||
|
'SELECT ' ||
|
||||||
|
'st_intersection(' || geom_tablename || '.' || geom_colname || ', _geoms.geom) AS geom, ' ||
|
||||||
|
'ST_AsMVTGeom(st_intersection(' || geom_tablename || '.' || geom_colname || ', _geoms.geom), $2, $3, $4, $5) AS mvtgeom, ' ||
|
||||||
|
geom_tablename || '.' || geom_geomref_colname || ' AS geomref, ' ||
|
||||||
|
'CASE WHEN ST_Within(_geoms.geom, ' || geom_tablename || '.' || geom_colname || ')
|
||||||
|
THEN ST_Area(_geoms.geom) / Nullif(ST_Area(' || geom_tablename || '.' || geom_colname || '), 0)
|
||||||
|
WHEN ST_Within(' || geom_tablename || '.' || geom_colname || ', _geoms.geom)
|
||||||
|
THEN 1
|
||||||
|
ELSE ST_Area(cdb_observatory.safe_intersection(_geoms.geom, ' || geom_tablename || '.' || geom_colname || ')) /
|
||||||
|
Nullif(ST_Area(' || geom_tablename || '.' || geom_colname || '), 0)
|
||||||
|
END pct_obs' || '
|
||||||
|
FROM _geoms, observatory.' || geom_tablename || '
|
||||||
|
WHERE ST_Intersects(_geoms.geom, ' || geom_tablename || '.' || geom_colname || ')'
|
||||||
|
|| ')'
|
||||||
|
AS procgeom_clause
|
||||||
|
FROM _meta
|
||||||
|
GROUP BY api_method, geom_tablename, geom_geomref_colname, geom_colname
|
||||||
|
),
|
||||||
|
|
||||||
|
-- Generate val clauses.
|
||||||
|
-- These perform interpolations or other necessary calculations to
|
||||||
|
-- provide values according to users geometries.
|
||||||
|
_val_clauses AS (
|
||||||
|
SELECT
|
||||||
|
'_vals_' || Coalesce(left(geom_tablename,40) || '_' || geom_geomref_colname, api_method) || ' AS (
|
||||||
|
SELECT _procgeoms.geomref, _procgeoms.mvtgeom, ' ||
|
||||||
|
String_Agg('json_build_object(' || CASE
|
||||||
|
-- api-delivered values
|
||||||
|
WHEN api_method IS NOT NULL THEN
|
||||||
|
'''' || numer_colname || ''', ' ||
|
||||||
|
'ARRAY_AGG( ' ||
|
||||||
|
api_method || '.' || numer_colname || ')::' || numer_type || '[]'
|
||||||
|
-- numeric internal values
|
||||||
|
WHEN cdb_observatory.isnumeric(numer_type) THEN
|
||||||
|
'''' || numer_colname || ''', ' || CASE
|
||||||
|
-- denominated
|
||||||
|
WHEN LOWER(normalization) LIKE 'denom%'
|
||||||
|
THEN CASE
|
||||||
|
WHEN denom_tablename IS NULL THEN ' NULL '
|
||||||
|
-- denominated polygon interpolation
|
||||||
|
ELSE
|
||||||
|
' ROUND(CAST(SUM(' || numer_tablename || '.' || numer_colname || ' ' ||
|
||||||
|
' * _procgeoms.pct_obs ' ||
|
||||||
|
' ) / NULLIF(SUM(' || denom_tablename || '.' || denom_colname || ' ' ||
|
||||||
|
' * _procgeoms.pct_obs), 0) AS NUMERIC), 4) '
|
||||||
|
END
|
||||||
|
-- areaNormalized
|
||||||
|
WHEN LOWER(normalization) LIKE 'area%'
|
||||||
|
THEN
|
||||||
|
-- areaNormalized polygon interpolation
|
||||||
|
' ROUND(CAST(SUM(' || numer_tablename || '.' || numer_colname || ' ' ||
|
||||||
|
' * _procgeoms.pct_obs' ||
|
||||||
|
' ) / (Nullif(ST_Area(cdb_observatory.FIRST(_procgeoms.geom)::Geography), 0) / 1000000) AS NUMERIC), 4) '
|
||||||
|
-- median/average measures with universe
|
||||||
|
WHEN LOWER(numer_aggregate) IN ('median', 'average') AND
|
||||||
|
denom_reltype ILIKE 'universe' AND LOWER(normalization) LIKE 'pre%'
|
||||||
|
THEN
|
||||||
|
-- predenominated polygon interpolation weighted by universe
|
||||||
|
' ROUND(CAST(SUM(' || numer_tablename || '.' || numer_colname ||
|
||||||
|
' * ' || denom_tablename || '.' || denom_colname ||
|
||||||
|
' * _procgeoms.pct_obs ' ||
|
||||||
|
' ) / Nullif(SUM(' || denom_tablename || '.' || denom_colname ||
|
||||||
|
' * _procgeoms.pct_obs ' || '), 0)AS NUMERIC), 4) '
|
||||||
|
-- prenormalized for summable measures. point or summable only!
|
||||||
|
WHEN numer_aggregate ILIKE 'sum' AND LOWER(normalization) LIKE 'pre%'
|
||||||
|
THEN
|
||||||
|
-- predenominated polygon interpolation
|
||||||
|
' ROUND(CAST(SUM(' || numer_tablename || '.' || numer_colname || ' ' ||
|
||||||
|
' * _procgeoms.pct_obs) AS NUMERIC), 4) '
|
||||||
|
-- Everything else. Point only!
|
||||||
|
ELSE
|
||||||
|
' cdb_observatory._OBS_RaiseNotice(''Cannot perform calculation over polygon for ' ||
|
||||||
|
numer_id || '/' || coalesce(denom_id, '') || '/' || geom_id || '/' || numer_timespan || ''')::Numeric '
|
||||||
|
END || '::' || numer_type
|
||||||
|
|
||||||
|
-- categorical/text
|
||||||
|
WHEN LOWER(numer_type) LIKE 'text' THEN
|
||||||
|
'''' || numer_colname || ''', ' || 'MODE() WITHIN GROUP (ORDER BY ' || numer_tablename || '.' || numer_colname || ') '
|
||||||
|
-- geometry
|
||||||
|
WHEN numer_id IS NULL THEN
|
||||||
|
'''geomref'', _procgeoms.geomref, ' ||
|
||||||
|
'''' || numer_colname || ''', ' || 'cdb_observatory.FIRST(_procgeoms.mvtgeom)::TEXT'
|
||||||
|
ELSE ''
|
||||||
|
END
|
||||||
|
|| ') val_' || colid, ', ')
|
||||||
|
|| '
|
||||||
|
FROM _procgeoms_' || Coalesce(left(geom_tablename,40) || '_' || geom_geomref_colname, api_method) || ' _procgeoms ' ||
|
||||||
|
Coalesce(String_Agg(DISTINCT
|
||||||
|
Coalesce('LEFT JOIN observatory.' || numer_tablename || ' ON _procgeoms.geomref = observatory.' || numer_tablename || '.' || numer_geomref_colname,
|
||||||
|
', LATERAL (SELECT * FROM cdb_observatory.' || api_method || '(_procgeoms.mvtgeom' || Coalesce(', ' ||
|
||||||
|
(SELECT STRING_AGG(REPLACE(val::text, '"', ''''), ', ')
|
||||||
|
FROM (SELECT JSON_Array_Elements(api_args) as val) as vals),
|
||||||
|
'') || ')) AS ' || api_method)
|
||||||
|
, ' '), '') ||
|
||||||
|
E'\n GROUP BY _procgeoms.geomref, _procgeoms.mvtgeom
|
||||||
|
ORDER BY _procgeoms.geomref'
|
||||||
|
|| ')'
|
||||||
|
AS val_clause,
|
||||||
|
'_vals_' || Coalesce(left(geom_tablename, 40) || '_' || geom_geomref_colname, api_method) AS cte_name
|
||||||
|
FROM _meta
|
||||||
|
GROUP BY geom_tablename, geom_geomref_colname, geom_colname, api_method
|
||||||
|
),
|
||||||
|
|
||||||
|
-- Generate clauses necessary to join together val_clauses
|
||||||
|
_val_joins AS (
|
||||||
|
SELECT String_Agg(a.cte_name || '.geomref = ' || b.cte_name || '.geomref ', ' AND ') val_joins
|
||||||
|
FROM _val_clauses a, _val_clauses b
|
||||||
|
WHERE a.cte_name != b.cte_name
|
||||||
|
AND a.cte_name < b.cte_name
|
||||||
|
),
|
||||||
|
|
||||||
|
-- Generate JSON clause. This puts together vals from val_clauses
|
||||||
|
_json_clause AS (SELECT
|
||||||
|
'SELECT ST_AsMVT(q, ''data'', $3) FROM (' ||
|
||||||
|
'SELECT ' || cdb_observatory.FIRST(cte_name) || '.mvtgeom geom,
|
||||||
|
replace(' || (SELECT String_Agg('val_' || colid, '::TEXT || ') FROM _meta) || ', ''}{'', '', '')::jsonb
|
||||||
|
FROM ' || String_Agg(cte_name, ', ') ||
|
||||||
|
' WHERE ST_Area(' || cdb_observatory.FIRST(cte_name) || '.mvtgeom) > 0' ||
|
||||||
|
Coalesce(' AND ' || val_joins, ') q')
|
||||||
|
AS json_clause
|
||||||
|
FROM _val_clauses, _val_joins
|
||||||
|
GROUP BY val_joins
|
||||||
|
)
|
||||||
|
|
||||||
|
SELECT (SELECT String_Agg(procgeom_clause, E',\n ') FROM _procgeom_clauses),
|
||||||
|
(SELECT String_Agg(val_clause, E',\n ') FROM _val_clauses),
|
||||||
|
json_clause
|
||||||
|
FROM _json_clause
|
||||||
|
$query$ INTO
|
||||||
|
procgeom_clauses,
|
||||||
|
val_clauses,
|
||||||
|
json_clause
|
||||||
|
USING meta;
|
||||||
|
|
||||||
|
IF procgeom_clauses IS NULL OR val_clauses IS NULL OR json_clause IS NULL THEN
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
/* Execute query */
|
||||||
|
RETURN QUERY EXECUTE format($query$
|
||||||
|
WITH _geoms AS (%s),
|
||||||
|
-- procgeom_clauses
|
||||||
|
%s,
|
||||||
|
|
||||||
|
-- val_clauses
|
||||||
|
%s
|
||||||
|
|
||||||
|
-- json_clause
|
||||||
|
%s
|
||||||
|
$query$, 'SELECT $1::geometry as geom',
|
||||||
|
String_Agg(procgeom_clauses, E',\n '),
|
||||||
|
String_Agg(val_clauses, E',\n '),
|
||||||
|
json_clause)
|
||||||
|
USING geom, ext, extent, buf, clip_geom;
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS cdb_observatory.OBS_CachedMeta;
|
||||||
|
CREATE TABLE cdb_observatory.OBS_CachedMeta(
|
||||||
|
z INTEGER,
|
||||||
|
parameters TEXT,
|
||||||
|
num_timespans INTEGER,
|
||||||
|
num_scores INTEGER,
|
||||||
|
num_target_geoms INTEGER,
|
||||||
|
result JSON,
|
||||||
|
PRIMARY KEY (z, parameters, num_timespans, num_scores, num_target_geoms)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_RetrieveMeta(
|
||||||
|
zoom INTEGER,
|
||||||
|
geom geometry(Geometry, 4326),
|
||||||
|
getmeta_parameters JSON,
|
||||||
|
num_timespan_options INTEGER DEFAULT NULL,
|
||||||
|
num_score_options INTEGER DEFAULT NULL,
|
||||||
|
target_geoms INTEGER DEFAULT NULL)
|
||||||
|
RETURNS JSON
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
result JSON;
|
||||||
|
BEGIN
|
||||||
|
SELECT c.result
|
||||||
|
INTO result
|
||||||
|
FROM cdb_observatory.OBS_CachedMeta c
|
||||||
|
WHERE c.z = zoom
|
||||||
|
AND c.parameters = getmeta_parameters::TEXT
|
||||||
|
AND c.num_timespans = num_timespan_options
|
||||||
|
AND c.num_scores = num_score_options
|
||||||
|
AND c.num_target_geoms = target_geoms;
|
||||||
|
|
||||||
|
IF result IS NULL THEN
|
||||||
|
result := cdb_observatory.obs_getmeta(geom, getmeta_parameters, num_timespan_options, num_score_options, target_geoms);
|
||||||
|
|
||||||
|
INSERT INTO cdb_observatory.OBS_CachedMeta(z, parameters, num_timespans, num_scores, num_target_geoms, result)
|
||||||
|
SELECT zoom, getmeta_parameters::TEXT, num_timespan_options, num_score_options, target_geoms, result
|
||||||
|
ON CONFLICT (z, parameters, num_timespans, num_scores, num_target_geoms)
|
||||||
|
DO UPDATE SET result = EXCLUDED.result;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetMCDates(
|
||||||
|
mc_schema TEXT,
|
||||||
|
geo_level TEXT,
|
||||||
|
month_no TEXT DEFAULT NULL)
|
||||||
|
RETURNS TEXT[]
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
mc_table TEXT;
|
||||||
|
where_clause TEXT DEFAULT '';
|
||||||
|
dates TEXT[];
|
||||||
|
BEGIN
|
||||||
|
mc_table := cdb_observatory.OBS_GetMCTable(mc_schema, geo_level);
|
||||||
|
|
||||||
|
IF month_no IS NOT NULL THEN
|
||||||
|
where_clause := format(
|
||||||
|
$query$
|
||||||
|
WHERE month LIKE '%1$s/__/____'
|
||||||
|
$query$, LPAD(month_no, 2, '0'));
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
EXECUTE
|
||||||
|
format(
|
||||||
|
$query$
|
||||||
|
SELECT ARRAY_AGG(DISTINCT month) dates
|
||||||
|
FROM "%1$s".%2$s
|
||||||
|
%3$s
|
||||||
|
$query$, mc_schema, mc_table, where_clause)
|
||||||
|
INTO dates;
|
||||||
|
|
||||||
|
RETURN dates;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetMCTable(mc_schema TEXT, geo_level TEXT)
|
||||||
|
RETURNS TEXT
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
mc_table TEXT;
|
||||||
|
BEGIN
|
||||||
|
-- SELECT tablename from pg_tables
|
||||||
|
-- INTO mc_table
|
||||||
|
-- WHERE schemaname = mc_schema
|
||||||
|
-- AND tablename LIKE '%'||geo_level||'%';
|
||||||
|
mc_table := 'mc_' || geo_level;
|
||||||
|
RETURN mc_table;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetMCDOMVT(
|
||||||
|
z INTEGER, x INTEGER, y INTEGER,
|
||||||
|
geography_level TEXT,
|
||||||
|
do_measurements TEXT[],
|
||||||
|
mc_measurements TEXT[],
|
||||||
|
mc_categories TEXT[] DEFAULT ARRAY['TR']::TEXT[],
|
||||||
|
mc_months TEXT[] DEFAULT ARRAY['2018-02-01']::TEXT[],
|
||||||
|
use_meta_cache BOOLEAN DEFAULT True,
|
||||||
|
shoreline_clipped BOOLEAN DEFAULT True,
|
||||||
|
optimize_clipping BOOLEAN DEFAULT False,
|
||||||
|
simplify_geometries BOOLEAN DEFAULT False,
|
||||||
|
area_normalized BOOLEAN DEFAULT False,
|
||||||
|
extent INTEGER DEFAULT 4096,
|
||||||
|
buf INTEGER DEFAULT 256,
|
||||||
|
clip_geom BOOLEAN DEFAULT True)
|
||||||
|
RETURNS TABLE (
|
||||||
|
mvtgeom GEOMETRY,
|
||||||
|
mvtdata JSONB
|
||||||
|
)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
state_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.state';
|
||||||
|
county_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.county';
|
||||||
|
tract_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.census_tract';
|
||||||
|
blockgroup_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.block_group';
|
||||||
|
block_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.block';
|
||||||
|
|
||||||
|
mc_schema CONSTANT TEXT DEFAULT 'us.mastercard';
|
||||||
|
mc_geoid CONSTANT TEXT DEFAULT 'region_id';
|
||||||
|
mc_category_column CONSTANT TEXT DEFAULT 'category';
|
||||||
|
mc_month_column CONSTANT TEXT DEFAULT 'month';
|
||||||
|
mc_table TEXT;
|
||||||
|
mc_category TEXT;
|
||||||
|
mc_table_categories TEXT DEFAULT '';
|
||||||
|
mc_month TEXT;
|
||||||
|
mc_month_slug TEXT;
|
||||||
|
mc_measurements_categories TEXT[];
|
||||||
|
mc_measurement TEXT;
|
||||||
|
|
||||||
|
bounds NUMERIC[];
|
||||||
|
geom GEOMETRY;
|
||||||
|
ext BOX2D;
|
||||||
|
|
||||||
|
measurement TEXT;
|
||||||
|
getmeta_parameters TEXT;
|
||||||
|
meta JSON;
|
||||||
|
mc_geography_level TEXT;
|
||||||
|
|
||||||
|
numer_tablename_do TEXT DEFAULT '';
|
||||||
|
numer_tablenames_do TEXT[] DEFAULT ARRAY['']::TEXT[];
|
||||||
|
numer_tablenames_do_outer TEXT DEFAULT '';
|
||||||
|
numer_tablenames_mc TEXT DEFAULT '';
|
||||||
|
numer_colnames_do TEXT DEFAULT '';
|
||||||
|
numer_colnames_do_qualified TEXT DEFAULT '';
|
||||||
|
numer_colnames_do_normalized TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_current TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_qualified TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_qualified_current TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_normalized TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_normalized_current TEXT DEFAULT '';
|
||||||
|
geom_tablenames TEXT;
|
||||||
|
geom_colnames TEXT;
|
||||||
|
geom_geomref_colnames TEXT;
|
||||||
|
geom_geomref_colnames_qualified TEXT;
|
||||||
|
geom_relations_do TEXT[] DEFAULT ARRAY['']::TEXT[];
|
||||||
|
geom_relations_mc TEXT DEFAULT '';
|
||||||
|
geom_mc_outerjoins TEXT DEFAULT '';
|
||||||
|
|
||||||
|
simplification_tolerance NUMERIC DEFAULT 0;
|
||||||
|
area_normalization TEXT DEFAULT '';
|
||||||
|
i INTEGER DEFAULT 0;
|
||||||
|
clipped TEXT default '';
|
||||||
|
BEGIN
|
||||||
|
IF area_normalized THEN
|
||||||
|
area_normalization := '/area_ratio';
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF shoreline_clipped THEN
|
||||||
|
clipped := '_clipped';
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
CASE
|
||||||
|
WHEN geography_level = state_geoname THEN
|
||||||
|
simplification_tolerance := 0.1;
|
||||||
|
IF optimize_clipping THEN
|
||||||
|
clipped := '';
|
||||||
|
END IF;
|
||||||
|
WHEN geography_level = county_geoname THEN
|
||||||
|
simplification_tolerance := 0.01;
|
||||||
|
WHEN geography_level = tract_geoname THEN
|
||||||
|
simplification_tolerance := 0.001;
|
||||||
|
WHEN geography_level = blockgroup_geoname THEN
|
||||||
|
simplification_tolerance := 0.0001;
|
||||||
|
WHEN geography_level = block_geoname THEN
|
||||||
|
simplification_tolerance := 0.0001;
|
||||||
|
ELSE
|
||||||
|
simplification_tolerance := 0;
|
||||||
|
END CASE;
|
||||||
|
|
||||||
|
IF NOT simplify_geometries THEN
|
||||||
|
simplification_tolerance := 0;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
bounds := cdb_observatory.OBS_GetTileBounds(z, x, y);
|
||||||
|
geom := ST_MakeEnvelope(bounds[1], bounds[2], bounds[3], bounds[4], 4326);
|
||||||
|
ext := ST_MakeBox2D(ST_Transform(ST_SetSRID(ST_Point(bounds[1], bounds[2]), 4326), 3857),
|
||||||
|
ST_Transform(ST_SetSRID(ST_Point(bounds[3], bounds[4]), 4326), 3857));
|
||||||
|
|
||||||
|
---------DO---------
|
||||||
|
getmeta_parameters := '[ ';
|
||||||
|
FOREACH measurement IN ARRAY do_measurements LOOP
|
||||||
|
getmeta_parameters := getmeta_parameters || '{"numer_id":"' || measurement || '","geom_id":"' || geography_level || clipped ||'"},';
|
||||||
|
END LOOP;
|
||||||
|
getmeta_parameters := substring(getmeta_parameters from 1 for length(getmeta_parameters) - 1) || ' ]';
|
||||||
|
|
||||||
|
IF use_meta_cache THEN
|
||||||
|
meta := cdb_observatory.OBS_RetrieveMeta(z, geom, getmeta_parameters::json, 1::integer, 1::integer, 1::integer);
|
||||||
|
ELSE
|
||||||
|
meta := cdb_observatory.obs_getmeta(geom, getmeta_parameters::json, 1::integer, 1::integer, 1::integer);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF meta IS NOT NULL THEN
|
||||||
|
SELECT array_agg(distinct 'observatory.'||numer_tablename) numer_tablenames,
|
||||||
|
string_agg(distinct numer_colname, ',')||',' numer_colnames,
|
||||||
|
string_agg(distinct numer_tablename||'.'||numer_colname, ',')||',' numer_colnames_qualified,
|
||||||
|
string_agg(distinct numer_colname||area_normalization||' '||numer_colname, ',')||',' numer_colnames_normalized,
|
||||||
|
(array_agg(distinct 'observatory.'||geom_tablename))[1] geom_tablenames,
|
||||||
|
(array_agg(distinct geom_colname))[1] geom_colnames,
|
||||||
|
(array_agg(distinct geom_geomref_colname))[1] geom_geomref_colnames,
|
||||||
|
(array_agg(distinct geom_tablename||'.'||geom_geomref_colname))[1] geom_geomref_colnames_qualified,
|
||||||
|
array_agg(distinct numer_tablename||'.'||numer_geomref_colname||'='||geom_tablename||'.'||geom_geomref_colname) geom_relations
|
||||||
|
INTO numer_tablenames_do, numer_colnames_do, numer_colnames_do_qualified, numer_colnames_do_normalized, geom_tablenames, geom_colnames,
|
||||||
|
geom_geomref_colnames, geom_geomref_colnames_qualified, geom_relations_do
|
||||||
|
FROM json_to_recordset(meta)
|
||||||
|
AS x(id TEXT, numer_id TEXT, numer_aggregate TEXT, numer_colname TEXT, numer_geomref_colname TEXT, numer_tablename TEXT,
|
||||||
|
numer_type TEXT, denom_id TEXT, denom_aggregate TEXT, denom_colname TEXT, denom_geomref_colname TEXT, denom_tablename TEXT,
|
||||||
|
denom_type TEXT, denom_reltype TEXT, geom_id TEXT, geom_colname TEXT, geom_geomref_colname TEXT, geom_tablename TEXT,
|
||||||
|
geom_type TEXT, numer_timespan TEXT, geom_timespan TEXT, normalization TEXT, api_method TEXT, api_args JSON);
|
||||||
|
|
||||||
|
IF numer_tablenames_do IS NULL OR numer_colnames_do IS NULL OR numer_colnames_do_qualified IS NULL OR numer_colnames_do_normalized IS NULL
|
||||||
|
OR geom_tablenames IS NULL OR geom_colnames IS NULL OR geom_geomref_colnames IS NULL OR geom_geomref_colnames_qualified IS NULL
|
||||||
|
OR geom_relations_do IS NULL THEN
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
i := 0;
|
||||||
|
FOREACH numer_tablename_do IN ARRAY numer_tablenames_do LOOP
|
||||||
|
i := i + 1;
|
||||||
|
numer_tablenames_do_outer := numer_tablenames_do_outer || 'LEFT OUTER JOIN ' || numer_tablename_do || ' ON ' || geom_relations_do[i] || ' ';
|
||||||
|
END LOOP;
|
||||||
|
ELSE
|
||||||
|
getmeta_parameters := '[{"geom_id":"' || geography_level || clipped ||'"}]';
|
||||||
|
meta := cdb_observatory.obs_getmeta(geom, getmeta_parameters::json, 1::integer, 1::integer, 1::integer);
|
||||||
|
|
||||||
|
IF meta IS NULL THEN
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SELECT (array_agg(distinct 'observatory.'||geom_tablename))[1] geom_tablenames,
|
||||||
|
(array_agg(distinct geom_colname))[1] geom_colnames,
|
||||||
|
(array_agg(distinct geom_geomref_colname))[1] geom_geomref_colnames,
|
||||||
|
(array_agg(distinct geom_tablename||'.'||geom_geomref_colname))[1] geom_geomref_colnames_qualified
|
||||||
|
FROM json_to_recordset(meta)
|
||||||
|
INTO geom_tablenames, geom_colnames, geom_geomref_colnames, geom_geomref_colnames_qualified
|
||||||
|
AS x(id TEXT, numer_id TEXT, numer_aggregate TEXT, numer_colname TEXT, numer_geomref_colname TEXT, numer_tablename TEXT,
|
||||||
|
numer_type TEXT, denom_id TEXT, denom_aggregate TEXT, denom_colname TEXT, denom_geomref_colname TEXT, denom_tablename TEXT,
|
||||||
|
denom_type TEXT, denom_reltype TEXT, geom_id TEXT, geom_colname TEXT, geom_geomref_colname TEXT, geom_tablename TEXT,
|
||||||
|
geom_type TEXT, numer_timespan TEXT, geom_timespan TEXT, normalization TEXT, api_method TEXT, api_args JSON);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
---------MC---------
|
||||||
|
IF geography_level = 'us.census.tiger.census_tract' THEN
|
||||||
|
mc_geography_level := 'tract';
|
||||||
|
ELSE
|
||||||
|
mc_geography_level := (string_to_array(geography_level, '.'))[array_length(string_to_array(geography_level, '.'), 1)];
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
mc_table := cdb_observatory.OBS_GetMCTable(mc_schema, mc_geography_level);
|
||||||
|
|
||||||
|
FOREACH mc_month IN ARRAY mc_months LOOP
|
||||||
|
mc_month_slug := replace(mc_month, '/', '');
|
||||||
|
FOREACH mc_category IN ARRAY mc_categories LOOP
|
||||||
|
mc_category := lower(mc_category);
|
||||||
|
mc_measurements_categories := ARRAY['']::TEXT[];
|
||||||
|
|
||||||
|
FOREACH mc_measurement IN ARRAY mc_measurements LOOP
|
||||||
|
mc_measurements_categories := array_append(mc_measurements_categories, mc_measurement||'_'||mc_category);
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
SELECT string_agg(column_name||'_'||mc_month_slug, ','),
|
||||||
|
string_agg(mc_table||'_'||mc_month_slug||'.'||column_name||' '||column_name||'_'||mc_month_slug, ','),
|
||||||
|
string_agg(distinct column_name||'_'||mc_month_slug||area_normalization||' '||column_name||'_'||mc_month_slug, ',')
|
||||||
|
INTO numer_colnames_mc_current, numer_colnames_mc_qualified_current, numer_colnames_mc_normalized_current
|
||||||
|
FROM information_schema.columns
|
||||||
|
WHERE table_schema = mc_schema
|
||||||
|
AND table_name = mc_table
|
||||||
|
AND column_name = ANY(mc_measurements_categories);
|
||||||
|
|
||||||
|
IF numer_colnames_mc_current IS NOT NULL THEN
|
||||||
|
numer_colnames_mc := coalesce(numer_colnames_mc, '')||numer_colnames_mc_current||',';
|
||||||
|
END IF;
|
||||||
|
IF numer_colnames_mc_qualified_current IS NOT NULL THEN
|
||||||
|
numer_colnames_mc_qualified := coalesce(numer_colnames_mc_qualified, '')||numer_colnames_mc_qualified_current||',';
|
||||||
|
END IF;
|
||||||
|
IF numer_colnames_mc_normalized_current IS NOT NULL THEN
|
||||||
|
numer_colnames_mc_normalized := coalesce(numer_colnames_mc_normalized, '')||numer_colnames_mc_normalized_current||',';
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
IF mc_table IS NOT NULL THEN
|
||||||
|
numer_tablenames_mc := '"'||mc_schema||'".'||mc_table||' '||mc_table||'_'||mc_month_slug;
|
||||||
|
geom_relations_mc := mc_table||'_'||mc_month_slug||'.'||mc_geoid||'='||geom_geomref_colnames_qualified;
|
||||||
|
mc_table_categories := mc_table||'_'||mc_month_slug||'.'||mc_month_column||'='''||mc_month||'''';
|
||||||
|
|
||||||
|
geom_mc_outerjoins := coalesce(geom_mc_outerjoins, '')||' LEFT OUTER JOIN '||numer_tablenames_mc||' ON '||geom_relations_mc||' AND '||mc_table_categories;
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
---------Query build and execution---------
|
||||||
|
RETURN QUERY EXECUTE format(
|
||||||
|
$query$
|
||||||
|
SELECT mvtgeom,
|
||||||
|
(select row_to_json(_)::jsonb from (select id, %9$s %3$s area_ratio, area) as _) as mvtdata
|
||||||
|
FROM (
|
||||||
|
SELECT ST_AsMVTGeom(ST_Transform(the_geom, 3857), $1, $2, $3, $4) AS mvtgeom, %8$s as id, %6$s %7$s area_ratio, area FROM (
|
||||||
|
SELECT %1$s the_geom, %8$s, %2$s %10$s
|
||||||
|
CASE WHEN ST_Within($5, %1$s)
|
||||||
|
THEN ST_Area($5) / Nullif(ST_Area(%1$s), 0)
|
||||||
|
WHEN ST_Within(%1$s, $5)
|
||||||
|
THEN 1
|
||||||
|
ELSE ST_Area(ST_Intersection(st_simplifyvw(%1$s, $6), $5)) / Nullif(ST_Area(%1$s), 0)
|
||||||
|
END area_ratio,
|
||||||
|
ROUND(ST_Area(ST_Transform(the_geom,3857))::NUMERIC, 2) area
|
||||||
|
FROM %5$s
|
||||||
|
%4$s
|
||||||
|
%11$s
|
||||||
|
WHERE st_intersects(%1$s, $5)
|
||||||
|
) p
|
||||||
|
) q
|
||||||
|
$query$,
|
||||||
|
geom_colnames, numer_colnames_do_qualified, numer_colnames_mc, numer_tablenames_do_outer, geom_tablenames, numer_colnames_do_normalized,
|
||||||
|
numer_colnames_mc_normalized, geom_geomref_colnames, numer_colnames_do, numer_colnames_mc_qualified, geom_mc_outerjoins)
|
||||||
|
USING ext, extent, buf, clip_geom, geom, simplification_tolerance
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_GetMCDOMVT(
|
||||||
|
z INTEGER,
|
||||||
|
geography_level TEXT,
|
||||||
|
do_measurements TEXT[],
|
||||||
|
mc_measurements TEXT[],
|
||||||
|
mc_categories TEXT[] DEFAULT ARRAY['TR']::TEXT[],
|
||||||
|
mc_months TEXT[] DEFAULT ARRAY['2018-02-01']::TEXT[],
|
||||||
|
use_meta_cache BOOLEAN DEFAULT True,
|
||||||
|
shoreline_clipped BOOLEAN DEFAULT True,
|
||||||
|
optimize_clipping BOOLEAN DEFAULT False,
|
||||||
|
simplify_geometries BOOLEAN DEFAULT False,
|
||||||
|
area_normalized BOOLEAN DEFAULT False,
|
||||||
|
extent INTEGER DEFAULT 4096,
|
||||||
|
buf INTEGER DEFAULT 256,
|
||||||
|
clip_geom BOOLEAN DEFAULT True)
|
||||||
|
RETURNS TABLE (
|
||||||
|
x INTEGER,
|
||||||
|
y INTEGER,
|
||||||
|
zoom INTEGER,
|
||||||
|
mvtgeom GEOMETRY,
|
||||||
|
mvtdata JSONB
|
||||||
|
)
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
state_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.state';
|
||||||
|
county_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.county';
|
||||||
|
tract_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.census_tract';
|
||||||
|
blockgroup_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.block_group';
|
||||||
|
block_geoname CONSTANT TEXT DEFAULT 'us.census.tiger.block';
|
||||||
|
|
||||||
|
tiler_table_prefix CONSTANT TEXT DEFAULT 'tiler.xyz_us_do_geoms_tiles_temp_';
|
||||||
|
avg_x INTEGER;
|
||||||
|
avg_y INTEGER;
|
||||||
|
|
||||||
|
mc_schema CONSTANT TEXT DEFAULT 'us.mastercard';
|
||||||
|
mc_geoid CONSTANT TEXT DEFAULT 'region_id';
|
||||||
|
mc_category_column CONSTANT TEXT DEFAULT 'category';
|
||||||
|
mc_month_column CONSTANT TEXT DEFAULT 'month';
|
||||||
|
mc_table TEXT;
|
||||||
|
mc_category TEXT;
|
||||||
|
mc_category_name TEXT;
|
||||||
|
mc_table_categories TEXT DEFAULT '';
|
||||||
|
mc_month TEXT;
|
||||||
|
mc_month_slug TEXT;
|
||||||
|
mc_measurements_categories TEXT[];
|
||||||
|
mc_measurement TEXT;
|
||||||
|
|
||||||
|
measurement TEXT;
|
||||||
|
getmeta_parameters TEXT;
|
||||||
|
meta JSON;
|
||||||
|
mc_geography_level TEXT;
|
||||||
|
|
||||||
|
simplification_tolerance NUMERIC DEFAULT 0;
|
||||||
|
area_normalization TEXT DEFAULT '';
|
||||||
|
clipped TEXT default '';
|
||||||
|
i INTEGER DEFAULT 0;
|
||||||
|
|
||||||
|
bounds NUMERIC[];
|
||||||
|
geom GEOMETRY;
|
||||||
|
ext BOX2D;
|
||||||
|
|
||||||
|
numer_tablename_do TEXT DEFAULT '';
|
||||||
|
numer_tablenames_do TEXT[] DEFAULT ARRAY['']::TEXT[];
|
||||||
|
numer_tablenames_do_outer TEXT DEFAULT '';
|
||||||
|
numer_tablenames_mc TEXT DEFAULT '';
|
||||||
|
numer_colnames_do TEXT DEFAULT '';
|
||||||
|
numer_colnames_do_qualified TEXT DEFAULT '';
|
||||||
|
numer_colnames_do_normalized TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_current TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_qualified TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_qualified_current TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_normalized TEXT DEFAULT '';
|
||||||
|
numer_colnames_mc_normalized_current TEXT DEFAULT '';
|
||||||
|
geom_tablenames TEXT;
|
||||||
|
geom_colnames TEXT;
|
||||||
|
geom_geomref_colnames TEXT;
|
||||||
|
geom_geomref_colnames_qualified TEXT;
|
||||||
|
geom_relations_do TEXT[] DEFAULT ARRAY['']::TEXT[];
|
||||||
|
geom_relations_mc TEXT DEFAULT '';
|
||||||
|
geom_mc_outerjoins TEXT DEFAULT '';
|
||||||
|
BEGIN
|
||||||
|
IF geography_level = 'us.census.tiger.census_tract' THEN
|
||||||
|
mc_geography_level := 'tract';
|
||||||
|
ELSE
|
||||||
|
mc_geography_level := (string_to_array(geography_level, '.'))[array_length(string_to_array(geography_level, '.'), 1)];
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- Get the average x and y (in the middle of the BBox)
|
||||||
|
EXECUTE
|
||||||
|
format(
|
||||||
|
$query$
|
||||||
|
SELECT ROUND(AVG(x)) AS x, ROUND(AVG(y)) as y
|
||||||
|
FROM %3$s%1$s_%2$s
|
||||||
|
$query$, mc_geography_level, z, tiler_table_prefix)
|
||||||
|
INTO avg_x, avg_y;
|
||||||
|
|
||||||
|
IF area_normalized THEN
|
||||||
|
area_normalization := '/area_ratio';
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF shoreline_clipped THEN
|
||||||
|
clipped := '_clipped';
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
CASE
|
||||||
|
WHEN geography_level = state_geoname THEN
|
||||||
|
simplification_tolerance := 0.1;
|
||||||
|
IF optimize_clipping THEN
|
||||||
|
clipped := '';
|
||||||
|
END IF;
|
||||||
|
WHEN geography_level = county_geoname THEN
|
||||||
|
simplification_tolerance := 0.01;
|
||||||
|
WHEN geography_level = tract_geoname THEN
|
||||||
|
simplification_tolerance := 0.001;
|
||||||
|
WHEN geography_level = blockgroup_geoname THEN
|
||||||
|
simplification_tolerance := 0.0001;
|
||||||
|
WHEN geography_level = block_geoname THEN
|
||||||
|
simplification_tolerance := 0.0001;
|
||||||
|
ELSE
|
||||||
|
simplification_tolerance := 0;
|
||||||
|
END CASE;
|
||||||
|
|
||||||
|
IF NOT simplify_geometries THEN
|
||||||
|
simplification_tolerance := 0;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
bounds := cdb_observatory.OBS_GetTileBounds(z, avg_x, avg_y);
|
||||||
|
geom := ST_MakeEnvelope(bounds[1], bounds[2], bounds[3], bounds[4], 4326);
|
||||||
|
ext := ST_MakeBox2D(ST_Transform(ST_SetSRID(ST_Point(bounds[1], bounds[2]), 4326), 3857),
|
||||||
|
ST_Transform(ST_SetSRID(ST_Point(bounds[3], bounds[4]), 4326), 3857));
|
||||||
|
|
||||||
|
---------DO---------
|
||||||
|
getmeta_parameters := '[ ';
|
||||||
|
FOREACH measurement IN ARRAY do_measurements LOOP
|
||||||
|
getmeta_parameters := getmeta_parameters || '{"numer_id":"' || measurement || '","geom_id":"' || geography_level || clipped ||'"},';
|
||||||
|
END LOOP;
|
||||||
|
getmeta_parameters := substring(getmeta_parameters from 1 for length(getmeta_parameters) - 1) || ' ]';
|
||||||
|
|
||||||
|
IF use_meta_cache THEN
|
||||||
|
meta := cdb_observatory.OBS_RetrieveMeta(z, geom, getmeta_parameters::json, 1::integer, 1::integer, 1::integer);
|
||||||
|
ELSE
|
||||||
|
meta := cdb_observatory.obs_getmeta(geom, getmeta_parameters::json, 1::integer, 1::integer, 1::integer);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF meta IS NOT NULL THEN
|
||||||
|
SELECT array_agg(distinct 'observatory.'||numer_tablename) numer_tablenames,
|
||||||
|
string_agg(distinct numer_colname, ',')||',' numer_colnames,
|
||||||
|
string_agg(distinct numer_tablename||'.'||numer_colname, ',')||',' numer_colnames_qualified,
|
||||||
|
string_agg(distinct numer_colname||area_normalization||' '||numer_colname, ',')||',' numer_colnames_normalized,
|
||||||
|
(array_agg(distinct 'observatory.'||geom_tablename))[1] geom_tablenames,
|
||||||
|
(array_agg(distinct geom_colname))[1] geom_colnames,
|
||||||
|
(array_agg(distinct geom_geomref_colname))[1] geom_geomref_colnames,
|
||||||
|
(array_agg(distinct geom_tablename||'.'||geom_geomref_colname))[1] geom_geomref_colnames_qualified,
|
||||||
|
array_agg(distinct numer_tablename||'.'||numer_geomref_colname||'='||geom_tablename||'.'||geom_geomref_colname) geom_relations
|
||||||
|
INTO numer_tablenames_do, numer_colnames_do, numer_colnames_do_qualified, numer_colnames_do_normalized, geom_tablenames, geom_colnames,
|
||||||
|
geom_geomref_colnames, geom_geomref_colnames_qualified, geom_relations_do
|
||||||
|
FROM json_to_recordset(meta)
|
||||||
|
AS x(id TEXT, numer_id TEXT, numer_aggregate TEXT, numer_colname TEXT, numer_geomref_colname TEXT, numer_tablename TEXT,
|
||||||
|
numer_type TEXT, denom_id TEXT, denom_aggregate TEXT, denom_colname TEXT, denom_geomref_colname TEXT, denom_tablename TEXT,
|
||||||
|
denom_type TEXT, denom_reltype TEXT, geom_id TEXT, geom_colname TEXT, geom_geomref_colname TEXT, geom_tablename TEXT,
|
||||||
|
geom_type TEXT, numer_timespan TEXT, geom_timespan TEXT, normalization TEXT, api_method TEXT, api_args JSON);
|
||||||
|
|
||||||
|
IF numer_tablenames_do IS NULL OR numer_colnames_do IS NULL OR numer_colnames_do_qualified IS NULL OR numer_colnames_do_normalized IS NULL
|
||||||
|
OR geom_tablenames IS NULL OR geom_colnames IS NULL OR geom_geomref_colnames IS NULL OR geom_geomref_colnames_qualified IS NULL
|
||||||
|
OR geom_relations_do IS NULL THEN
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
i := 0;
|
||||||
|
FOREACH numer_tablename_do IN ARRAY numer_tablenames_do LOOP
|
||||||
|
i := i + 1;
|
||||||
|
numer_tablenames_do_outer := numer_tablenames_do_outer || 'LEFT OUTER JOIN ' || numer_tablename_do || ' ON ' || geom_relations_do[i] || ' ';
|
||||||
|
END LOOP;
|
||||||
|
ELSE
|
||||||
|
getmeta_parameters := '[{"geom_id":"' || geography_level || clipped ||'"}]';
|
||||||
|
meta := cdb_observatory.obs_getmeta(geom, getmeta_parameters::json, 1::integer, 1::integer, 1::integer);
|
||||||
|
|
||||||
|
IF meta IS NULL THEN
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SELECT (array_agg(distinct 'observatory.'||geom_tablename))[1] geom_tablenames,
|
||||||
|
(array_agg(distinct geom_colname))[1] geom_colnames,
|
||||||
|
(array_agg(distinct geom_geomref_colname))[1] geom_geomref_colnames,
|
||||||
|
(array_agg(distinct geom_tablename||'.'||geom_geomref_colname))[1] geom_geomref_colnames_qualified
|
||||||
|
FROM json_to_recordset(meta)
|
||||||
|
INTO geom_tablenames, geom_colnames, geom_geomref_colnames, geom_geomref_colnames_qualified
|
||||||
|
AS x(id TEXT, numer_id TEXT, numer_aggregate TEXT, numer_colname TEXT, numer_geomref_colname TEXT, numer_tablename TEXT,
|
||||||
|
numer_type TEXT, denom_id TEXT, denom_aggregate TEXT, denom_colname TEXT, denom_geomref_colname TEXT, denom_tablename TEXT,
|
||||||
|
denom_type TEXT, denom_reltype TEXT, geom_id TEXT, geom_colname TEXT, geom_geomref_colname TEXT, geom_tablename TEXT,
|
||||||
|
geom_type TEXT, numer_timespan TEXT, geom_timespan TEXT, normalization TEXT, api_method TEXT, api_args JSON);
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
---------MC---------
|
||||||
|
IF geography_level = 'us.census.tiger.census_tract' THEN
|
||||||
|
mc_geography_level := 'tract';
|
||||||
|
ELSE
|
||||||
|
mc_geography_level := (string_to_array(geography_level, '.'))[array_length(string_to_array(geography_level, '.'), 1)];
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
mc_table := cdb_observatory.OBS_GetMCTable(mc_schema, mc_geography_level);
|
||||||
|
|
||||||
|
FOREACH mc_month IN ARRAY mc_months LOOP
|
||||||
|
mc_month_slug := replace(mc_month, '/', '');
|
||||||
|
FOREACH mc_category IN ARRAY mc_categories LOOP
|
||||||
|
mc_category := lower(mc_category);
|
||||||
|
mc_measurements_categories := ARRAY['']::TEXT[];
|
||||||
|
|
||||||
|
FOREACH mc_measurement IN ARRAY mc_measurements LOOP
|
||||||
|
mc_measurements_categories := array_append(mc_measurements_categories, mc_measurement||'_'||mc_category);
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
SELECT string_agg(column_name||'_'||mc_month_slug, ','),
|
||||||
|
string_agg(mc_table||'_'||mc_month_slug||'.'||column_name||' '||column_name||'_'||mc_month_slug, ','),
|
||||||
|
string_agg(distinct column_name||'_'||mc_month_slug||area_normalization||' '||column_name||'_'||mc_month_slug, ',')
|
||||||
|
INTO numer_colnames_mc_current, numer_colnames_mc_qualified_current, numer_colnames_mc_normalized_current
|
||||||
|
FROM information_schema.columns
|
||||||
|
WHERE table_schema = mc_schema
|
||||||
|
AND table_name = mc_table
|
||||||
|
AND column_name = ANY(mc_measurements_categories);
|
||||||
|
|
||||||
|
IF numer_colnames_mc_current IS NOT NULL THEN
|
||||||
|
numer_colnames_mc := coalesce(numer_colnames_mc, '')||numer_colnames_mc_current||',';
|
||||||
|
END IF;
|
||||||
|
IF numer_colnames_mc_qualified_current IS NOT NULL THEN
|
||||||
|
numer_colnames_mc_qualified := coalesce(numer_colnames_mc_qualified, '')||numer_colnames_mc_qualified_current||',';
|
||||||
|
END IF;
|
||||||
|
IF numer_colnames_mc_normalized_current IS NOT NULL THEN
|
||||||
|
numer_colnames_mc_normalized := coalesce(numer_colnames_mc_normalized, '')||numer_colnames_mc_normalized_current||',';
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
IF mc_table IS NOT NULL THEN
|
||||||
|
numer_tablenames_mc := '"'||mc_schema||'".'||mc_table||' '||mc_table||'_'||mc_month_slug;
|
||||||
|
geom_relations_mc := mc_table||'_'||mc_month_slug||'.'||mc_geoid||'='||geom_geomref_colnames_qualified;
|
||||||
|
mc_table_categories := mc_table||'_'||mc_month_slug||'.'||mc_month_column||'='''||mc_month||'''';
|
||||||
|
|
||||||
|
geom_mc_outerjoins := coalesce(geom_mc_outerjoins, '')||' LEFT OUTER JOIN '||numer_tablenames_mc||' ON '||geom_relations_mc||' AND '||mc_table_categories;
|
||||||
|
END IF;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
---------Query build and execution---------
|
||||||
|
RETURN QUERY EXECUTE format(
|
||||||
|
$query$
|
||||||
|
SELECT x, y, z,
|
||||||
|
mvtgeom,
|
||||||
|
(select row_to_json(_)::jsonb from (select id, %9$s %3$s area_ratio, area) as _) as mvtdata
|
||||||
|
FROM (
|
||||||
|
SELECT x, y, z,
|
||||||
|
ST_AsMVTGeom(ST_Transform(the_geom, 3857),
|
||||||
|
bbox2d, $1, $2, $3) AS mvtgeom, %8$s as id, %6$s %7$s area_ratio, area FROM (
|
||||||
|
SELECT tx.x, tx.y, tx.z,
|
||||||
|
%1$s the_geom, %8$s, %2$s %10$s
|
||||||
|
CASE WHEN ST_Within(tx.envelope, %1$s)
|
||||||
|
THEN ST_Area(tx.envelope) / Nullif(ST_Area(%1$s), 0)
|
||||||
|
WHEN ST_Within(%1$s, tx.envelope)
|
||||||
|
THEN 1
|
||||||
|
ELSE ST_Area(ST_Intersection(st_simplifyvw(%1$s, $4), tx.envelope)) / Nullif(ST_Area(%1$s), 0)
|
||||||
|
END area_ratio,
|
||||||
|
ROUND(ST_Area(ST_Transform(the_geom,3857))::NUMERIC, 2) area,
|
||||||
|
ST_MakeBox2D(ST_Transform(ST_SetSRID(ST_Point(tx.bounds[1], tx.bounds[2]), 4326), 3857),
|
||||||
|
ST_Transform(ST_SetSRID(ST_Point(tx.bounds[3], tx.bounds[4]), 4326), 3857)) bbox2d
|
||||||
|
FROM tiler.xyz_us_mc_tiles_temp_%12$s_%13$s tx,
|
||||||
|
%5$s
|
||||||
|
%4$s
|
||||||
|
%11$s
|
||||||
|
WHERE st_intersects(%1$s, tx.envelope)
|
||||||
|
) p
|
||||||
|
) q
|
||||||
|
$query$,
|
||||||
|
geom_colnames, numer_colnames_do_qualified, numer_colnames_mc, numer_tablenames_do_outer, geom_tablenames, numer_colnames_do_normalized,
|
||||||
|
numer_colnames_mc_normalized, geom_geomref_colnames, numer_colnames_do, numer_colnames_mc_qualified, geom_mc_outerjoins,
|
||||||
|
mc_geography_level, z)
|
||||||
|
USING extent, buf, clip_geom, simplification_tolerance
|
||||||
|
RETURN;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE plpgsql PARALLEL RESTRICTED;
|
||||||
@@ -1,6 +1,167 @@
|
|||||||
-- Install dependencies
|
|
||||||
CREATE EXTENSION postgis;
|
|
||||||
CREATE EXTENSION plpythonu;
|
|
||||||
CREATE EXTENSION cartodb;
|
|
||||||
-- Install the extension
|
-- Install the extension
|
||||||
CREATE EXTENSION observatory VERSION 'dev';
|
\set ECHO none
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
set_config
|
||||||
|
------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
SET client_min_messages TO WARNING;
|
|
||||||
\set ECHO none
|
|
||||||
Loading fixtures...
|
|
||||||
Done.
|
|
||||||
@@ -1,79 +1,25 @@
|
|||||||
SELECT set_config(
|
\pset format unaligned
|
||||||
'search_path',
|
\set ECHO all
|
||||||
current_setting('search_path') || ',cdb_observatory',
|
SET client_min_messages TO WARNING;
|
||||||
false
|
\set ECHO none
|
||||||
) WHERE current_setting('search_path') !~ '(^|,)cdb_observatory(,|$)';
|
_obs_geomtable_with_returned_table
|
||||||
set_config
|
t
|
||||||
------------------------------------------
|
|
||||||
"$user", public, cartodb,cdb_observatory
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
_obs_geomtable_with_null_response
|
||||||
-- OBS_GeomTable
|
t
|
||||||
-- get table with known geometry_id
|
|
||||||
-- should give back a table like obs_{hex hash}
|
|
||||||
SELECT
|
|
||||||
cdb_observatory.OBS_GeomTable(
|
|
||||||
CDB_LatLng(40.7128,-74.0059),
|
|
||||||
'"us.census.tiger".census_tract'
|
|
||||||
);
|
|
||||||
obs_geomtable
|
|
||||||
----------------------------------------------
|
|
||||||
obs_a92e1111ad3177676471d66bb8036e6d057f271b
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
_obs_buildsnapshotquery_test_1
|
||||||
-- get null for unknown geometry_id
|
t
|
||||||
-- should give back null
|
|
||||||
SELECT
|
|
||||||
cdb_observatory.OBS_GeomTable(
|
|
||||||
CDB_LatLng(40.7128,-74.0059),
|
|
||||||
'"us.census.tiger".nonexistant_id'
|
|
||||||
);
|
|
||||||
obs_geomtable
|
|
||||||
---------------
|
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
_obs_buildsnapshotquery_test_2
|
||||||
-- OBS_GetColumnData
|
t
|
||||||
-- should give back:
|
|
||||||
-- colname | tablename | aggregate
|
|
||||||
-- -----------|-----------------|-----------
|
|
||||||
-- geoid | obs_{hex table} | null
|
|
||||||
-- total_pop | obs_{hex table} | sum
|
|
||||||
SELECT
|
|
||||||
(unnest(cdb_observatory.OBS_GetColumnData(
|
|
||||||
'"us.census.tiger".census_tract',
|
|
||||||
Array['"us.census.tiger".census_tract_geoid', '"us.census.acs".B01001001'],
|
|
||||||
'2009 - 2013'
|
|
||||||
))).*
|
|
||||||
ORDER BY 1 ASC;
|
|
||||||
colname | tablename | aggregate
|
|
||||||
-----------+----------------------------------------------+-----------
|
|
||||||
geoid | obs_11ee8b82c877c073438bc935a91d3dfccef875d1 |
|
|
||||||
geoid | obs_65f29658e096ca1485bf683f65fdbc9f05ec3c5d |
|
|
||||||
geoid | obs_ab038198aaab3f3cb055758638ee4de28ad70146 |
|
|
||||||
geoid | obs_d34555209878e8c4b37cf0b2b3d072ff129ec470 |
|
|
||||||
total_pop | obs_ab038198aaab3f3cb055758638ee4de28ad70146 | sum
|
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
-- OBS_LookupCensusHuman
|
|
||||||
-- should give back: {"\"us.census.acs\".B19083001"}
|
|
||||||
SELECT
|
|
||||||
cdb_observatory.OBS_LookupCensusHuman(
|
|
||||||
Array['gini_index']
|
|
||||||
);
|
|
||||||
obs_lookupcensushuman
|
|
||||||
---------------------------------
|
|
||||||
{"\"us.census.acs\".B19083001"}
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
_obs_standardizemeasurename_test
|
||||||
-- OBS_BuildSnapshotQuery
|
t
|
||||||
-- Should give back: SELECT vals[1] As total_pop, vals[2] As male_pop, vals[3] As female_pop, vals[4] As median_age
|
(1 row)
|
||||||
SELECT
|
obs_dumpversion_notnull
|
||||||
cdb_observatory.OBS_BuildSnapshotQuery(
|
t
|
||||||
Array['total_pop','male_pop','female_pop','median_age']
|
(1 row)
|
||||||
);
|
complex_safe_intersection_works
|
||||||
obs_buildsnapshotquery
|
t
|
||||||
-------------------------------------------------------------------------------------------------
|
|
||||||
SELECT vals[1] As total_pop, vals[2] As male_pop, vals[3] As female_pop, vals[4] As median_age
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,309 @@
|
|||||||
|
\pset format unaligned
|
||||||
|
\set ECHO none
|
||||||
|
obs_getdemographicsnapshot_test_no_returns
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
test_point_segmentation
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
null_island_segmentation
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_zhvi_point_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_zhvi_point_default_latest_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_pop_point_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_pop_point_null_normalization_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_pop_point_area_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_pop_polygon_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_pop_polygon_null_normalization_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_pop_polygon_area_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_male_point_denominator
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_total_male_poly_denominator
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_bad_geometry
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_null_geometry
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_out_of_bounds_geometry
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_estimate_for_blank_aggregate
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_per_capita_income_average
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasure_median_capita_income_average
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getcategory_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getcategory_polygon
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getcategory_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpopulation
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpopulation_polygon_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpopulation_polygon_null_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpopulation_polygon_null_geom_test
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getuscensusmeasure_point_male_pop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getuscensusmeasure
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getuscensusmeasure_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getuscensusmeasure_null_geom
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getuscensuscategory_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getuscensuscategory_polygon
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getuscensuscategory_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasurebyid_cartodb_census_tract
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasurebyid_null_boundary_null_timespan
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasurebyid_cartodb_block_group
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasurebyid_nulls
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeasurebyid_null_id
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_null_null_is_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_null_empty_is_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_nullisland_null_is_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_nullisland_empty_is_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_nullisland_us_measure_is_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
id|numer_id|timespan_rank|score_rank|numer_aggregate|numer_colname|numer_type|numer_name|denom_id|geom_id|normalization
|
||||||
|
t|t|t|t|t|t|t|t|t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|numer_id|timespan_rank|score_rank|numer_aggregate|numer_colname|numer_type|numer_name|denom_id|denom_aggregate|denom_colname|denom_type|denom_name|geom_id|normalization
|
||||||
|
t|t|t|t|t|t|t|t|t|t|t|t|t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|numer_id|timespan_rank|score_rank|numer_aggregate|numer_colname|numer_type|numer_name|denom_id|geom_id|normalization
|
||||||
|
t|t|t|t|t|t|t|t|t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|numer_id|timespan_rank|score_rank|numer_aggregate|numer_colname|numer_type|numer_name|denom_id|denom_aggregate|denom_colname|denom_type|denom_name|geom_id|normalization
|
||||||
|
t|t|t|t|t|t|t|t|t|t|t|t|t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|numer_id|timespan_rank|score_rank|numer_aggregate|numer_colname|numer_type|numer_name|denom_id|denom_aggregate|denom_colname|denom_type|denom_name|geom_id|normalization|id|numer_id|timespan_rank|score_rank|numer_aggregate|numer_colname|numer_type|numer_name|denom_id|denom_aggregate|denom_colname|denom_type|denom_name|geom_id|normalization
|
||||||
|
t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|numer_id|timespan_rank|score_rank|numer_aggregate|numer_colname|numer_type|numer_name|denom_id|denom_aggregate|denom_colname|denom_type|denom_name|geom_id|normalization
|
||||||
|
t|t|t|t|t|t|t|t|t|t|t|t|t|t|t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_conflicting_metadata
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_suggested_name
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_suggested_name_implicit_area
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_suggested_name_area
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getmeta_suggested_name_denom
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getdata_geomval_empty_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getdata_text_empty_null
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getdata_geomval_empty_one_measure
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
id|data_point_measure_null|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_null|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_point_measure_area|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
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)
|
||||||
|
id|data_point_measure_impossible_denominated|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_impossible_denominated|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_point_measure_denominated|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_denominated|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_one_null|data_polygon_measure_two_null
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_one_null|data_polygon_measure_two_null
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_one_predenom|data_polygon_measure_two_predenom
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_one_area|data_polygon_measure_two_area
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_polygon_measure_tract|data_polygon_measure_bg
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_point_categorical|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_poly_categorical|nullcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|data_poly_categorical|valcol
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|correct_num_geoms
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
id|correct_num_geoms|correct_pop
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|correct_num_geoms|correct_pop|correct_bg_names
|
||||||
|
t|t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|obs_getdata_by_id_one_measure_null
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
id|obs_getdata_by_id_one_measure_predenom
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
id|obs_getdata_by_id_one_measure_null|obs_getdata_by_id_two_measure_null
|
||||||
|
t|t|t
|
||||||
|
(1 row)
|
||||||
|
id|obs_getdata_by_id_categorical
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
id|obs_getdata_by_id_geometry
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
obs_getdata_api_geomvals_no_args
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
ary_type|obs_getdata_api_geomvals_args_numer_return
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
ary_type|obs_getdata_api_geomvals_args_string_return
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
ary_type|obs_getdata_api_geomrefs_args_numer_return
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
ary_type|obs_getdata_api_geomrefs_args_string_return
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
setseed
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
bg_sample|bg_max_error|bg_avg_error|bg_min_error
|
||||||
|
1|t|t|t
|
||||||
|
2|t|t|t
|
||||||
|
3|t|t|t
|
||||||
|
5|t|t|t
|
||||||
|
10|t|t|t
|
||||||
|
25|t|t|t
|
||||||
|
50|t|t|t
|
||||||
|
100|t|t|t
|
||||||
|
2085|t|t|t
|
||||||
|
(9 rows)
|
||||||
|
tract_sample|tract_max_error|tract_avg_error|tract_min_error
|
||||||
|
1|t|t|t
|
||||||
|
2|t|t|t
|
||||||
|
3|t|t|t
|
||||||
|
5|t|t|t
|
||||||
|
10|t|t|t
|
||||||
|
25|t|t|t
|
||||||
|
50|t|t|t
|
||||||
|
100|t|t|t
|
||||||
|
741|t|t|t
|
||||||
|
(9 rows)
|
||||||
|
no_bg_point_error
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
valid|errors
|
||||||
|
t|{}
|
||||||
|
(1 row)
|
||||||
|
valid|errors
|
||||||
|
f|{"Median or average aggregation only supports prenormalized normalization, denominated passed. Please review the provided options"}
|
||||||
|
(1 row)
|
||||||
|
valid|errors
|
||||||
|
f|{"Normalizated measure should have a numerator and a denominator. Please review the provided options."}
|
||||||
|
(1 row)
|
||||||
@@ -0,0 +1,290 @@
|
|||||||
|
\pset format unaligned
|
||||||
|
\set ECHO none
|
||||||
|
_obs_searchtables_tables_match|_obs_searchtables_timespan_matches
|
||||||
|
t|t
|
||||||
|
(1 row)
|
||||||
|
_obs_searchtables_timespan_does_not_match
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_searchtotalpop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailableboundariesexist
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_usa_pop_in_all
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_usa_pop_in_nyc_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_usa_pop_in_usa_extents
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_no_usa_pop_not_in_zero_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_usa_pop_in_age_gender_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_no_pop_in_income_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_male_pop_denom_by_total_pop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_no_income_denom_by_total_pop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_zillow_at_zcta5
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_no_zillow_at_block_group
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_total_pop_2010_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablenumerators_no_total_pop_1996
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_usa_pop_in_all
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_usa_pop_in_nyc_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_usa_pop_in_usa_extents
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_no_usa_pop_not_in_zero_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_usa_pop_in_age_gender_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_no_pop_in_income_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_male_pop_denom_by_total_pop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_no_income_denom_by_total_pop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_zillow_at_zcta5
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_no_zillow_at_block_group
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_2010_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_no_total_pop_1996
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_by_name
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_by_section
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_not_in_canada
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_by_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_not_in_employment_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_by_id
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getnumerators_total_pop_not_with_other_id
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_usa_pop_in_all
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_usa_pop_in_nyc_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_usa_pop_in_usa_extents
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_no_usa_pop_not_in_zero_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_usa_pop_in_age_gender_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_no_pop_in_income_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_male_pop_denom_by_total_pop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_no_income_denom_by_total_pop
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_at_zcta5
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_none_spanish_geom
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_total_pop_2010_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabledenominators_no_total_pop_1996
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_usa_bg_in_all
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_usa_bg_in_nyc_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_usa_bg_in_usa_extents
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_no_usa_bg_not_in_zero_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_usa_bg_in_boundary_subsection
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_no_bg_in_uk_section
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_total_pop_in_usa_bg
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_foobarbaz_not_in_usa_bg
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_total_pop_denom_in_usa_bg
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_foobarbaz_denom_not_in_usa_bg
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_bg_2015
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_bg_not_1996
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_has_boundary_tag
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabletimespans_2010_2014_in_all
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabletimespans_2010_2014_in_nyc_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabletimespans_2010_2014_in_usa_extents
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabletimespans_no_usa_bg_not_in_zero_point
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabletimespans_total_pop_in_2010_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailabletimespans_foobarbaz_not_in_2010_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_total_pop_denom_in_2010_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getavailablegeometries_foobarbaz_denom_not_in_2010_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_500m_buffer
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_5km_buffer
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_50km_buffer
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_500km_buffer
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_2500km_buffer
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
column_id|_obs_geometryscores_numgeoms_500m_buffer
|
||||||
|
us.census.tiger.block_group|2
|
||||||
|
us.census.tiger.census_tract|1
|
||||||
|
us.census.tiger.zcta5|0
|
||||||
|
us.census.tiger.county|0
|
||||||
|
(4 rows)
|
||||||
|
column_id|_obs_geometryscores_numgeoms_5km_buffer
|
||||||
|
us.census.tiger.block_group|244
|
||||||
|
us.census.tiger.census_tract|78
|
||||||
|
us.census.tiger.zcta5|9
|
||||||
|
us.census.tiger.county|0
|
||||||
|
(4 rows)
|
||||||
|
column_id|_obs_geometryscores_numgeoms_50km_buffer
|
||||||
|
us.census.tiger.block_group|10818
|
||||||
|
us.census.tiger.census_tract|3396
|
||||||
|
us.census.tiger.zcta5|483
|
||||||
|
us.census.tiger.county|11
|
||||||
|
(4 rows)
|
||||||
|
column_id|_obs_geometryscores_numgeoms_500km_buffer
|
||||||
|
us.census.tiger.block_group|48569
|
||||||
|
us.census.tiger.census_tract|15825
|
||||||
|
us.census.tiger.zcta5|6465
|
||||||
|
us.census.tiger.county|295
|
||||||
|
(4 rows)
|
||||||
|
column_id|_obs_geometryscores_numgeoms_2500km_buffer
|
||||||
|
us.census.tiger.block_group|165852
|
||||||
|
us.census.tiger.census_tract|55283
|
||||||
|
us.census.tiger.zcta5|26529
|
||||||
|
us.census.tiger.county|2551
|
||||||
|
(4 rows)
|
||||||
|
_obs_geometryscores_500km_buffer_50_geoms
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_500km_buffer_500_geoms
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_500km_buffer_2500_geoms
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_geometryscores_500km_buffer_25000_geoms
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
testarea_uses_tract
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
points_use_bg
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_total_pop_in_legacy_builder_metadata
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_median_income_in_legacy_builder_metadata
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_gini_in_legacy_builder_metadata
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_total_pop_in_legacy_builder_metadata_sums
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_median_income_in_legacy_builder_metadata_sums
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_gini_not_in_legacy_builder_metadata_sums
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_no_dupe_subsections_in_legacy_builder_metadata
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
\pset format unaligned
|
||||||
|
\set ECHO none
|
||||||
|
obs_getboundary_cartodb_census_tract
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundary_cartodb_county
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundary_non_existent_boundary_id
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundary_null_island_census_tract
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundary_year_census_tract
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundary_unlisted_year
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundaryid_cartodb_census_tract
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundaryid_cartodb_census_tract_with_year
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundaryid_cartodb_county_with_year
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundaryid_null_island
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundarybyid_cartodb_county
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundarybyid_compared_with_obs_getboundary
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundarybyid_boundary_id_mismatch_geom_id
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundarybyid_boundary_id_mismatch_geom_id
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getboundariesbygeometry_tracts_around_cartodb
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getboundariesbygeometry_tracts_around_null_island
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundariesbygeometry_tracts_around_cartodb
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundariesbygeometry_tracts_around_null_island
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundariesbypointandradius_around_cartodb
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getboundariesbypointandradius_around_null_island
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getpointsbygeometry_around_cartodb
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
_obs_getpointsbygeometry_around_null_island
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpointsbygeometry_around_cartodb
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpointsbygeometry_around_cartodb_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpointsbygeometry_around_null_island
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpointsbypointandradius_around_cartodb
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpointsbypointandradius_around_cartodb_2014
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
obs_getpointsbypointandradius_around_null_island
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
SET client_min_messages TO WARNING;
|
||||||
|
\set ECHO none
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_table;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_column_table;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_column;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_column_tag;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_tag;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_column_to_column;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_dump_version;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_meta;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_table_to_table;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_meta_numer;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_meta_denom;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_meta_geom;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_meta_timespan;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_meta_geom_numer_timespan;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_column_table_tile;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_column_table_tile_simple;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_78fb6c1d6ff6505225175922c2c389ce48d7632c;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_fae094ddb7157380e2495b9867e1f067fdbdf288;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_d03c931c9b7f9df54c3fae95bb7f958fe3187c71;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_a6811c89ed79ab4339d89a86907b586439cc74df;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_d39f7fe5959891c8296490d83c22ded31c54af13;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_3b537fe9a1dcdd3be4a53f64429e30a836ecb6ee;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_c4411eba732408d47d73281772dbf03d60645dec;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_a01cd5d8ccaa6531cef715071e9307e6b1987ec3;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_1746e37b7cd28cb131971ea4187d42d71f09c5f3;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_8e30e6b3792430b410ba5b9e49cdc6a0d404d48f;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_1a098da56badf5f32e336002b0a81708c40d29cd;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_87a814e485deabe3b12545a537f693d16ca702c2;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_65f29658e096ca1485bf683f65fdbc9f05ec3c5d;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_9b319c207dfa600c2296a6d46055e54a4c00f646;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_9b319c207dfa600c2296a6d46055e54a4c00f646;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_0310c639744a2014bb1af82709228f05b59e7d3d;
|
||||||
|
DROP TABLE IF EXISTS observatory.obs_b393b5b88c6adda634b2071a8005b03c551b609a;
|
||||||
+188043
File diff suppressed because one or more lines are too long
Vendored
-841
@@ -1,841 +0,0 @@
|
|||||||
|
|
||||||
CREATE TABLE obs_column (cartodb_id bigint, the_geom geometry, the_geom_webmercator geometry, id text, type text, name text, description text, weight numeric, aggregate text, version text, extra json);
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (590, NULL, NULL, '"us.census.tiger".geom', 'Geometry', NULL, NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (628, NULL, NULL, '"us.census.acs".B15001027', 'Numeric', 'Men age 45 to 64 ("middle aged")', '0', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (661, NULL, NULL, '"us.ny.nyc.opendata".document_id', 'Text', 'Document ID', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (752, NULL, NULL, '"us.census.acs".B25075001_quantile', 'Numeric', 'Quantile:Owner-occupied Housing Units', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (1, NULL, NULL, '"es.ine".gender', 'Text', 'Gender', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (2, NULL, NULL, '"es.ine".total_pop', 'Numeric', 'Total Population', 'The total number of all people living in a geographic area.', 10, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (3, NULL, NULL, '"es.ine".pop_100_more', 'Numeric', 'Population age 100 or more', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (4, NULL, NULL, '"es.ine".pop_0_4', 'Numeric', 'Population age 0 to 4', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (5, NULL, NULL, '"es.ine".pop_5_9', 'Numeric', 'Population age 5 to 9', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (6, NULL, NULL, '"es.ine".pop_10_14', 'Numeric', 'Population age 10 to 14', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (7, NULL, NULL, '"es.ine".pop_15_19', 'Numeric', 'Population age 15 to 19', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (8, NULL, NULL, '"es.ine".pop_20_24', 'Numeric', 'Population age 20 to 24', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (9, NULL, NULL, '"es.ine".pop_25_29', 'Numeric', 'Population age 25 to 29', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (10, NULL, NULL, '"es.ine".pop_30_34', 'Numeric', 'Population age 30 to 34', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (11, NULL, NULL, '"es.ine".pop_35_39', 'Numeric', 'Population age 35 to 39', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (12, NULL, NULL, '"es.ine".pop_40_44', 'Numeric', 'Population age 40 to 44', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (13, NULL, NULL, '"es.ine".pop_45_49', 'Numeric', 'Population age 45 to 49', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (14, NULL, NULL, '"es.ine".pop_50_54', 'Numeric', 'Population age 50 to 54', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (15, NULL, NULL, '"es.ine".pop_55_59', 'Numeric', 'Population age 55 to 59', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (16, NULL, NULL, '"es.ine".pop_60_64', 'Numeric', 'Population age 60 to 64', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (17, NULL, NULL, '"es.ine".pop_65_69', 'Numeric', 'Population age 65 to 69', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (18, NULL, NULL, '"es.ine".pop_70_74', 'Numeric', 'Population age 70 to 74', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (19, NULL, NULL, '"es.ine".pop_75_79', 'Numeric', 'Population age 75 to 79', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (20, NULL, NULL, '"es.ine".pop_80_84', 'Numeric', 'Population age 80 to 84', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (21, NULL, NULL, '"es.ine".pop_85_89', 'Numeric', 'Population age 85 to 89', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (22, NULL, NULL, '"es.ine".pop_90_94', 'Numeric', 'Population age 90 to 94', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (23, NULL, NULL, '"es.ine".pop_95_99', 'Numeric', 'Population age 95 to 99', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (24, NULL, NULL, '"us.census.lodes".total_jobs', 'Integer', 'Total Jobs', 'Total number of jobs', 8, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (25, NULL, NULL, '"us.census.lodes".jobs_firm_age_500_more_employees', 'Integer', 'Jobs at firms with 500 Employees', 'Number of jobs for workers at firms with Firm Size: 500 Employees', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (26, NULL, NULL, '"us.census.lodes".jobs_age_29_or_younger', 'Integer', 'Jobs for workers age 29 or younger', 'Number of jobs of workers age 29 or younger', 3, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (27, NULL, NULL, '"us.census.lodes".jobs_age_30_to_54', 'Integer', 'Jobs for workers age 30 to 54', 'Number of jobs for workers age 30 to 54', 3, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (28, NULL, NULL, '"us.census.lodes".jobs_age_55_or_older', 'Integer', 'Jobs for workers age 55 or older', 'Number of jobs for workers age 55 or older', 3, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (29, NULL, NULL, '"us.census.lodes".jobs_earning_15000_or_less', 'Integer', 'Jobs earning up to $15,000 per year', 'Number of jobs with earnings $1250/month or less ($15,000 per year)', 3, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (30, NULL, NULL, '"us.census.lodes".jobs_earning_15001_to_40000', 'Integer', 'Jobs earning $15,000 to $40,000 per year', 'Number of jobs with earnings $1251/month to $3333/month ($15,000 to $40,000 per year)', 5, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (31, NULL, NULL, '"us.census.lodes".jobs_earning_40001_or_more', 'Integer', 'Jobs with earnings greater than $40,000 per year', 'Number of Jobs with earnings greater than $3333/month', 5, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (32, NULL, NULL, '"us.census.lodes".jobs_11_agriculture_forestry_fishing', 'Integer', 'Agriculture, Forestry, Fishing and Hunting jobs', 'Number of jobs in NAICS sector 11 (Agriculture, Forestry, Fishing and Hunting)', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (33, NULL, NULL, '"us.census.lodes".jobs_21_mining_quarrying_oil_gas', 'Integer', 'Mining, Quarrying, and Oil and Gas Extraction jobs', 'Number of jobs in NAICS sector 21 (Mining, Quarrying, and Oil and Gas Extraction) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (34, NULL, NULL, '"us.census.lodes".jobs_22_utilities', 'Integer', 'Utilities Jobs', 'Number of jobs in NAICS sector 22 (Utilities) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (35, NULL, NULL, '"us.census.lodes".jobs_23_construction', 'Integer', 'Construction Jobs', 'Number of jobs in NAICS sector 23 (Construction) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (36, NULL, NULL, '"us.census.lodes".jobs_31_33_manufacturing', 'Integer', 'Manufacturing Jobs', 'Number of jobs in NAICS sector 31-33 (Manufacturing) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (37, NULL, NULL, '"us.census.lodes".jobs_42_wholesale_trade', 'Integer', 'Wholesale Trade Jobs', 'Number of jobs in NAICS sector 42 (Wholesale Trade) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (38, NULL, NULL, '"us.census.lodes".jobs_44_45_retail_trade', 'Integer', 'Retail Trade Jobs', 'Number of jobs in NAICS sector 44-45 (Retail Trade) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (39, NULL, NULL, '"us.census.lodes".jobs_48_49_transport_warehousing', 'Integer', 'Transport and Warehousing Jobs', 'Number of jobs in NAICS sector 48-49 (Transportation and Warehousing) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (40, NULL, NULL, '"us.census.lodes".jobs_51_information', 'Integer', 'Information Jobs', 'Number of jobs in NAICS sector 51 (Information) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (41, NULL, NULL, '"us.census.lodes".jobs_52_finance_and_insurance', 'Integer', 'Finance and Insurance Jobs', 'Number of jobs in NAICS sector 52 (Finance and Insurance)', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (42, NULL, NULL, '"us.census.lodes".jobs_53_real_estate_rental_leasing', 'Integer', 'Real Estate and Rental and Leasing Jobs', 'Number of jobs in NAICS sector 53 (Real Estate and Rental and Leasing) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (43, NULL, NULL, '"us.census.lodes".jobs_54_professional_scientific_tech_services', 'Integer', 'Professional, Scientific, and Technical Services Jobs', 'Number of jobs in NAICS sector 54 (Professional, Scientific, and Technical Services) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (44, NULL, NULL, '"us.census.lodes".jobs_55_management_of_companies_enterprises', 'Integer', 'Management of Companies and Enterprises Jobs', 'Number of jobs in NAICS sector 55 (Management of Companies and Enterprises) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (45, NULL, NULL, '"us.census.lodes".jobs_56_admin_support_waste_management', 'Integer', 'Administrative and Support and Waste Management and Remediation Services Jobs', 'Number of jobs in NAICS sector 56 (Administrative and Support and Waste Management and Remediation Services) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (46, NULL, NULL, '"us.census.lodes".jobs_61_educational_services', 'Integer', 'Educational Services Jobs', 'Number of jobs in NAICS sector 61 (Educational Services) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (47, NULL, NULL, '"us.census.lodes".jobs_62_healthcare_social_assistance', 'Integer', 'Health Care and Social Assistance Jobs', 'Number of jobs in NAICS sector 62 (Health Care and Social Assistance) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (48, NULL, NULL, '"us.census.lodes".jobs_71_arts_entertainment_recreation', 'Integer', 'Arts, Entertainment, and Recreation jobs', 'Number of jobs in NAICS sector 71 (Arts, Entertainment, and Recreation) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (49, NULL, NULL, '"us.census.lodes".jobs_72_accommodation_and_food', 'Integer', 'Accommodation and Food Services jobs', 'Number of jobs in NAICS sector 72 (Accommodation and Food Services) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (119, NULL, NULL, '"us.census.acs".B01001015', 'Numeric', 'Men age 45 to 49', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (50, NULL, NULL, '"us.census.lodes".jobs_81_other_services_except_public_admin', 'Integer', 'Other Services (except Public Administration) jobs', 'Jobs in NAICS sector 81 (Other Services [except Public Administration])', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (51, NULL, NULL, '"us.census.lodes".jobs_92_public_administration', 'Integer', 'Public Administration jobs', 'Number of jobs in NAICS sector 92 (Public Administration) ', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (52, NULL, NULL, '"us.census.lodes".jobs_white', 'Integer', 'Jobs held by workers who are white', 'Number of jobs for workers with Race: White, Alone', 2, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (53, NULL, NULL, '"us.census.lodes".jobs_black', 'Integer', 'Jobs held by workers who are black', 'Number of jobs for workers with Race: Black or African American Alone', 2, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (54, NULL, NULL, '"us.bls".industry_code', 'Text', 'Six-digit NAICS Industry Code', '6-character Industry Code (NAICS SuperSector)', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (55, NULL, NULL, '"us.census.tiger".county', 'Geometry', 'US County', 'The primary legal divisions of most states are termed counties. In Louisiana, these divisions are known as parishes. In Alaska, which has no counties, the equivalent entities are the organized boroughs, city and boroughs, municipalities, and census areas; the latter of which are delineated cooperatively for statistical purposes by the state of Alaska and the Census Bureau. In four states (Maryland, Missouri, Nevada, and Virginia), there are one or more incorporated places that are independent of any county organization and thus constitute primary divisions of their states. These incorporated places are known as independent cities and are treated as equivalent entities for purposes of data presentation. The District of Columbia and Guam have no primary divisions, and each area is considered an equivalent entity for purposes of data presentation. All of the counties in Connecticut and Rhode Island and nine counties in Massachusetts were dissolved as functioning governmental entities; however, the Census Bureau continues to present data for these historical entities in order to provide comparable geographic units at the county level of the geographic hierarchy for these states and represents them as nonfunctioning legal entities in data products. The Census Bureau treats the following entities as equivalents of counties for purposes of data presentation: municipios in Puerto Rico, districts and islands in American Samoa, municipalities in the Commonwealth of the Northern Mariana Islands, and islands in the U.S. Virgin Islands. Each county or statistically equivalent entity is assigned a three-character numeric Federal Information Processing Series (FIPS) code based on alphabetical sequence that is unique within state and an eight-digit National Standard feature identifier.', 7, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (56, NULL, NULL, '"us.census.tiger".state', 'Geometry', 'US States', 'States and Equivalent Entities are the primary governmental divisions of the United States. In addition to the 50 states, the Census Bureau treats the District of Columbia, Puerto Rico, American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands as the statistical equivalents of states for the purpose of data presentation.', 8, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (57, NULL, NULL, '"us.census.tiger".puma', 'Geometry', 'US Census Public Use Microdata Areas', 'PUMAs are geographic areas for which the Census Bureau provides selected extracts of raw data from a small sample of census records that are screened to protect confidentiality. These extracts are referred to as public use microdata sample (PUMS) files.
|
|
||||||
|
|
||||||
For the 2010 Census, each state, the District of Columbia, Puerto Rico, and some Island Area participants delineated PUMAs for use in presenting PUMS data based on a 5 percent sample of decennial census or American Community Survey data. These areas are required to contain at least 100,000 people. This is different from Census 2000 when two types of PUMAs were defined: a 5 percent PUMA as for 2010 and an additional super-PUMA designed to provide a 1 percent sample. The PUMAs are identified by a five-digit census code unique within state.', 6, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (58, NULL, NULL, '"us.census.tiger".block_group', 'Geometry', 'US Census Block Groups', 'Block groups (BGs) are statistical divisions of census tracts, are generally defined to contain between 600 and 3,000 people, and are used to present data and control block numbering. A block group consists of clusters of blocks within the same census tract that have the same first digit of their four-digit census block number. For example, blocks 3001, 3002, 3003, ..., 3999 in census tract 1210.02 belong to BG 3 in that census tract. Most BGs were delineated by local participants in the Census Bureau\u2019s Participant Statistical Areas Program. The Census Bureau delineated BGs only where a local or tribal government declined to participate, and a regional organization or State Data Center was not available to participate.
|
|
||||||
|
|
||||||
A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county.', 10, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (59, NULL, NULL, '"us.census.tiger".census_tract', 'Geometry', 'US Census Tracts', 'Census tracts are identified by an up to four-digit integer number and may have an optional two-digit suffix; for example 1457.02 or 23. The census tract codes consist of six digits with an implied decimal between the fourth and fifth digit corresponding to the basic census tract number but with leading zeroes and trailing zeroes for census tracts without a suffix. The tract number examples above would have codes of 145702 and 002300, respectively.
|
|
||||||
|
|
||||||
Some ranges of census tract numbers in the 2010 Census are used to identify distinctive types of census tracts. The code range in the 9400s is used for those census tracts with a majority of population, housing, or land area associated with an American Indian area and matches the numbering used in Census 2000. The code range in the 9800s is new for 2010 and is used to specifically identify special land-use census tracts; that is, census tracts defined to encompass a large area with little or no residential population with special characteristics, such as large parks or employment areas. The range of census tracts in the 9900s represents census tracts delineated specifically to cover large bodies of water. This is different from Census 2000 when water-only census tracts were assigned codes of all zeroes (000000); 000000 is no longer used as a census tract code for the 2010 Census.
|
|
||||||
|
|
||||||
The Census Bureau uses suffixes to help identify census tract changes for comparison purposes. Census tract suffixes may range from .01 to .98. As part of local review of existing census tracts before each census, some census tracts may have grown enough in population size to qualify as more than one census tract. When a census tract is split, the split parts usually retain the basic number but receive different suffixes. For example, if census tract 14 is split, the new tract numbers would be 14.01 and 14.02. In a few counties, local participants request major changes to, and renumbering of, the census tracts; however, this is generally discouraged. Changes to individual census tract boundaries usually do not result in census tract numbering changes.
|
|
||||||
|
|
||||||
The Census Bureau introduced the concept of tribal census tracts for the first time for Census 2000. Tribal census tracts for that census consisted of the standard county-based census tracts tabulated within American Indian areas, thus allowing for the tracts to ignore state and county boundaries for tabulation. The Census Bureau assigned the 9400 range of numbers to identify specific tribal census tracts; however, not all tribal census tracts used this numbering scheme. For the 2010 Census, tribal census tracts no longer are tied to or numbered in the same way as the county-based census tracts (see \u201cTribal Census Tract\u201d).', 9, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (60, NULL, NULL, '"us.census.tiger".congressional_district', 'Geometry', 'US Congressional Districts', 'Congressional districts are identified by a two-character numeric Federal Information Processing Series (FIPS) code numbered uniquely within the state. The District of Columbia, Puerto Rico, and the Island Areas have code 98 assigned identifying their nonvoting delegate status with respect to representation in Congress:
|
|
||||||
|
|
||||||
01 to 53: Congressional district codes
|
|
||||||
00: At large (single district for state)
|
|
||||||
98: Nonvoting delegate', 5, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (61, NULL, NULL, '"us.census.lodes".jobs_amerindian', 'Integer', 'Jobs held by workers who are American Indian or Alaska Native Alone', 'Number of jobs for workers with Race: American Indian or Alaska Native Alone', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (62, NULL, NULL, '"us.census.lodes".jobs_asian', 'Integer', 'Jobs held by workers who are Asian', 'Number of jobs for workers with Race: Asian Alone', 2, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (63, NULL, NULL, '"us.census.lodes".jobs_hawaiian', 'Integer', 'Jobs held by workers who are Native Hawaiian or Other Pacific Islander Alone', 'Number of jobs for workers with Race: Native Hawaiian or Other Pacific Islander Alone', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (64, NULL, NULL, '"us.census.lodes".jobs_two_or_more_races', 'Integer', 'Jobs held by workers who reported Two or More Race Groups', 'Number of jobs for workers with Race: Two or More Race Groups', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (128, NULL, NULL, '"us.census.acs".B01001H012', 'Numeric', 'White Men age 45 to 54', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (65, NULL, NULL, '"us.census.lodes".jobs_not_hispanic', 'Integer', 'Jobs held by workers who are Not Hispanic or Latino', 'Number of jobs for workers with Ethnicity: Not Hispanic or Latino', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (66, NULL, NULL, '"us.census.acs".B01001001', 'Numeric', 'Total Population', 'The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.', 10, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (67, NULL, NULL, '"us.census.acs".B15001034', 'Numeric', 'Men age 45 to 64 who obtained a graduate or professional degree', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (68, NULL, NULL, '"us.census.acs".B01001002', 'Numeric', 'Male Population', 'The number of people within each geography who are male.', 8, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (69, NULL, NULL, '"us.census.acs".B01001026', 'Numeric', 'Female Population', 'The number of people within each geography who are female.', 8, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (70, NULL, NULL, '"us.census.acs".B01002001', 'Numeric', 'Median Age', 'The median age of all people in a given geographic area.', 2, 'median', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (71, NULL, NULL, '"us.census.acs".B03002003', 'Numeric', 'White Population', 'The number of people identifying as white, non-Hispanic in each geography.', 7, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (72, NULL, NULL, '"us.census.acs".B03002004', 'Numeric', 'Black or African American Population', 'The number of people identifying as black or African American, non-Hispanic in each geography.', 7, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (73, NULL, NULL, '"us.census.acs".B03002006', 'Numeric', 'Asian Population', 'The number of people identifying as Asian, non-Hispanic in each geography.', 7, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (74, NULL, NULL, '"us.census.acs".B03002012', 'Numeric', 'Hispanic Population', 'The number of people identifying as Hispanic or Latino in each geography.', 7, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (75, NULL, NULL, '"us.census.acs".B05001006', 'Numeric', 'Not a U.S. Citizen Population', 'The number of people within each geography who indicated that they are not U.S. citizens.', 3, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (76, NULL, NULL, '"us.census.acs".B08006017', 'Numeric', 'Worked at Home', 'The count within a geographical area of workers over the age of 16 who worked at home.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (77, NULL, NULL, '"us.census.acs".B08006008', 'Numeric', 'Commuters by Public Transportation', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by public transportation. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (78, NULL, NULL, '"us.census.acs".B08006015', 'Numeric', 'Walked to Work', 'The number of workers age 16 years and over within a geographic area who primarily walked to work. This would mean that of any way of getting to work, they travelled the most distance walking.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (79, NULL, NULL, '"us.census.acs".B08006009', 'Numeric', 'Commuters by Bus', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by bus. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport.', 3, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (80, NULL, NULL, '"us.census.acs".B08006011', 'Numeric', 'Commuters by Subway or Elevated', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by subway or elevated train. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport.', 3, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (81, NULL, NULL, '"us.census.acs".B09001001', 'Numeric', 'children under 18 Years of Age', 'The number of people within each geography who are under 18 years of age.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (82, NULL, NULL, '"us.census.acs".B14001001', 'Numeric', 'Population 3 Years and Over', 'The total number of people in each geography age 3 years and over. This denominator is mostly used to calculate rates of school enrollment.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (83, NULL, NULL, '"us.census.acs".B14001002', 'Numeric', 'Students Enrolled in School', 'The total number of people in each geography currently enrolled at any level of school, from nursery or pre-school to advanced post-graduate education. Only includes those over the age of 3.', 6, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (84, NULL, NULL, '"us.census.acs".B14001008', 'Numeric', 'Students Enrolled as Undergraduate in College', 'The number of people in a geographic area who are enrolled in college at the undergraduate level. Enrollment refers to being registered or listed as a student in an educational program leading to a college degree. This may be a public school or college, a private school or college.', 5, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (85, NULL, NULL, '"us.census.acs".B14001005', 'Numeric', 'Students Enrolled in Grades 1 to 4', 'The total number of people in each geography currently enrolled in grades 1 through 4 inclusive. This corresponds roughly to elementary school.', 3, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (86, NULL, NULL, '"us.census.acs".B14001006', 'Numeric', 'Students Enrolled in Grades 5 to 8', 'The total number of people in each geography currently enrolled in grades 5 through 8 inclusive. This corresponds roughly to middle school.', 3, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (87, NULL, NULL, '"us.census.acs".B14001007', 'Numeric', 'Students Enrolled in Grades 9 to 12', 'The total number of people in each geography currently enrolled in grades 9 through 12 inclusive. This corresponds roughly to high school.', 3, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (88, NULL, NULL, '"us.census.acs".B15003001', 'Numeric', 'Population 25 Years and Over', 'The number of people in a geographic area who are over the age of 25. This is used mostly as a denominator of educational attainment.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (89, NULL, NULL, '"us.census.acs".B15003023', 'Numeric', 'Population Completed Master''s Degree', 'The number of people in a geographic area over the age of 25 who obtained a master''s degree, but did not complete a more advanced degree.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (90, NULL, NULL, '"us.census.acs".B15003017', 'Numeric', 'Population Completed High School', 'The number of people in a geographic area over the age of 25 who completed high school, and did not complete a more advanced degree.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (91, NULL, NULL, '"us.census.acs".B15003022', 'Numeric', 'Population Completed Bachelor''s Degree', 'The number of people in a geographic area over the age of 25 who obtained a bachelor''s degree, and did not complete a more advanced degree.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (120, NULL, NULL, '"us.census.acs".B01001016', 'Numeric', 'Men age 50 to 54', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (92, NULL, NULL, '"us.census.acs".B16001001', 'Numeric', 'Population 5 Years and Over', 'The number of people in a geographic area who are over the age of 5. This is primarily used as a denominator of measures of language spoken at home.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (93, NULL, NULL, '"us.census.acs".B16001003', 'Numeric', 'Speaks Spanish at Home', 'The number of people in a geographic area over age 5 who speak Spanish at home, possibly in addition to other languages.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (94, NULL, NULL, '"us.census.acs".B01001H013', 'Numeric', 'White Men age 55 to 64', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (95, NULL, NULL, '"us.census.acs".B16001002', 'Numeric', 'Speaks only English at Home', 'The number of people in a geographic area over age 5 who speak only English at home.', 3, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (129, NULL, NULL, '"us.census.acs".B01001D012', 'Numeric', 'Asian Men age 45 to 54', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (96, NULL, NULL, '"us.census.acs".B17001001', 'Numeric', 'Population for Whom Poverty Status Determined', 'The number of people in each geography who could be identified as either living in poverty or not. This should be used as the denominator when calculating poverty rates, as it excludes people for whom it was not possible to determine poverty.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (97, NULL, NULL, '"us.census.acs".B17001002', 'Numeric', 'Income In The Past 12 Months Below Poverty Level', 'The number of people in a geographic area who are part of a family (which could be just them as an individual) determined to be "in poverty" following the Office of Management and Budget''s Directive 14. (https://www.census.gov/hhes/povmeas/methodology/ombdir14.html)', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (98, NULL, NULL, '"us.census.acs".B19013001', 'Numeric', 'Median Household Income in the past 12 Months', 'Within a geographic area, the median income received by every household on a regular basis before payments for personal income taxes, social security, union dues, medicare deductions, etc. It includes income received from wages, salary, commissions, bonuses, and tips; self-employment income from own nonfarm or farm businesses, including proprietorships and partnerships; interest, dividends, net rental income, royalty income, or income from estates and trusts; Social Security or Railroad Retirement income; Supplemental Security Income (SSI); any cash public assistance or welfare payments from the state or local welfare office; retirement, survivor, or disability benefits; and any other sources of income received regularly such as Veterans'' (VA) payments, unemployment and/or worker''s compensation, child support, and alimony.', 8, 'median', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (99, NULL, NULL, '"us.census.acs".B19083001', 'Numeric', 'Gini Index', '', 5, '', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (100, NULL, NULL, '"us.census.acs".B19301001', 'Numeric', 'Per Capita Income in the past 12 Months', '', 7, 'average', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (101, NULL, NULL, '"us.census.acs".B25001001', 'Numeric', 'Housing Units', 'A count of housing units in each geography. A housing unit is a house, an apartment, a mobile home or trailer, a group of rooms, or a single room occupied as separate living quarters, or if vacant, intended for occupancy as separate living quarters.', 8, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (102, NULL, NULL, '"us.census.acs".B25075001', 'Numeric', 'Owner-occupied Housing Units', '', 5, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (103, NULL, NULL, '"us.census.acs".B25081002', 'Numeric', 'Owner-occupied Housing Units with a Mortgage', 'The count of housing units within a geographic area that are mortagaged. "Mortgage" refers to all forms of debt where the property is pledged as security for repayment of the debt, including deeds of trust, trust deed, contracts to purchase, land contracts, junior mortgages, and home equity loans.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (104, NULL, NULL, '"us.census.acs".B25002003', 'Numeric', 'Vacant Housing Units', 'The count of vacant housing units in a geographic area. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.', 8, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (105, NULL, NULL, '"us.census.acs".B25004004', 'Numeric', 'Vacant Housing Units for Sale', 'The count of vacant housing units in a geographic area that are for sale. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.', 7, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (106, NULL, NULL, '"us.census.acs".B25004002', 'Numeric', 'Vacant Housing Units for Rent', 'The count of vacant housing units in a geographic area that are for rent. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.', 7, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (107, NULL, NULL, '"us.census.acs".B25058001', 'Numeric', 'Median Rent', 'The median contract rent within a geographic area. The contract rent is the monthly rent agreed to or contracted for, regardless of any furnishings, utilities, fees, meals, or services that may be included. For vacant units, it is the monthly rent asked for the rental unit at the time of interview.', 8, 'median', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (108, NULL, NULL, '"us.census.acs".B25071001', 'Numeric', 'Percent of Household Income Spent on Rent', 'Within a geographic area, the median percentage of household income which was spent on gross rent. Gross rent is the amount of the contract rent plus the estimated average monthly cost of utilities (electricity, gas, water, sewer etc.) and fuels (oil, coal, wood, etc.) if these are paid by the renter. Household income is the sum of the income of all people 15 years and older living in the household.', 4, 'average', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (109, NULL, NULL, '"us.census.acs".B25075025', 'Numeric', 'Owner-occupied Housing Units valued at $1,000,000 or more.', 'The count of owner occupied housing units in a geographic area that are valued at $1,000,000 or more. Value is the respondent''s estimate of how much the property (house and lot, mobile home and lot, or condominium unit) would sell for if it were for sale.', 5, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (110, NULL, NULL, '"us.census.acs".B23008002', 'Numeric', 'Families with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (111, NULL, NULL, 'B23008010', 'Numeric', 'One-parent families, father in labor force, with young children (under 6 years of age)', '', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (112, NULL, NULL, '"us.census.acs".B23008003', 'Numeric', 'Two-parent families with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (113, NULL, NULL, '"us.census.acs".B23008004', 'Numeric', 'Two-parent families, both parents in labor force with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (114, NULL, NULL, '"us.census.acs".B23008005', 'Numeric', 'Two-parent families, father only in labor force with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (115, NULL, NULL, '"us.census.acs".B23008006', 'Numeric', 'Two-parent families, mother only in labor force with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (116, NULL, NULL, '"us.census.acs".B23008007', 'Numeric', 'Two-parent families, neither parent in labor force with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (117, NULL, NULL, '"us.census.acs".B23008008', 'Numeric', 'One-parent families with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (118, NULL, NULL, '"us.census.acs".B23008009', 'Numeric', 'One-parent families, father, with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (121, NULL, NULL, '"us.census.acs".B01001017', 'Numeric', 'Men age 55 to 59', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (122, NULL, NULL, '"us.census.acs".B01001018', 'Numeric', 'Men age 60 to 61', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (123, NULL, NULL, '"us.census.acs".B01001019', 'Numeric', 'Men age 62 to 64', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (124, NULL, NULL, '"us.census.acs".B01001B012', 'Numeric', 'Black Men age 45 to 54', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (125, NULL, NULL, '"us.census.acs".B01001B013', 'Numeric', 'Black Men age 55 to 64', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (126, NULL, NULL, '"us.census.acs".B01001I012', 'Numeric', 'Hispanic Men age 45 to 54', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (127, NULL, NULL, '"us.census.acs".B01001I013', 'Numeric', 'Hispanic Men age 55 to 64', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (168, NULL, NULL, '"us.bls".year', 'Text', 'Year', '4-character year', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (130, NULL, NULL, '"us.census.acs".B01001D013', 'Numeric', 'Asian Men age 55 to 64', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (131, NULL, NULL, '"us.census.acs".B15001028', 'Numeric', 'Men age 45 to 64 who attained less than a 9th grade education', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (132, NULL, NULL, '"us.census.acs".B15001029', 'Numeric', 'Men age 45 to 64 who attained between 9th and 12th grade, no diploma', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (133, NULL, NULL, '"us.census.acs".B15001030', 'Numeric', 'Men age 45 to 64 who completed high school or obtained GED', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (134, NULL, NULL, '"us.census.acs".B15001031', 'Numeric', 'Men age 45 to 64 who completed some college, no degree', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (135, NULL, NULL, '"us.census.acs".B15001032', 'Numeric', 'Men age 45 to 64 who obtained an associate''s degree', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (136, NULL, NULL, '"us.census.acs".B15001033', 'Numeric', 'Men age 45 to 64 who obtained a bachelor''s degree', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (137, NULL, NULL, '"us.census.tiger".zcta5', 'Geometry', 'US Census Zip Code Tabulation Areas', 'ZCTAs are approximate area representations of U.S. Postal Service (USPS) five-digit ZIP Code service areas that the Census Bureau creates using whole blocks to present statistical data from censuses and surveys. The Census Bureau defines ZCTAs by allocating each block that contains addresses to a single ZCTA, usually to the ZCTA that reflects the most frequently occurring ZIP Code for the addresses within that tabulation block. Blocks that do not contain addresses but are completely surrounded by a single ZCTA (enclaves) are assigned to the surrounding ZCTA; those surrounded by multiple ZCTAs will be added to a single ZCTA based on limited buffering performed between multiple ZCTAs. The Census Bureau identifies five-digit ZCTAs using a five-character numeric code that represents the most frequently occurring USPS ZIP Code within that ZCTA, and this code may contain leading zeros.
|
|
||||||
|
|
||||||
There are significant changes to the 2010 ZCTA delineation from that used in 2000. Coverage was extended to include the Island Areas for 2010 so that the United States, Puerto Rico, and the Island Areas have ZCTAs. Unlike 2000, when areas that could not be assigned to a ZCTA were given a generic code ending in \u201cXX\u201d (land area) or \u201cHH\u201d (water area), for 2010 there is no universal coverage by ZCTAs, and only legitimate five-digit areas are defined. The 2010 ZCTAs will better represent the actual Zip Code service areas because the Census Bureau initiated a process before creation of 2010 blocks to add block boundaries that split polygons with large numbers of addresses using different Zip Codes.
|
|
||||||
|
|
||||||
Data users should not use ZCTAs to identify the official USPS ZIP Code for mail delivery. The USPS makes periodic changes to ZIP Codes to support more efficient mail delivery. The ZCTAs process used primarily residential addresses and was biased towards Zip Codes used for city-style mail delivery, thus there may be Zip Codes that are primarily nonresidential or boxes only that may not have a corresponding ZCTA.', 6, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (138, NULL, NULL, '"us.census.tiger".block', 'Geometry', 'US Census Blocks', 'Census blocks are numbered uniquely with a four-digit census block number from 0000 to 9999 within census tract, which nest within state and county. The first digit of the census block number identifies the block group. Block numbers beginning with a zero (in Block Group 0) are only associated with water-only areas.', 3, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (139, NULL, NULL, '"us.census.tiger".census_tract_geoid', 'Text', 'US Census Tract Geoids', '', 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (140, NULL, NULL, '"us.census.tiger".county_geoid', 'Text', 'US County Geoids', '', 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (141, NULL, NULL, '"us.census.tiger".congressional_district_geoid', 'Text', 'US Congressional District Geoids', '', 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (142, NULL, NULL, '"us.census.tiger".block_geoid', 'Text', 'US Census Block Geoids', NULL, 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (143, NULL, NULL, '"us.census.tiger".zcta5_geoid', 'Text', 'US Census Zip Code Tabulation Area Geoids', '', 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (144, NULL, NULL, '"us.census.tiger".puma_geoid', 'Text', 'US Census Public Use Microdata Area Geoids', '', 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (145, NULL, NULL, '"us.census.tiger".state_geoid', 'Text', 'US State Geoids', '', 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (146, NULL, NULL, '"us.census.tiger".block_group_geoid', 'Text', 'US Census Block Group Geoids', NULL, 0, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (147, NULL, NULL, '"us.census.lodes".jobs_hispanic', 'Integer', 'Jobs held by workers who are Hispanic or Latino', 'Number of jobs for workers with Ethnicity: Hispanic or Latino', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (148, NULL, NULL, '"us.census.lodes".jobs_less_than_high_school', 'Integer', 'Jobs held by workers who did not complete high school', 'Number of jobs for workers with Educational Attainment: Less than high school', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (149, NULL, NULL, '"us.census.lodes".jobs_high_school', 'Integer', 'Jobs held by workers who completed high school', 'Number of jobs for workers with Educational Attainment: High school or equivalent, no college', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (150, NULL, NULL, '"us.census.lodes".jobs_some_college', 'Integer', 'Jobs held by workers who completed some college or Associate degree', 'Number of jobs for workers with Educational Attainment: Some college or Associate degree', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (151, NULL, NULL, '"us.census.lodes".jobs_bachelors_or_advanced', 'Integer', 'Jobs held by workers who obtained a Bachelor''s degree or advanced degree', 'Number of jobs for workers with Educational Attainment: Bachelor''s degree or advanced degree', 4, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (152, NULL, NULL, '"us.census.lodes".jobs_male', 'Integer', 'Jobs held by men', 'Number of jobs for male workers', 2, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (153, NULL, NULL, '"us.census.lodes".jobs_female', 'Integer', 'Jobs held by women', 'Number of jobs for female workers', 2, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (154, NULL, NULL, '"us.census.lodes".jobs_firm_age_0_1_years', 'Integer', 'Jobs at firms aged 0-1 Years', 'Number of jobs for workers at firms with Firm Age: 0-1 Years', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (155, NULL, NULL, '"us.census.lodes".jobs_firm_age_2_3_years', 'Integer', 'Jobs at firms aged 2-3 Years', 'Number of jobs for workers at firms with Firm Age: 2-3 Years', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (156, NULL, NULL, '"us.census.lodes".jobs_firm_age_4_5_years', 'Integer', 'Jobs at firms aged 4-5 Years', 'Number of jobs for workers at firms with Firm Age: 4-5 Years', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (157, NULL, NULL, '"us.census.lodes".jobs_firm_age_6_10_years', 'Integer', 'Jobs at firms aged 6-10 years', 'Number of jobs for workers at firms with Firm Age: 6-10 Years', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (158, NULL, NULL, '"us.census.lodes".jobs_firm_age_11_more_years', 'Integer', 'Jobs at firms aged 11 Years', 'Number of jobs for workers at firms with Firm Age: 11 Years', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (159, NULL, NULL, '"us.census.lodes".jobs_firm_age_0_19_employees', 'Integer', 'Jobs at firms with 0-19 Employees', 'Number of jobs for workers at firms with Firm Size: 0-19 Employees', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (160, NULL, NULL, '"us.census.lodes".jobs_firm_age_20_49_employees', 'Integer', 'Jobs at firms with 20-49 Employees', 'Number of jobs for workers at firms with Firm Size: 20-49 Employees', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (161, NULL, NULL, '"us.census.lodes".jobs_firm_age_50_249_employees', 'Integer', 'Jobs at firms with 0-249 Employees', 'Number of jobs for workers at firms with Firm Size: 50-249 Employees', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (162, NULL, NULL, '"us.census.lodes".jobs_firm_age_250_499_employees', 'Integer', 'Jobs at firms with 250-499 Employees', 'Number of jobs for workers at firms with Firm Size: 250-499 Employees', 1, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (163, NULL, NULL, '"us.census.lodes".createdate', 'Date', 'Date on which data was created, formatted as YYYYMMDD ', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (164, NULL, NULL, '"us.bls".industry_title', 'Text', 'NAICS Industry Title', 'Title of NAICS industry', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (165, NULL, NULL, '"us.bls".own_code', 'Text', 'Ownership Code', '1-character ownership code: http://www.bls.gov/cew/doc/titles/ownership/ownership_titles.htm', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (166, NULL, NULL, '"us.bls".agglvl_code', 'Text', 'Aggregation Level Code', '2-character aggregation level code: http://www.bls.gov/cew/doc/titles/agglevel/agglevel_titles.htm', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (167, NULL, NULL, '"us.bls".size_code', 'Text', 'Size code', '1-character size code: http://www.bls.gov/cew/doc/titles/size/size_titles.htm', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (169, NULL, NULL, '"us.bls".qtr', 'Text', 'Quarter', '1-character quarter (always A for annual)', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (170, NULL, NULL, '"us.bls".disclosure_code', 'Text', 'Disclosure code', '1-character disclosure code (either '' ''(blank)), or ''N'' not disclosed)', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (171, NULL, NULL, '"us.bls".qtrly_estabs', 'Numeric', 'Establishment count', 'Count of establishments for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (172, NULL, NULL, '"us.bls".month1_emplvl', 'Numeric', 'First month employment', 'Employment level for the first month of a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (173, NULL, NULL, '"us.bls".month2_emplvl', 'Numeric', 'Second month employment', 'Employment level for the second month of a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (174, NULL, NULL, '"us.bls".month3_emplvl', 'Numeric', 'Third month employment', 'Employment level for the third month of a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (175, NULL, NULL, '"us.bls".total_qtrly_wages', 'Numeric', 'Total wages', 'Total wages for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (176, NULL, NULL, '"us.bls".taxable_qtrly_wages', 'Numeric', 'Taxable wages', 'Taxable wages for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (177, NULL, NULL, '"us.bls".qtrly_contributions', 'Numeric', 'Total contributions', 'Quarterly contributions for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (178, NULL, NULL, '"us.bls".avg_wkly_wage', 'Numeric', 'Average weekly wage', 'Average weekly wage for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (179, NULL, NULL, '"us.bls".lq_disclosure_code', 'Text', 'Location quotient disclosure code', '1-character location-quotient disclosure code (either '' ''(blank)), or ''N'' not disclosed', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (180, NULL, NULL, '"us.bls".lq_qtrly_estabs', 'Numeric', 'Location quotient', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (181, NULL, NULL, '"us.bls".lq_month1_emplvl', 'Numeric', 'Location quotient first month', 'Location quotient of the employment level for the first month of a given quarter relative to the U.S. (Rounded to hundredths place)),', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (182, NULL, NULL, '"us.bls".lq_month2_emplvl', 'Numeric', 'Location quotient second month', 'Location quotient of the employment level for the second month of a given quarter relative to the U.S. (Rounded to hundredths place)),', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (183, NULL, NULL, '"us.bls".lq_month3_emplvl', 'Numeric', 'Location quotient third month', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)),', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (184, NULL, NULL, '"us.bls".lq_total_qtrly_wages', 'Numeric', 'Location quotient quarterly', 'Location quotient of the total wages for a given quarter relative to the U.S. (Rounded to hundredths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (185, NULL, NULL, '"us.bls".lq_taxable_qtrly_wages', 'Numeric', 'Quarterly location quotient taxable wages', 'Location quotient of the total taxable wages for a given quarter relative to the U.S. (Rounded to hundredths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (186, NULL, NULL, '"us.bls".lq_qtrly_contributions', 'Numeric', 'Quarterly location quotient contributions', 'Location quotient of the total contributions for a given quarter relative to the U.S. (Rounded to hundredths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (187, NULL, NULL, '"us.bls".lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (188, NULL, NULL, '"us.bls".oty_disclosure_code', 'Text', 'Over-the-year Disclosure code', '1-character over-the-year disclosure code (either '' ''(blank)), or ''N'' not disclosed)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (189, NULL, NULL, '"us.bls".oty_qtrly_estabs_chg', 'Numeric', 'Over-the-year change in establishment count', 'Over-the-year change in the count of establishments for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (190, NULL, NULL, '"us.bls".oty_qtrly_estabs_pct_chg', 'Numeric', 'Over-the-year percent change in establishment count', 'Over-the-year percent change in the count of establishments for a given quarter (Rounded to the tenths place)', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (191, NULL, NULL, '"us.bls".oty_month1_emplvl_chg', 'Numeric', 'Over-the-year change in first month employment level', 'Over-the-year change in the first month''s employment level of a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (192, NULL, NULL, '"us.bls".oty_month1_emplvl_pct_chg', 'Numeric', 'Over-the-year percent change in first month employment level', 'Over-the-year percent change in the first month''s employment level of a given quarter (Rounded to the tenths place)),', 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (193, NULL, NULL, '"us.bls".oty_month2_emplvl_chg', 'Numeric', 'Over-the-year change in second month employment level', 'Over-the-year change in the second month''s employment level of a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (194, NULL, NULL, '"us.bls".oty_month2_emplvl_pct_chg', 'Numeric', 'Over-the-year percent change in second month employment level', 'Over-the-year percent change in the second month''s employment level of a given quarter (Rounded to the tenths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (195, NULL, NULL, '"us.bls".oty_month3_emplvl_chg', 'Numeric', 'Over-the-year change in third month employment level', 'Over-the-year change in the third month''s employment level of a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (196, NULL, NULL, '"us.bls".oty_month3_emplvl_pct_chg', 'Numeric', 'Over-the-year percent change in third month employment level', 'Over-the-year percent change in the third month''s employment level of a given quarter (Rounded to the tenths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (197, NULL, NULL, '"us.bls".oty_total_qtrly_wages_chg', 'Numeric', 'Over-the-year change in total quarterly wages', 'Over-the-year change in total quarterly wages for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (198, NULL, NULL, '"us.bls".oty_total_qtrly_wages_pct_chg', 'Numeric', 'Over-the-year percent change in total quarterly wages', 'Over-the-year percent change in total quarterly wages for a given quarter (Rounded to the tenths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (199, NULL, NULL, '"us.bls".oty_taxable_qtrly_wages_chg', 'Numeric', 'Over-the-year change in taxable quarterly wages', 'Over-the-year change in taxable quarterly wages for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (200, NULL, NULL, '"us.bls".oty_taxable_qtrly_wages_pct_chg', 'Numeric', 'Over-the-year percent change in taxable quarterly wages', 'Over-the-year percent change in taxable quarterly wages for a given quarter (Rounded to the tenths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (201, NULL, NULL, '"us.bls".oty_qtrly_contributions_chg', 'Numeric', 'Over-the-year change in quarterly contributions', 'Over-the-year change in quarterly contributions for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (202, NULL, NULL, '"us.bls".oty_qtrly_contributions_pct_chg', 'Numeric', 'Over-the-year percent change in quarterly contributions', 'Over-the-year percent change in quarterly contributions for a given quarter (Rounded to the tenths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (203, NULL, NULL, '"us.bls".oty_avg_wkly_wage_chg', 'Numeric', 'Over-the-year change in average weekly wage', 'Over-the-year change in average weekly wage for a given quarter', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (204, NULL, NULL, '"us.bls".oty_avg_wkly_wage_pct_chg', 'Numeric', 'Over-the-year percent change in average weekly wage', 'Over-the-year percent change in average weekly wage for a given quarter (Rounded to the tenths place)', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (205, NULL, NULL, '"us.bls".total_all_industries_avg_wkly_wage', 'Numeric', 'Average weekly wage for Total, all industries', 'Average weekly wage for a given quarter for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (206, NULL, NULL, '"us.bls".total_all_industries_qtrly_estabs', 'Numeric', 'Establishment count for Total, all industries', 'Count of establishments for a given quarter for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (207, NULL, NULL, '"us.bls".total_all_industries_month3_emplvl', 'Numeric', 'Third month employment for Total, all industries', 'Employment level for the third month of a given quarter for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (208, NULL, NULL, '"us.bls".total_all_industries_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Total, all industries', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (209, NULL, NULL, '"us.bls".total_all_industries_lq_qtrly_estabs', 'Numeric', 'Location quotient for Total, all industries', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (210, NULL, NULL, '"us.bls".total_all_industries_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Total, all industries', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (211, NULL, NULL, '"us.bls".natural_resources_and_mining_avg_wkly_wage', 'Numeric', 'Average weekly wage for Natural resources and mining', 'Average weekly wage for a given quarter for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (212, NULL, NULL, '"us.bls".natural_resources_and_mining_qtrly_estabs', 'Numeric', 'Establishment count for Natural resources and mining', 'Count of establishments for a given quarter for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (213, NULL, NULL, '"us.bls".natural_resources_and_mining_month3_emplvl', 'Numeric', 'Third month employment for Natural resources and mining', 'Employment level for the third month of a given quarter for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (214, NULL, NULL, '"us.bls".natural_resources_and_mining_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Natural resources and mining', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (215, NULL, NULL, '"us.bls".natural_resources_and_mining_lq_qtrly_estabs', 'Numeric', 'Location quotient for Natural resources and mining', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (216, NULL, NULL, '"us.bls".natural_resources_and_mining_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Natural resources and mining', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (217, NULL, NULL, '"us.bls".construction_avg_wkly_wage', 'Numeric', 'Average weekly wage for Construction', 'Average weekly wage for a given quarter for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (218, NULL, NULL, '"us.bls".construction_qtrly_estabs', 'Numeric', 'Establishment count for Construction', 'Count of establishments for a given quarter for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (219, NULL, NULL, '"us.bls".construction_month3_emplvl', 'Numeric', 'Third month employment for Construction', 'Employment level for the third month of a given quarter for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (220, NULL, NULL, '"us.bls".construction_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Construction', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (221, NULL, NULL, '"us.bls".construction_lq_qtrly_estabs', 'Numeric', 'Location quotient for Construction', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (222, NULL, NULL, '"us.bls".construction_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Construction', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (223, NULL, NULL, '"us.bls".manufacturing_avg_wkly_wage', 'Numeric', 'Average weekly wage for Manufacturing', 'Average weekly wage for a given quarter for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (224, NULL, NULL, '"us.bls".manufacturing_qtrly_estabs', 'Numeric', 'Establishment count for Manufacturing', 'Count of establishments for a given quarter for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (225, NULL, NULL, '"us.bls".manufacturing_month3_emplvl', 'Numeric', 'Third month employment for Manufacturing', 'Employment level for the third month of a given quarter for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (226, NULL, NULL, '"us.bls".manufacturing_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Manufacturing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (227, NULL, NULL, '"us.bls".manufacturing_lq_qtrly_estabs', 'Numeric', 'Location quotient for Manufacturing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (228, NULL, NULL, '"us.bls".manufacturing_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Manufacturing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (229, NULL, NULL, '"us.bls".trade_transportation_and_utilities_avg_wkly_wage', 'Numeric', 'Average weekly wage for Trade, transportation, and utilities', 'Average weekly wage for a given quarter for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (230, NULL, NULL, '"us.bls".trade_transportation_and_utilities_qtrly_estabs', 'Numeric', 'Establishment count for Trade, transportation, and utilities', 'Count of establishments for a given quarter for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (259, NULL, NULL, '"us.bls".leisure_and_hospitality_avg_wkly_wage', 'Numeric', 'Average weekly wage for Leisure and hospitality', 'Average weekly wage for a given quarter for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (231, NULL, NULL, '"us.bls".trade_transportation_and_utilities_month3_emplvl', 'Numeric', 'Third month employment for Trade, transportation, and utilities', 'Employment level for the third month of a given quarter for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (232, NULL, NULL, '"us.bls".trade_transportation_and_utilities_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Trade, transportation, and utilities', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (233, NULL, NULL, '"us.bls".trade_transportation_and_utilities_lq_qtrly_estabs', 'Numeric', 'Location quotient for Trade, transportation, and utilities', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (234, NULL, NULL, '"us.bls".trade_transportation_and_utilities_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Trade, transportation, and utilities', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (235, NULL, NULL, '"us.bls".information_avg_wkly_wage', 'Numeric', 'Average weekly wage for Information', 'Average weekly wage for a given quarter for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (236, NULL, NULL, '"us.bls".information_qtrly_estabs', 'Numeric', 'Establishment count for Information', 'Count of establishments for a given quarter for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (237, NULL, NULL, '"us.bls".information_month3_emplvl', 'Numeric', 'Third month employment for Information', 'Employment level for the third month of a given quarter for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (238, NULL, NULL, '"us.bls".information_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Information', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (239, NULL, NULL, '"us.bls".information_lq_qtrly_estabs', 'Numeric', 'Location quotient for Information', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (240, NULL, NULL, '"us.bls".information_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Information', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (241, NULL, NULL, '"us.bls".financial_activities_avg_wkly_wage', 'Numeric', 'Average weekly wage for Financial activities', 'Average weekly wage for a given quarter for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (242, NULL, NULL, '"us.bls".financial_activities_qtrly_estabs', 'Numeric', 'Establishment count for Financial activities', 'Count of establishments for a given quarter for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (243, NULL, NULL, '"us.bls".financial_activities_month3_emplvl', 'Numeric', 'Third month employment for Financial activities', 'Employment level for the third month of a given quarter for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (244, NULL, NULL, '"us.bls".financial_activities_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Financial activities', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (245, NULL, NULL, '"us.bls".financial_activities_lq_qtrly_estabs', 'Numeric', 'Location quotient for Financial activities', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (246, NULL, NULL, '"us.bls".financial_activities_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Financial activities', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (247, NULL, NULL, '"us.bls".professional_and_business_services_avg_wkly_wage', 'Numeric', 'Average weekly wage for Professional and business services', 'Average weekly wage for a given quarter for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (248, NULL, NULL, '"us.bls".professional_and_business_services_qtrly_estabs', 'Numeric', 'Establishment count for Professional and business services', 'Count of establishments for a given quarter for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (249, NULL, NULL, '"us.bls".professional_and_business_services_month3_emplvl', 'Numeric', 'Third month employment for Professional and business services', 'Employment level for the third month of a given quarter for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (250, NULL, NULL, '"us.bls".professional_and_business_services_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Professional and business services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (251, NULL, NULL, '"us.bls".professional_and_business_services_lq_qtrly_estabs', 'Numeric', 'Location quotient for Professional and business services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (252, NULL, NULL, '"us.bls".professional_and_business_services_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Professional and business services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (253, NULL, NULL, '"us.bls".education_and_health_services_avg_wkly_wage', 'Numeric', 'Average weekly wage for Education and health services', 'Average weekly wage for a given quarter for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (254, NULL, NULL, '"us.bls".education_and_health_services_qtrly_estabs', 'Numeric', 'Establishment count for Education and health services', 'Count of establishments for a given quarter for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (255, NULL, NULL, '"us.bls".education_and_health_services_month3_emplvl', 'Numeric', 'Third month employment for Education and health services', 'Employment level for the third month of a given quarter for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (256, NULL, NULL, '"us.bls".education_and_health_services_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Education and health services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (257, NULL, NULL, '"us.bls".education_and_health_services_lq_qtrly_estabs', 'Numeric', 'Location quotient for Education and health services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (258, NULL, NULL, '"us.bls".education_and_health_services_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Education and health services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (260, NULL, NULL, '"us.bls".leisure_and_hospitality_qtrly_estabs', 'Numeric', 'Establishment count for Leisure and hospitality', 'Count of establishments for a given quarter for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (261, NULL, NULL, '"us.bls".leisure_and_hospitality_month3_emplvl', 'Numeric', 'Third month employment for Leisure and hospitality', 'Employment level for the third month of a given quarter for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (262, NULL, NULL, '"us.bls".leisure_and_hospitality_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Leisure and hospitality', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (263, NULL, NULL, '"us.bls".leisure_and_hospitality_lq_qtrly_estabs', 'Numeric', 'Location quotient for Leisure and hospitality', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (264, NULL, NULL, '"us.bls".leisure_and_hospitality_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Leisure and hospitality', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (265, NULL, NULL, '"us.bls".other_services_avg_wkly_wage', 'Numeric', 'Average weekly wage for Other services', 'Average weekly wage for a given quarter for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (266, NULL, NULL, '"us.bls".other_services_qtrly_estabs', 'Numeric', 'Establishment count for Other services', 'Count of establishments for a given quarter for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (267, NULL, NULL, '"us.bls".other_services_month3_emplvl', 'Numeric', 'Third month employment for Other services', 'Employment level for the third month of a given quarter for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (268, NULL, NULL, '"us.bls".other_services_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Other services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (269, NULL, NULL, '"us.bls".other_services_lq_qtrly_estabs', 'Numeric', 'Location quotient for Other services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (270, NULL, NULL, '"us.bls".other_services_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Other services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (271, NULL, NULL, '"us.bls".public_administration_avg_wkly_wage', 'Numeric', 'Average weekly wage for Public administration', 'Average weekly wage for a given quarter for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (272, NULL, NULL, '"us.bls".public_administration_qtrly_estabs', 'Numeric', 'Establishment count for Public administration', 'Count of establishments for a given quarter for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (273, NULL, NULL, '"us.bls".public_administration_month3_emplvl', 'Numeric', 'Third month employment for Public administration', 'Employment level for the third month of a given quarter for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (274, NULL, NULL, '"us.bls".public_administration_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Public administration', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (275, NULL, NULL, '"us.bls".public_administration_lq_qtrly_estabs', 'Numeric', 'Location quotient for Public administration', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (276, NULL, NULL, '"us.bls".public_administration_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Public administration', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (277, NULL, NULL, '"us.bls".unclassified_avg_wkly_wage', 'Numeric', 'Average weekly wage for Unclassified', 'Average weekly wage for a given quarter for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (278, NULL, NULL, '"us.bls".unclassified_qtrly_estabs', 'Numeric', 'Establishment count for Unclassified', 'Count of establishments for a given quarter for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (279, NULL, NULL, '"us.bls".unclassified_month3_emplvl', 'Numeric', 'Third month employment for Unclassified', 'Employment level for the third month of a given quarter for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (280, NULL, NULL, '"us.bls".unclassified_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for Unclassified', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (281, NULL, NULL, '"us.bls".unclassified_lq_qtrly_estabs', 'Numeric', 'Location quotient for Unclassified', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (282, NULL, NULL, '"us.bls".unclassified_lq_month3_emplvl', 'Numeric', 'Location quotient third month for Unclassified', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (283, NULL, NULL, '"us.bls".naics_11_agriculture_forestry_fishing_and_hunting_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 11 Agriculture, forestry, fishing and hunting', 'Average weekly wage for a given quarter for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (284, NULL, NULL, '"us.bls".naics_11_agriculture_forestry_fishing_and_hunting_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 11 Agriculture, forestry, fishing and hunting', 'Count of establishments for a given quarter for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (285, NULL, NULL, '"us.bls".naics_11_agriculture_forestry_fishing_and_hunting_month3_emplvl', 'Numeric', 'Third month employment for NAICS 11 Agriculture, forestry, fishing and hunting', 'Employment level for the third month of a given quarter for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (286, NULL, NULL, '"us.bls".naics_11_agriculture_forestry_fishing_and_hunting_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 11 Agriculture, forestry, fishing and hunting', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (287, NULL, NULL, '"us.bls".naics_11_agriculture_forestry_fishing_and_hunting_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 11 Agriculture, forestry, fishing and hunting', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (315, NULL, NULL, '"us.bls".naics_51_information_month3_emplvl', 'Numeric', 'Third month employment for NAICS 51 Information', 'Employment level for the third month of a given quarter for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (288, NULL, NULL, '"us.bls".naics_11_agriculture_forestry_fishing_and_hunting_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 11 Agriculture, forestry, fishing and hunting', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (289, NULL, NULL, '"us.bls".naics_21_mining_quarrying_and_oil_and_gas_extraction_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Average weekly wage for a given quarter for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (290, NULL, NULL, '"us.bls".naics_21_mining_quarrying_and_oil_and_gas_extraction_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Count of establishments for a given quarter for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (291, NULL, NULL, '"us.bls".naics_21_mining_quarrying_and_oil_and_gas_extraction_month3_emplvl', 'Numeric', 'Third month employment for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Employment level for the third month of a given quarter for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (292, NULL, NULL, '"us.bls".naics_21_mining_quarrying_and_oil_and_gas_extraction_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (293, NULL, NULL, '"us.bls".naics_21_mining_quarrying_and_oil_and_gas_extraction_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (294, NULL, NULL, '"us.bls".naics_21_mining_quarrying_and_oil_and_gas_extraction_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (295, NULL, NULL, '"us.bls".naics_22_utilities_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 22 Utilities', 'Average weekly wage for a given quarter for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (296, NULL, NULL, '"us.bls".naics_22_utilities_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 22 Utilities', 'Count of establishments for a given quarter for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (297, NULL, NULL, '"us.bls".naics_22_utilities_month3_emplvl', 'Numeric', 'Third month employment for NAICS 22 Utilities', 'Employment level for the third month of a given quarter for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (298, NULL, NULL, '"us.bls".naics_22_utilities_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 22 Utilities', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (299, NULL, NULL, '"us.bls".naics_22_utilities_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 22 Utilities', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (300, NULL, NULL, '"us.bls".naics_22_utilities_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 22 Utilities', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (301, NULL, NULL, '"us.bls".naics_23_construction_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 23 Construction', 'Average weekly wage for a given quarter for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (302, NULL, NULL, '"us.bls".naics_23_construction_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 23 Construction', 'Count of establishments for a given quarter for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (303, NULL, NULL, '"us.bls".naics_23_construction_month3_emplvl', 'Numeric', 'Third month employment for NAICS 23 Construction', 'Employment level for the third month of a given quarter for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (304, NULL, NULL, '"us.bls".naics_23_construction_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 23 Construction', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (305, NULL, NULL, '"us.bls".naics_23_construction_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 23 Construction', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (306, NULL, NULL, '"us.bls".naics_23_construction_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 23 Construction', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (307, NULL, NULL, '"us.bls".naics_42_wholesale_trade_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 42 Wholesale trade', 'Average weekly wage for a given quarter for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (308, NULL, NULL, '"us.bls".naics_42_wholesale_trade_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 42 Wholesale trade', 'Count of establishments for a given quarter for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (309, NULL, NULL, '"us.bls".naics_42_wholesale_trade_month3_emplvl', 'Numeric', 'Third month employment for NAICS 42 Wholesale trade', 'Employment level for the third month of a given quarter for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (310, NULL, NULL, '"us.bls".naics_42_wholesale_trade_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 42 Wholesale trade', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (311, NULL, NULL, '"us.bls".naics_42_wholesale_trade_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 42 Wholesale trade', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (312, NULL, NULL, '"us.bls".naics_42_wholesale_trade_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 42 Wholesale trade', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (313, NULL, NULL, '"us.bls".naics_51_information_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 51 Information', 'Average weekly wage for a given quarter for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (314, NULL, NULL, '"us.bls".naics_51_information_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 51 Information', 'Count of establishments for a given quarter for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (316, NULL, NULL, '"us.bls".naics_51_information_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 51 Information', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (317, NULL, NULL, '"us.bls".naics_51_information_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 51 Information', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (538, NULL, NULL, '"us.bls".month3_emplvl_naics51', 'Numeric', 'Third month employment for NAICS 51 Information', 'Employment level for the third month of a given quarter for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (318, NULL, NULL, '"us.bls".naics_51_information_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 51 Information', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (319, NULL, NULL, '"us.bls".naics_52_finance_and_insurance_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 52 Finance and insurance', 'Average weekly wage for a given quarter for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (320, NULL, NULL, '"us.bls".naics_52_finance_and_insurance_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 52 Finance and insurance', 'Count of establishments for a given quarter for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (321, NULL, NULL, '"us.bls".naics_52_finance_and_insurance_month3_emplvl', 'Numeric', 'Third month employment for NAICS 52 Finance and insurance', 'Employment level for the third month of a given quarter for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (322, NULL, NULL, '"us.bls".naics_52_finance_and_insurance_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 52 Finance and insurance', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (323, NULL, NULL, '"us.bls".naics_52_finance_and_insurance_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 52 Finance and insurance', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (324, NULL, NULL, '"us.bls".naics_52_finance_and_insurance_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 52 Finance and insurance', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (325, NULL, NULL, '"us.bls".naics_53_real_estate_and_rental_and_leasing_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 53 Real estate and rental and leasing', 'Average weekly wage for a given quarter for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (326, NULL, NULL, '"us.bls".naics_53_real_estate_and_rental_and_leasing_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 53 Real estate and rental and leasing', 'Count of establishments for a given quarter for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (327, NULL, NULL, '"us.bls".naics_53_real_estate_and_rental_and_leasing_month3_emplvl', 'Numeric', 'Third month employment for NAICS 53 Real estate and rental and leasing', 'Employment level for the third month of a given quarter for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (328, NULL, NULL, '"us.bls".naics_53_real_estate_and_rental_and_leasing_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 53 Real estate and rental and leasing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (329, NULL, NULL, '"us.bls".naics_53_real_estate_and_rental_and_leasing_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 53 Real estate and rental and leasing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (330, NULL, NULL, '"us.bls".naics_53_real_estate_and_rental_and_leasing_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 53 Real estate and rental and leasing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (331, NULL, NULL, '"us.bls".naics_54_professional_and_technical_services_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 54 Professional and technical services', 'Average weekly wage for a given quarter for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (332, NULL, NULL, '"us.bls".naics_54_professional_and_technical_services_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 54 Professional and technical services', 'Count of establishments for a given quarter for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (333, NULL, NULL, '"us.bls".naics_54_professional_and_technical_services_month3_emplvl', 'Numeric', 'Third month employment for NAICS 54 Professional and technical services', 'Employment level for the third month of a given quarter for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (334, NULL, NULL, '"us.bls".naics_54_professional_and_technical_services_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 54 Professional and technical services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (335, NULL, NULL, '"us.bls".naics_54_professional_and_technical_services_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 54 Professional and technical services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (336, NULL, NULL, '"us.bls".naics_54_professional_and_technical_services_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 54 Professional and technical services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (337, NULL, NULL, '"us.bls".naics_55_management_of_companies_and_enterprises_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 55 Management of companies and enterprises', 'Average weekly wage for a given quarter for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (338, NULL, NULL, '"us.bls".naics_55_management_of_companies_and_enterprises_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 55 Management of companies and enterprises', 'Count of establishments for a given quarter for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (339, NULL, NULL, '"us.bls".naics_55_management_of_companies_and_enterprises_month3_emplvl', 'Numeric', 'Third month employment for NAICS 55 Management of companies and enterprises', 'Employment level for the third month of a given quarter for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (415, NULL, NULL, '"us.bls".avg_wkly_wage_naics1011', 'Numeric', 'Average weekly wage for Natural resources and mining', 'Average weekly wage for a given quarter for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (340, NULL, NULL, '"us.bls".naics_55_management_of_companies_and_enterprises_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 55 Management of companies and enterprises', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (389, NULL, NULL, '"us.bls".naics_99_unclassified_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 99 Unclassified', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (341, NULL, NULL, '"us.bls".naics_55_management_of_companies_and_enterprises_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 55 Management of companies and enterprises', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (342, NULL, NULL, '"us.bls".naics_55_management_of_companies_and_enterprises_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 55 Management of companies and enterprises', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (343, NULL, NULL, '"us.bls".naics_56_administrative_and_waste_services_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 56 Administrative and waste services', 'Average weekly wage for a given quarter for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (344, NULL, NULL, '"us.bls".naics_56_administrative_and_waste_services_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 56 Administrative and waste services', 'Count of establishments for a given quarter for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (345, NULL, NULL, '"us.bls".naics_56_administrative_and_waste_services_month3_emplvl', 'Numeric', 'Third month employment for NAICS 56 Administrative and waste services', 'Employment level for the third month of a given quarter for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (346, NULL, NULL, '"us.bls".naics_56_administrative_and_waste_services_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 56 Administrative and waste services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (347, NULL, NULL, '"us.bls".naics_56_administrative_and_waste_services_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 56 Administrative and waste services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (348, NULL, NULL, '"us.bls".naics_56_administrative_and_waste_services_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 56 Administrative and waste services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (349, NULL, NULL, '"us.bls".naics_61_educational_services_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 61 Educational services', 'Average weekly wage for a given quarter for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (350, NULL, NULL, '"us.bls".naics_61_educational_services_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 61 Educational services', 'Count of establishments for a given quarter for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (351, NULL, NULL, '"us.bls".naics_61_educational_services_month3_emplvl', 'Numeric', 'Third month employment for NAICS 61 Educational services', 'Employment level for the third month of a given quarter for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (352, NULL, NULL, '"us.bls".naics_61_educational_services_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 61 Educational services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (353, NULL, NULL, '"us.bls".naics_61_educational_services_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 61 Educational services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (354, NULL, NULL, '"us.bls".naics_61_educational_services_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 61 Educational services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (355, NULL, NULL, '"us.bls".naics_62_health_care_and_social_assistance_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 62 Health care and social assistance', 'Average weekly wage for a given quarter for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (356, NULL, NULL, '"us.bls".naics_62_health_care_and_social_assistance_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 62 Health care and social assistance', 'Count of establishments for a given quarter for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (357, NULL, NULL, '"us.bls".naics_62_health_care_and_social_assistance_month3_emplvl', 'Numeric', 'Third month employment for NAICS 62 Health care and social assistance', 'Employment level for the third month of a given quarter for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (358, NULL, NULL, '"us.bls".naics_62_health_care_and_social_assistance_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 62 Health care and social assistance', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (359, NULL, NULL, '"us.bls".naics_62_health_care_and_social_assistance_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 62 Health care and social assistance', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (360, NULL, NULL, '"us.bls".naics_62_health_care_and_social_assistance_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 62 Health care and social assistance', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (361, NULL, NULL, '"us.bls".naics_71_arts_entertainment_and_recreation_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 71 Arts, entertainment, and recreation', 'Average weekly wage for a given quarter for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (362, NULL, NULL, '"us.bls".naics_71_arts_entertainment_and_recreation_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 71 Arts, entertainment, and recreation', 'Count of establishments for a given quarter for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (363, NULL, NULL, '"us.bls".naics_71_arts_entertainment_and_recreation_month3_emplvl', 'Numeric', 'Third month employment for NAICS 71 Arts, entertainment, and recreation', 'Employment level for the third month of a given quarter for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (701, NULL, NULL, '"us.census.acs".B01001002_quantile', 'Numeric', 'Quantile:Male Population', 'The number of people within each geography who are male.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (364, NULL, NULL, '"us.bls".naics_71_arts_entertainment_and_recreation_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 71 Arts, entertainment, and recreation', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (365, NULL, NULL, '"us.bls".naics_71_arts_entertainment_and_recreation_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 71 Arts, entertainment, and recreation', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (366, NULL, NULL, '"us.bls".naics_71_arts_entertainment_and_recreation_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 71 Arts, entertainment, and recreation', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (367, NULL, NULL, '"us.bls".naics_72_accommodation_and_food_services_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 72 Accommodation and food services', 'Average weekly wage for a given quarter for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (368, NULL, NULL, '"us.bls".naics_72_accommodation_and_food_services_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 72 Accommodation and food services', 'Count of establishments for a given quarter for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (369, NULL, NULL, '"us.bls".naics_72_accommodation_and_food_services_month3_emplvl', 'Numeric', 'Third month employment for NAICS 72 Accommodation and food services', 'Employment level for the third month of a given quarter for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (370, NULL, NULL, '"us.bls".naics_72_accommodation_and_food_services_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 72 Accommodation and food services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (371, NULL, NULL, '"us.bls".naics_72_accommodation_and_food_services_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 72 Accommodation and food services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (372, NULL, NULL, '"us.bls".naics_72_accommodation_and_food_services_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 72 Accommodation and food services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (373, NULL, NULL, '"us.bls".naics_81_other_services_except_public_administration_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 81 Other services, except public administration', 'Average weekly wage for a given quarter for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (374, NULL, NULL, '"us.bls".naics_81_other_services_except_public_administration_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 81 Other services, except public administration', 'Count of establishments for a given quarter for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (375, NULL, NULL, '"us.bls".naics_81_other_services_except_public_administration_month3_emplvl', 'Numeric', 'Third month employment for NAICS 81 Other services, except public administration', 'Employment level for the third month of a given quarter for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (376, NULL, NULL, '"us.bls".naics_81_other_services_except_public_administration_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 81 Other services, except public administration', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (377, NULL, NULL, '"us.bls".naics_81_other_services_except_public_administration_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 81 Other services, except public administration', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (378, NULL, NULL, '"us.bls".naics_81_other_services_except_public_administration_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 81 Other services, except public administration', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (379, NULL, NULL, '"us.bls".naics_92_public_administration_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 92 Public administration', 'Average weekly wage for a given quarter for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (380, NULL, NULL, '"us.bls".naics_92_public_administration_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 92 Public administration', 'Count of establishments for a given quarter for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (381, NULL, NULL, '"us.bls".naics_92_public_administration_month3_emplvl', 'Numeric', 'Third month employment for NAICS 92 Public administration', 'Employment level for the third month of a given quarter for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (382, NULL, NULL, '"us.bls".naics_92_public_administration_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 92 Public administration', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (383, NULL, NULL, '"us.bls".naics_92_public_administration_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 92 Public administration', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (384, NULL, NULL, '"us.bls".naics_92_public_administration_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 92 Public administration', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (385, NULL, NULL, '"us.bls".naics_99_unclassified_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 99 Unclassified', 'Average weekly wage for a given quarter for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (386, NULL, NULL, '"us.bls".naics_99_unclassified_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 99 Unclassified', 'Count of establishments for a given quarter for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (387, NULL, NULL, '"us.bls".naics_99_unclassified_month3_emplvl', 'Numeric', 'Third month employment for NAICS 99 Unclassified', 'Employment level for the third month of a given quarter for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (416, NULL, NULL, '"us.bls".qtrly_estabs_naics1011', 'Numeric', 'Establishment count for Natural resources and mining', 'Count of establishments for a given quarter for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (388, NULL, NULL, '"us.bls".naics_99_unclassified_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 99 Unclassified', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (390, NULL, NULL, '"us.bls".naics_99_unclassified_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 99 Unclassified', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (391, NULL, NULL, '"us.bls".naics_31_33_manufacturing_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 31-33 Manufacturing', 'Average weekly wage for a given quarter for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (392, NULL, NULL, '"us.bls".naics_31_33_manufacturing_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 31-33 Manufacturing', 'Count of establishments for a given quarter for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (393, NULL, NULL, '"us.bls".naics_31_33_manufacturing_month3_emplvl', 'Numeric', 'Third month employment for NAICS 31-33 Manufacturing', 'Employment level for the third month of a given quarter for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (394, NULL, NULL, '"us.bls".naics_31_33_manufacturing_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 31-33 Manufacturing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (395, NULL, NULL, '"us.bls".naics_31_33_manufacturing_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 31-33 Manufacturing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (396, NULL, NULL, '"us.bls".naics_31_33_manufacturing_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 31-33 Manufacturing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (397, NULL, NULL, '"us.bls".naics_44_45_retail_trade_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 44-45 Retail trade', 'Average weekly wage for a given quarter for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (398, NULL, NULL, '"us.bls".naics_44_45_retail_trade_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 44-45 Retail trade', 'Count of establishments for a given quarter for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (399, NULL, NULL, '"us.bls".naics_44_45_retail_trade_month3_emplvl', 'Numeric', 'Third month employment for NAICS 44-45 Retail trade', 'Employment level for the third month of a given quarter for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (400, NULL, NULL, '"us.bls".naics_44_45_retail_trade_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 44-45 Retail trade', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (401, NULL, NULL, '"us.bls".naics_44_45_retail_trade_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 44-45 Retail trade', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (402, NULL, NULL, '"us.bls".naics_44_45_retail_trade_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 44-45 Retail trade', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (403, NULL, NULL, '"us.bls".naics_48_49_transportation_and_warehousing_avg_wkly_wage', 'Numeric', 'Average weekly wage for NAICS 48-49 Transportation and warehousing', 'Average weekly wage for a given quarter for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (404, NULL, NULL, '"us.bls".naics_48_49_transportation_and_warehousing_qtrly_estabs', 'Numeric', 'Establishment count for NAICS 48-49 Transportation and warehousing', 'Count of establishments for a given quarter for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (405, NULL, NULL, '"us.bls".naics_48_49_transportation_and_warehousing_month3_emplvl', 'Numeric', 'Third month employment for NAICS 48-49 Transportation and warehousing', 'Employment level for the third month of a given quarter for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (406, NULL, NULL, '"us.bls".naics_48_49_transportation_and_warehousing_lq_avg_wkly_wage', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 48-49 Transportation and warehousing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (407, NULL, NULL, '"us.bls".naics_48_49_transportation_and_warehousing_lq_qtrly_estabs', 'Numeric', 'Location quotient for NAICS 48-49 Transportation and warehousing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (408, NULL, NULL, '"us.bls".naics_48_49_transportation_and_warehousing_lq_month3_emplvl', 'Numeric', 'Location quotient third month for NAICS 48-49 Transportation and warehousing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (409, NULL, NULL, '"us.bls".avg_wkly_wage_naics10', 'Numeric', 'Average weekly wage for Total, all industries', 'Average weekly wage for a given quarter for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (410, NULL, NULL, '"us.bls".qtrly_estabs_naics10', 'Numeric', 'Establishment count for Total, all industries', 'Count of establishments for a given quarter for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (411, NULL, NULL, '"us.bls".month3_emplvl_naics10', 'Numeric', 'Third month employment for Total, all industries', 'Employment level for the third month of a given quarter for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (412, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics10', 'Numeric', 'Quarterly location quotient weekly wage for Total, all industries', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (413, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics10', 'Numeric', 'Location quotient for Total, all industries', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (414, NULL, NULL, '"us.bls".lq_month3_emplvl_naics10', 'Numeric', 'Location quotient third month for Total, all industries', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Total, all industries', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (417, NULL, NULL, '"us.bls".month3_emplvl_naics1011', 'Numeric', 'Third month employment for Natural resources and mining', 'Employment level for the third month of a given quarter for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (418, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1011', 'Numeric', 'Quarterly location quotient weekly wage for Natural resources and mining', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (419, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1011', 'Numeric', 'Location quotient for Natural resources and mining', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (420, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1011', 'Numeric', 'Location quotient third month for Natural resources and mining', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Natural resources and mining', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (421, NULL, NULL, '"us.bls".avg_wkly_wage_naics1012', 'Numeric', 'Average weekly wage for Construction', 'Average weekly wage for a given quarter for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (422, NULL, NULL, '"us.bls".qtrly_estabs_naics1012', 'Numeric', 'Establishment count for Construction', 'Count of establishments for a given quarter for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (423, NULL, NULL, '"us.bls".month3_emplvl_naics1012', 'Numeric', 'Third month employment for Construction', 'Employment level for the third month of a given quarter for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (424, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1012', 'Numeric', 'Quarterly location quotient weekly wage for Construction', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (425, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1012', 'Numeric', 'Location quotient for Construction', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (426, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1012', 'Numeric', 'Location quotient third month for Construction', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (427, NULL, NULL, '"us.bls".avg_wkly_wage_naics1013', 'Numeric', 'Average weekly wage for Manufacturing', 'Average weekly wage for a given quarter for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (428, NULL, NULL, '"us.bls".qtrly_estabs_naics1013', 'Numeric', 'Establishment count for Manufacturing', 'Count of establishments for a given quarter for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (429, NULL, NULL, '"us.bls".month3_emplvl_naics1013', 'Numeric', 'Third month employment for Manufacturing', 'Employment level for the third month of a given quarter for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (430, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1013', 'Numeric', 'Quarterly location quotient weekly wage for Manufacturing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (431, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1013', 'Numeric', 'Location quotient for Manufacturing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (432, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1013', 'Numeric', 'Location quotient third month for Manufacturing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (433, NULL, NULL, '"us.bls".avg_wkly_wage_naics1021', 'Numeric', 'Average weekly wage for Trade, transportation, and utilities', 'Average weekly wage for a given quarter for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (434, NULL, NULL, '"us.bls".qtrly_estabs_naics1021', 'Numeric', 'Establishment count for Trade, transportation, and utilities', 'Count of establishments for a given quarter for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (435, NULL, NULL, '"us.bls".month3_emplvl_naics1021', 'Numeric', 'Third month employment for Trade, transportation, and utilities', 'Employment level for the third month of a given quarter for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (436, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1021', 'Numeric', 'Quarterly location quotient weekly wage for Trade, transportation, and utilities', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (437, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1021', 'Numeric', 'Location quotient for Trade, transportation, and utilities', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (438, NULL, NULL, '"us.bls".qtrly_estabs_naics1027', 'Numeric', 'Establishment count for Other services', 'Count of establishments for a given quarter for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (439, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1021', 'Numeric', 'Location quotient third month for Trade, transportation, and utilities', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Trade, transportation, and utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (440, NULL, NULL, '"us.bls".avg_wkly_wage_naics1022', 'Numeric', 'Average weekly wage for Information', 'Average weekly wage for a given quarter for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (441, NULL, NULL, '"us.bls".qtrly_estabs_naics1022', 'Numeric', 'Establishment count for Information', 'Count of establishments for a given quarter for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (442, NULL, NULL, '"us.bls".month3_emplvl_naics1022', 'Numeric', 'Third month employment for Information', 'Employment level for the third month of a given quarter for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (443, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1022', 'Numeric', 'Quarterly location quotient weekly wage for Information', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (444, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1022', 'Numeric', 'Location quotient for Information', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (445, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1022', 'Numeric', 'Location quotient third month for Information', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (446, NULL, NULL, '"us.bls".avg_wkly_wage_naics1023', 'Numeric', 'Average weekly wage for Financial activities', 'Average weekly wage for a given quarter for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (447, NULL, NULL, '"us.bls".qtrly_estabs_naics1023', 'Numeric', 'Establishment count for Financial activities', 'Count of establishments for a given quarter for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (448, NULL, NULL, '"us.bls".month3_emplvl_naics1023', 'Numeric', 'Third month employment for Financial activities', 'Employment level for the third month of a given quarter for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (449, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1023', 'Numeric', 'Quarterly location quotient weekly wage for Financial activities', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (450, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1023', 'Numeric', 'Location quotient for Financial activities', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (451, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1023', 'Numeric', 'Location quotient third month for Financial activities', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Financial activities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (452, NULL, NULL, '"us.bls".avg_wkly_wage_naics1024', 'Numeric', 'Average weekly wage for Professional and business services', 'Average weekly wage for a given quarter for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (453, NULL, NULL, '"us.bls".qtrly_estabs_naics1024', 'Numeric', 'Establishment count for Professional and business services', 'Count of establishments for a given quarter for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (454, NULL, NULL, '"us.bls".month3_emplvl_naics1024', 'Numeric', 'Third month employment for Professional and business services', 'Employment level for the third month of a given quarter for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (455, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1024', 'Numeric', 'Quarterly location quotient weekly wage for Professional and business services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (456, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1024', 'Numeric', 'Location quotient for Professional and business services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (457, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1024', 'Numeric', 'Location quotient third month for Professional and business services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Professional and business services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (458, NULL, NULL, '"us.bls".avg_wkly_wage_naics1025', 'Numeric', 'Average weekly wage for Education and health services', 'Average weekly wage for a given quarter for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (459, NULL, NULL, '"us.bls".qtrly_estabs_naics1025', 'Numeric', 'Establishment count for Education and health services', 'Count of establishments for a given quarter for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (460, NULL, NULL, '"us.bls".month3_emplvl_naics1025', 'Numeric', 'Third month employment for Education and health services', 'Employment level for the third month of a given quarter for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (461, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1025', 'Numeric', 'Quarterly location quotient weekly wage for Education and health services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (462, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1025', 'Numeric', 'Location quotient for Education and health services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (463, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1025', 'Numeric', 'Location quotient third month for Education and health services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Education and health services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (464, NULL, NULL, '"us.bls".avg_wkly_wage_naics1026', 'Numeric', 'Average weekly wage for Leisure and hospitality', 'Average weekly wage for a given quarter for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (465, NULL, NULL, '"us.bls".qtrly_estabs_naics1026', 'Numeric', 'Establishment count for Leisure and hospitality', 'Count of establishments for a given quarter for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (466, NULL, NULL, '"us.bls".month3_emplvl_naics1026', 'Numeric', 'Third month employment for Leisure and hospitality', 'Employment level for the third month of a given quarter for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (467, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1026', 'Numeric', 'Quarterly location quotient weekly wage for Leisure and hospitality', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (468, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1026', 'Numeric', 'Location quotient for Leisure and hospitality', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (469, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1026', 'Numeric', 'Location quotient third month for Leisure and hospitality', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Leisure and hospitality', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (470, NULL, NULL, '"us.bls".avg_wkly_wage_naics1027', 'Numeric', 'Average weekly wage for Other services', 'Average weekly wage for a given quarter for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (471, NULL, NULL, '"us.bls".month3_emplvl_naics1027', 'Numeric', 'Third month employment for Other services', 'Employment level for the third month of a given quarter for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (472, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1027', 'Numeric', 'Quarterly location quotient weekly wage for Other services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (473, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1027', 'Numeric', 'Location quotient for Other services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (474, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1027', 'Numeric', 'Location quotient third month for Other services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Other services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (475, NULL, NULL, '"us.bls".avg_wkly_wage_naics1028', 'Numeric', 'Average weekly wage for Public administration', 'Average weekly wage for a given quarter for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (476, NULL, NULL, '"us.bls".qtrly_estabs_naics1028', 'Numeric', 'Establishment count for Public administration', 'Count of establishments for a given quarter for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (477, NULL, NULL, '"us.bls".month3_emplvl_naics1028', 'Numeric', 'Third month employment for Public administration', 'Employment level for the third month of a given quarter for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (478, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1028', 'Numeric', 'Quarterly location quotient weekly wage for Public administration', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (537, NULL, NULL, '"us.bls".qtrly_estabs_naics51', 'Numeric', 'Establishment count for NAICS 51 Information', 'Count of establishments for a given quarter for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (479, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1028', 'Numeric', 'Location quotient for Public administration', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (480, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1028', 'Numeric', 'Location quotient third month for Public administration', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (481, NULL, NULL, '"us.bls".avg_wkly_wage_naics1029', 'Numeric', 'Average weekly wage for Unclassified', 'Average weekly wage for a given quarter for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (482, NULL, NULL, '"us.bls".qtrly_estabs_naics1029', 'Numeric', 'Establishment count for Unclassified', 'Count of establishments for a given quarter for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (483, NULL, NULL, '"us.bls".month3_emplvl_naics1029', 'Numeric', 'Third month employment for Unclassified', 'Employment level for the third month of a given quarter for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (484, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics1029', 'Numeric', 'Quarterly location quotient weekly wage for Unclassified', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (485, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics1029', 'Numeric', 'Location quotient for Unclassified', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (486, NULL, NULL, '"us.bls".lq_month3_emplvl_naics1029', 'Numeric', 'Location quotient third month for Unclassified', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (487, NULL, NULL, '"us.bls".avg_wkly_wage_naics11', 'Numeric', 'Average weekly wage for NAICS 11 Agriculture, forestry, fishing and hunting', 'Average weekly wage for a given quarter for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (488, NULL, NULL, '"us.bls".qtrly_estabs_naics11', 'Numeric', 'Establishment count for NAICS 11 Agriculture, forestry, fishing and hunting', 'Count of establishments for a given quarter for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (489, NULL, NULL, '"us.bls".month3_emplvl_naics11', 'Numeric', 'Third month employment for NAICS 11 Agriculture, forestry, fishing and hunting', 'Employment level for the third month of a given quarter for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (490, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics11', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 11 Agriculture, forestry, fishing and hunting', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (491, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics11', 'Numeric', 'Location quotient for NAICS 11 Agriculture, forestry, fishing and hunting', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (492, NULL, NULL, '"us.bls".lq_month3_emplvl_naics11', 'Numeric', 'Location quotient third month for NAICS 11 Agriculture, forestry, fishing and hunting', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 11 Agriculture, forestry, fishing and hunting', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (493, NULL, NULL, '"us.bls".avg_wkly_wage_naics21', 'Numeric', 'Average weekly wage for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Average weekly wage for a given quarter for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (494, NULL, NULL, '"us.bls".qtrly_estabs_naics21', 'Numeric', 'Establishment count for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Count of establishments for a given quarter for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (495, NULL, NULL, '"us.bls".month3_emplvl_naics21', 'Numeric', 'Third month employment for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Employment level for the third month of a given quarter for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (496, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics21', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (497, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics21', 'Numeric', 'Location quotient for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (498, NULL, NULL, '"us.bls".lq_month3_emplvl_naics21', 'Numeric', 'Location quotient third month for NAICS 21 Mining, quarrying, and oil and gas extraction', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 21 Mining, quarrying, and oil and gas extraction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (499, NULL, NULL, '"us.bls".avg_wkly_wage_naics22', 'Numeric', 'Average weekly wage for NAICS 22 Utilities', 'Average weekly wage for a given quarter for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (500, NULL, NULL, '"us.bls".qtrly_estabs_naics22', 'Numeric', 'Establishment count for NAICS 22 Utilities', 'Count of establishments for a given quarter for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (501, NULL, NULL, '"us.bls".month3_emplvl_naics22', 'Numeric', 'Third month employment for NAICS 22 Utilities', 'Employment level for the third month of a given quarter for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (502, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics22', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 22 Utilities', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (503, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics22', 'Numeric', 'Location quotient for NAICS 22 Utilities', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (504, NULL, NULL, '"us.bls".lq_month3_emplvl_naics22', 'Numeric', 'Location quotient third month for NAICS 22 Utilities', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 22 Utilities', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (505, NULL, NULL, '"us.bls".avg_wkly_wage_naics23', 'Numeric', 'Average weekly wage for NAICS 23 Construction', 'Average weekly wage for a given quarter for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (506, NULL, NULL, '"us.bls".qtrly_estabs_naics23', 'Numeric', 'Establishment count for NAICS 23 Construction', 'Count of establishments for a given quarter for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (507, NULL, NULL, '"us.bls".month3_emplvl_naics23', 'Numeric', 'Third month employment for NAICS 23 Construction', 'Employment level for the third month of a given quarter for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (508, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics23', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 23 Construction', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (509, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics23', 'Numeric', 'Location quotient for NAICS 23 Construction', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (510, NULL, NULL, '"us.bls".lq_month3_emplvl_naics23', 'Numeric', 'Location quotient third month for NAICS 23 Construction', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 23 Construction', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (511, NULL, NULL, '"us.bls".avg_wkly_wage_naics31_33', 'Numeric', 'Average weekly wage for NAICS 31-33 Manufacturing', 'Average weekly wage for a given quarter for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (512, NULL, NULL, '"us.bls".qtrly_estabs_naics31_33', 'Numeric', 'Establishment count for NAICS 31-33 Manufacturing', 'Count of establishments for a given quarter for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (513, NULL, NULL, '"us.bls".month3_emplvl_naics31_33', 'Numeric', 'Third month employment for NAICS 31-33 Manufacturing', 'Employment level for the third month of a given quarter for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (514, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics31_33', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 31-33 Manufacturing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (515, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics31_33', 'Numeric', 'Location quotient for NAICS 31-33 Manufacturing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (516, NULL, NULL, '"us.bls".lq_month3_emplvl_naics31_33', 'Numeric', 'Location quotient third month for NAICS 31-33 Manufacturing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 31-33 Manufacturing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (517, NULL, NULL, '"us.bls".avg_wkly_wage_naics42', 'Numeric', 'Average weekly wage for NAICS 42 Wholesale trade', 'Average weekly wage for a given quarter for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (518, NULL, NULL, '"us.bls".qtrly_estabs_naics42', 'Numeric', 'Establishment count for NAICS 42 Wholesale trade', 'Count of establishments for a given quarter for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (519, NULL, NULL, '"us.bls".month3_emplvl_naics42', 'Numeric', 'Third month employment for NAICS 42 Wholesale trade', 'Employment level for the third month of a given quarter for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (520, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics42', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 42 Wholesale trade', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (521, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics42', 'Numeric', 'Location quotient for NAICS 42 Wholesale trade', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (522, NULL, NULL, '"us.bls".lq_month3_emplvl_naics42', 'Numeric', 'Location quotient third month for NAICS 42 Wholesale trade', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 42 Wholesale trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (523, NULL, NULL, '"us.bls".avg_wkly_wage_naics44_45', 'Numeric', 'Average weekly wage for NAICS 44-45 Retail trade', 'Average weekly wage for a given quarter for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (524, NULL, NULL, '"us.bls".qtrly_estabs_naics44_45', 'Numeric', 'Establishment count for NAICS 44-45 Retail trade', 'Count of establishments for a given quarter for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (525, NULL, NULL, '"us.bls".month3_emplvl_naics44_45', 'Numeric', 'Third month employment for NAICS 44-45 Retail trade', 'Employment level for the third month of a given quarter for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (526, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics44_45', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 44-45 Retail trade', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (527, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics44_45', 'Numeric', 'Location quotient for NAICS 44-45 Retail trade', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (528, NULL, NULL, '"us.bls".lq_month3_emplvl_naics44_45', 'Numeric', 'Location quotient third month for NAICS 44-45 Retail trade', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 44-45 Retail trade', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (529, NULL, NULL, '"us.bls".avg_wkly_wage_naics48_49', 'Numeric', 'Average weekly wage for NAICS 48-49 Transportation and warehousing', 'Average weekly wage for a given quarter for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (530, NULL, NULL, '"us.bls".qtrly_estabs_naics48_49', 'Numeric', 'Establishment count for NAICS 48-49 Transportation and warehousing', 'Count of establishments for a given quarter for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (531, NULL, NULL, '"us.bls".month3_emplvl_naics48_49', 'Numeric', 'Third month employment for NAICS 48-49 Transportation and warehousing', 'Employment level for the third month of a given quarter for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (532, NULL, NULL, '"us.bls".month3_emplvl_naics55', 'Numeric', 'Third month employment for NAICS 55 Management of companies and enterprises', 'Employment level for the third month of a given quarter for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (533, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics48_49', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 48-49 Transportation and warehousing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (534, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics48_49', 'Numeric', 'Location quotient for NAICS 48-49 Transportation and warehousing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (535, NULL, NULL, '"us.bls".lq_month3_emplvl_naics48_49', 'Numeric', 'Location quotient third month for NAICS 48-49 Transportation and warehousing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 48-49 Transportation and warehousing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (536, NULL, NULL, '"us.bls".avg_wkly_wage_naics51', 'Numeric', 'Average weekly wage for NAICS 51 Information', 'Average weekly wage for a given quarter for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (539, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics51', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 51 Information', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (540, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics51', 'Numeric', 'Location quotient for NAICS 51 Information', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (541, NULL, NULL, '"us.bls".lq_month3_emplvl_naics51', 'Numeric', 'Location quotient third month for NAICS 51 Information', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 51 Information', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (542, NULL, NULL, '"us.bls".avg_wkly_wage_naics52', 'Numeric', 'Average weekly wage for NAICS 52 Finance and insurance', 'Average weekly wage for a given quarter for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (543, NULL, NULL, '"us.bls".qtrly_estabs_naics52', 'Numeric', 'Establishment count for NAICS 52 Finance and insurance', 'Count of establishments for a given quarter for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (544, NULL, NULL, '"us.bls".month3_emplvl_naics52', 'Numeric', 'Third month employment for NAICS 52 Finance and insurance', 'Employment level for the third month of a given quarter for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (545, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics52', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 52 Finance and insurance', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (546, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics52', 'Numeric', 'Location quotient for NAICS 52 Finance and insurance', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (547, NULL, NULL, '"us.bls".lq_month3_emplvl_naics52', 'Numeric', 'Location quotient third month for NAICS 52 Finance and insurance', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 52 Finance and insurance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (548, NULL, NULL, '"us.bls".avg_wkly_wage_naics53', 'Numeric', 'Average weekly wage for NAICS 53 Real estate and rental and leasing', 'Average weekly wage for a given quarter for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (549, NULL, NULL, '"us.bls".qtrly_estabs_naics53', 'Numeric', 'Establishment count for NAICS 53 Real estate and rental and leasing', 'Count of establishments for a given quarter for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (550, NULL, NULL, '"us.bls".month3_emplvl_naics53', 'Numeric', 'Third month employment for NAICS 53 Real estate and rental and leasing', 'Employment level for the third month of a given quarter for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (551, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics53', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 53 Real estate and rental and leasing', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (552, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics53', 'Numeric', 'Location quotient for NAICS 53 Real estate and rental and leasing', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (553, NULL, NULL, '"us.bls".lq_month3_emplvl_naics53', 'Numeric', 'Location quotient third month for NAICS 53 Real estate and rental and leasing', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 53 Real estate and rental and leasing', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (554, NULL, NULL, '"us.bls".avg_wkly_wage_naics54', 'Numeric', 'Average weekly wage for NAICS 54 Professional and technical services', 'Average weekly wage for a given quarter for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (555, NULL, NULL, '"us.bls".qtrly_estabs_naics54', 'Numeric', 'Establishment count for NAICS 54 Professional and technical services', 'Count of establishments for a given quarter for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (556, NULL, NULL, '"us.bls".month3_emplvl_naics54', 'Numeric', 'Third month employment for NAICS 54 Professional and technical services', 'Employment level for the third month of a given quarter for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (557, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics54', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 54 Professional and technical services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (558, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics54', 'Numeric', 'Location quotient for NAICS 54 Professional and technical services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (559, NULL, NULL, '"us.bls".lq_month3_emplvl_naics54', 'Numeric', 'Location quotient third month for NAICS 54 Professional and technical services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 54 Professional and technical services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (560, NULL, NULL, '"us.bls".avg_wkly_wage_naics55', 'Numeric', 'Average weekly wage for NAICS 55 Management of companies and enterprises', 'Average weekly wage for a given quarter for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (561, NULL, NULL, '"us.bls".qtrly_estabs_naics55', 'Numeric', 'Establishment count for NAICS 55 Management of companies and enterprises', 'Count of establishments for a given quarter for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (617, NULL, NULL, '"us.census.acs".B03002002', 'Numeric', 'Population not Hispanic', 'The number of people not identifying as Hispanic or Latino in each geography.', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (562, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics55', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 55 Management of companies and enterprises', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (563, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics55', 'Numeric', 'Location quotient for NAICS 55 Management of companies and enterprises', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (564, NULL, NULL, '"us.bls".lq_month3_emplvl_naics55', 'Numeric', 'Location quotient third month for NAICS 55 Management of companies and enterprises', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 55 Management of companies and enterprises', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (565, NULL, NULL, '"us.bls".avg_wkly_wage_naics56', 'Numeric', 'Average weekly wage for NAICS 56 Administrative and waste services', 'Average weekly wage for a given quarter for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (566, NULL, NULL, '"us.bls".qtrly_estabs_naics56', 'Numeric', 'Establishment count for NAICS 56 Administrative and waste services', 'Count of establishments for a given quarter for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (567, NULL, NULL, '"us.bls".month3_emplvl_naics56', 'Numeric', 'Third month employment for NAICS 56 Administrative and waste services', 'Employment level for the third month of a given quarter for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (568, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics56', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 56 Administrative and waste services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (569, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics56', 'Numeric', 'Location quotient for NAICS 56 Administrative and waste services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (570, NULL, NULL, '"us.bls".lq_month3_emplvl_naics56', 'Numeric', 'Location quotient third month for NAICS 56 Administrative and waste services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 56 Administrative and waste services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (571, NULL, NULL, '"us.bls".avg_wkly_wage_naics61', 'Numeric', 'Average weekly wage for NAICS 61 Educational services', 'Average weekly wage for a given quarter for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (572, NULL, NULL, '"us.bls".qtrly_estabs_naics61', 'Numeric', 'Establishment count for NAICS 61 Educational services', 'Count of establishments for a given quarter for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (573, NULL, NULL, '"us.bls".month3_emplvl_naics61', 'Numeric', 'Third month employment for NAICS 61 Educational services', 'Employment level for the third month of a given quarter for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (574, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics61', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 61 Educational services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (575, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics61', 'Numeric', 'Location quotient for NAICS 61 Educational services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (576, NULL, NULL, '"us.bls".lq_month3_emplvl_naics61', 'Numeric', 'Location quotient third month for NAICS 61 Educational services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 61 Educational services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (577, NULL, NULL, '"us.bls".avg_wkly_wage_naics62', 'Numeric', 'Average weekly wage for NAICS 62 Health care and social assistance', 'Average weekly wage for a given quarter for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (578, NULL, NULL, '"us.bls".qtrly_estabs_naics62', 'Numeric', 'Establishment count for NAICS 62 Health care and social assistance', 'Count of establishments for a given quarter for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (579, NULL, NULL, '"us.bls".month3_emplvl_naics62', 'Numeric', 'Third month employment for NAICS 62 Health care and social assistance', 'Employment level for the third month of a given quarter for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (580, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics62', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 62 Health care and social assistance', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (581, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics62', 'Numeric', 'Location quotient for NAICS 62 Health care and social assistance', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (582, NULL, NULL, '"us.bls".lq_month3_emplvl_naics62', 'Numeric', 'Location quotient third month for NAICS 62 Health care and social assistance', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 62 Health care and social assistance', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (583, NULL, NULL, '"us.bls".avg_wkly_wage_naics71', 'Numeric', 'Average weekly wage for NAICS 71 Arts, entertainment, and recreation', 'Average weekly wage for a given quarter for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (584, NULL, NULL, '"us.bls".qtrly_estabs_naics71', 'Numeric', 'Establishment count for NAICS 71 Arts, entertainment, and recreation', 'Count of establishments for a given quarter for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (585, NULL, NULL, '"us.bls".month3_emplvl_naics71', 'Numeric', 'Third month employment for NAICS 71 Arts, entertainment, and recreation', 'Employment level for the third month of a given quarter for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (586, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics71', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 71 Arts, entertainment, and recreation', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (587, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics71', 'Numeric', 'Location quotient for NAICS 71 Arts, entertainment, and recreation', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (649, NULL, NULL, '"us.census.acs".B19001005', 'Numeric', 'Households with income of $20,000 To $24,999', 'The number of households in a geographic area whose annual income was between $20,000 and $24,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (588, NULL, NULL, '"us.bls".lq_month3_emplvl_naics71', 'Numeric', 'Location quotient third month for NAICS 71 Arts, entertainment, and recreation', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 71 Arts, entertainment, and recreation', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (589, NULL, NULL, '"us.bls".avg_wkly_wage_naics72', 'Numeric', 'Average weekly wage for NAICS 72 Accommodation and food services', 'Average weekly wage for a given quarter for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (591, NULL, NULL, '"us.bls".qtrly_estabs_naics72', 'Numeric', 'Establishment count for NAICS 72 Accommodation and food services', 'Count of establishments for a given quarter for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (654, NULL, NULL, '"us.census.acs".B19001010', 'Numeric', 'Households with income of $45,000 To $49,999', 'The number of households in a geographic area whose annual income was between $45,000 and $49,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (592, NULL, NULL, '"us.bls".month3_emplvl_naics72', 'Numeric', 'Third month employment for NAICS 72 Accommodation and food services', 'Employment level for the third month of a given quarter for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (593, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics72', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 72 Accommodation and food services', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (594, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics72', 'Numeric', 'Location quotient for NAICS 72 Accommodation and food services', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (595, NULL, NULL, '"us.bls".lq_month3_emplvl_naics72', 'Numeric', 'Location quotient third month for NAICS 72 Accommodation and food services', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 72 Accommodation and food services', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (596, NULL, NULL, '"us.bls".avg_wkly_wage_naics81', 'Numeric', 'Average weekly wage for NAICS 81 Other services, except public administration', 'Average weekly wage for a given quarter for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (597, NULL, NULL, '"us.bls".qtrly_estabs_naics81', 'Numeric', 'Establishment count for NAICS 81 Other services, except public administration', 'Count of establishments for a given quarter for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (598, NULL, NULL, '"us.bls".month3_emplvl_naics81', 'Numeric', 'Third month employment for NAICS 81 Other services, except public administration', 'Employment level for the third month of a given quarter for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (599, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics81', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 81 Other services, except public administration', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (600, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics81', 'Numeric', 'Location quotient for NAICS 81 Other services, except public administration', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (601, NULL, NULL, '"us.bls".lq_month3_emplvl_naics81', 'Numeric', 'Location quotient third month for NAICS 81 Other services, except public administration', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 81 Other services, except public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (602, NULL, NULL, '"us.bls".avg_wkly_wage_naics92', 'Numeric', 'Average weekly wage for NAICS 92 Public administration', 'Average weekly wage for a given quarter for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (603, NULL, NULL, '"us.bls".qtrly_estabs_naics92', 'Numeric', 'Establishment count for NAICS 92 Public administration', 'Count of establishments for a given quarter for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (604, NULL, NULL, '"us.bls".month3_emplvl_naics92', 'Numeric', 'Third month employment for NAICS 92 Public administration', 'Employment level for the third month of a given quarter for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (605, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics92', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 92 Public administration', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (606, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics92', 'Numeric', 'Location quotient for NAICS 92 Public administration', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (607, NULL, NULL, '"us.bls".lq_month3_emplvl_naics92', 'Numeric', 'Location quotient third month for NAICS 92 Public administration', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 92 Public administration', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (608, NULL, NULL, '"us.bls".avg_wkly_wage_naics99', 'Numeric', 'Average weekly wage for NAICS 99 Unclassified', 'Average weekly wage for a given quarter for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (609, NULL, NULL, '"us.bls".qtrly_estabs_naics99', 'Numeric', 'Establishment count for NAICS 99 Unclassified', 'Count of establishments for a given quarter for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (610, NULL, NULL, '"us.bls".month3_emplvl_naics99', 'Numeric', 'Third month employment for NAICS 99 Unclassified', 'Employment level for the third month of a given quarter for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (611, NULL, NULL, '"us.bls".lq_avg_wkly_wage_naics99', 'Numeric', 'Quarterly location quotient weekly wage for NAICS 99 Unclassified', 'Location quotient of the average weekly wage for a given quarter relative to the U.S. (Rounded to hundredths place) for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (612, NULL, NULL, '"us.bls".lq_qtrly_estabs_naics99', 'Numeric', 'Location quotient for NAICS 99 Unclassified', 'Location quotient of the quarterly establishment count relative to the U.S. (Rounded to hundredths place) for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (613, NULL, NULL, '"us.bls".lq_month3_emplvl_naics99', 'Numeric', 'Location quotient third month for NAICS 99 Unclassified', 'Location quotient of the employment level for the third month of a given quarter relative to the U.S. (Rounded to hundredths place)), for NAICS 99 Unclassified', 0, 'sum', 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (614, NULL, NULL, '"us.census.acs".B03002005', 'Numeric', 'American Indian and Alaska Native Population', 'The number of people identifying as American Indian or Alaska native in each geography.', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (615, NULL, NULL, '"us.census.acs".B03002008', 'Numeric', 'Other Race population', 'The number of people identifying as another race in each geography', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (616, NULL, NULL, '"us.census.acs".B03002009', 'Numeric', 'Two or more races population', 'The number of people identifying as two or more races in each geography', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (618, NULL, NULL, '"us.census.acs".B08006001', 'Numeric', 'Workers over the Age of 16', 'The number of people in each geography who work. Workers include those employed at private for-profit companies, the self-employed, government workers and non-profit employees.', 5, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (619, NULL, NULL, '"us.census.acs".B08006002', 'Numeric', 'Commuters by Car, Truck, or Van', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by car, truck or van. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (655, NULL, NULL, '"us.census.acs".B19001011', 'Numeric', 'Households with income of $50,000 To $59,999', 'The number of households in a geographic area whose annual income was between $50,000 and $59,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (620, NULL, NULL, '"us.census.acs".B08006004', 'Numeric', 'Commuters by Carpool', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by carpool. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (621, NULL, NULL, '"us.census.acs".B08006003', 'Numeric', 'Commuters who drove alone', 'The number of workers age 16 years and over within a geographic area who primarily traveled by car driving alone. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (622, NULL, NULL, '"us.census.acs".B11001001', 'Numeric', 'Households', 'A count of the number of households in each geography. A household consists of one or more people who live in the same dwelling and also share at meals or living accommodation, and may consist of a single family or some other grouping of people. ', 8, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (623, NULL, NULL, '"us.census.acs".B19001017', 'Numeric', 'Households with income of $200,000 Or More', 'The number of households in a geographic area whose annual income was more than $200,000.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (624, NULL, NULL, '"us.census.acs".B15003019', 'Numeric', 'Population completed less than one year of college, no degree', 'The number of people in a geographic area over the age of 25 who attended college for less than one year and no further.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (625, NULL, NULL, '"us.census.acs".B15003020', 'Numeric', 'Population completed more than one year of college, no degree', 'The number of people in a geographic area over the age of 25 who attended college for more than one year but did not obtain a degree', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (626, NULL, NULL, '"us.census.acs".B15003021', 'Numeric', 'Population Completed Associate''s Degree', 'The number of people in a geographic area over the age of 25 who obtained a associate''s degree, and did not complete a more advanced degree.', 4, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (627, NULL, NULL, '"us.census.acs".B23008010', 'Numeric', 'One-parent families, father in labor force, with young children (under 6 years of age)', '', 0, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (629, NULL, NULL, '"us.census.acs".B12005001', 'Numeric', 'Population 15 Years and Over', 'The number of people in a geographic area who are over the age of 15. This is used mostly as a denominator of marital status.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (630, NULL, NULL, '"us.census.acs".B12005015', 'Numeric', 'Divorced', 'The number of people in a geographic area who are divorced', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (631, NULL, NULL, '"us.census.acs".B12005002', 'Numeric', 'Never Married', 'The number of people in a geographic area who have never been married.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (632, NULL, NULL, '"us.census.acs".B12005005', 'Numeric', 'Currently married', 'The number of people in a geographic area who are currently married', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (633, NULL, NULL, '"us.census.acs".B12005008', 'Numeric', 'Married but separated', 'The number of people in a geographic area who are married but separated', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (634, NULL, NULL, '"us.census.acs".B12005012', 'Numeric', 'Widowed', 'The number of people in a geographic area who are widowed', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (635, NULL, NULL, '"us.census.acs".B08134001', 'Numeric', 'Workers age 16 and over who do not work from home', 'The number of workers over the age of 16 who do not work from home in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (636, NULL, NULL, '"us.census.acs".B08135001', 'Numeric', 'Aggregate travel time to work', 'The total number of minutes every worker over the age of 16 who did not work from home spent spent commuting to work in one day in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (637, NULL, NULL, '"us.census.acs".B08134002', 'Numeric', 'Number of workers with less than 10 minute commute', 'The number of workers over the age of 16 who do not work from home and commute in less than 10 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (638, NULL, NULL, '"us.census.acs".B08134003', 'Numeric', 'Number of workers with a commute between 10 and 14 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 10 and 14 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (639, NULL, NULL, '"us.census.acs".B08134004', 'Numeric', 'Number of workers with a commute between 15 and 19 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 15 and 19 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (640, NULL, NULL, '"us.census.acs".B08134005', 'Numeric', 'Number of workers with a commute between 20 and 24 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 20 and 24 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (641, NULL, NULL, '"us.census.acs".B08134006', 'Numeric', 'Number of workers with a commute between 25 and 29 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 25 and 29 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (642, NULL, NULL, '"us.census.acs".B08134007', 'Numeric', 'Number of workers with a commute between 30 and 34 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 30 and 34 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (643, NULL, NULL, '"us.census.acs".B08134008', 'Numeric', 'Number of workers with a commute between 35 and 44 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 35 and 44 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (644, NULL, NULL, '"us.census.acs".B08134009', 'Numeric', 'Number of workers with a commute between 45 and 59 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 45 and 59 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (645, NULL, NULL, '"us.census.acs".B08134010', 'Numeric', 'Number of workers with a commute of over 60 minutes', 'The number of workers over the age of 16 who do not work from home and commute in over 60 minutes in a geographic area', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (646, NULL, NULL, '"us.census.acs".B19001002', 'Numeric', 'Households with income less than $10,000', 'The number of households in a geographic area whose annual income was less than $10,000.', 2, 'sum', 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (647, NULL, NULL, '"us.census.acs".B19001003', 'Numeric', 'Households with income of $10,000 to $14,999', 'The number of households in a geographic area whose annual income was between $10,000 and $14,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (648, NULL, NULL, '"us.census.acs".B19001004', 'Numeric', 'Households with income of $15,000 to $19,999', 'The number of households in a geographic area whose annual income was between $15,000 and $19,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (650, NULL, NULL, '"us.census.acs".B19001006', 'Numeric', 'Households with income of $25,000 To $29,999', 'The number of households in a geographic area whose annual income was between $20,000 and $24,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (651, NULL, NULL, '"us.census.acs".B19001007', 'Numeric', 'Households with income of $30,000 To $34,999', 'The number of households in a geographic area whose annual income was between $30,000 and $34,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (652, NULL, NULL, '"us.census.acs".B19001008', 'Numeric', 'Households with income of $35,000 To $39,999', 'The number of households in a geographic area whose annual income was between $35,000 and $39,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (653, NULL, NULL, '"us.census.acs".B19001009', 'Numeric', 'Households with income of $40,000 To $44,999', 'The number of households in a geographic area whose annual income was between $40,000 and $44,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (656, NULL, NULL, '"us.census.acs".B19001012', 'Numeric', 'Households with income of $60,000 To $74,999', 'The number of households in a geographic area whose annual income was between $60,000 and $74,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (657, NULL, NULL, '"us.census.acs".B19001013', 'Numeric', 'Households with income of $75,000 To $99,999', 'The number of households in a geographic area whose annual income was between $75,000 and $99,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (658, NULL, NULL, '"us.census.acs".B19001014', 'Numeric', 'Households with income of $100,000 To $124,999', 'The number of households in a geographic area whose annual income was between $100,000 and $124,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (659, NULL, NULL, '"us.census.acs".B19001015', 'Numeric', 'Households with income of $125,000 To $149,999', 'The number of households in a geographic area whose annual income was between $125,000 and $149,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (660, NULL, NULL, '"us.census.acs".B19001016', 'Numeric', 'Households with income of $150,000 To $199,999', 'The number of households in a geographic area whose annual income was between $150,000 and $1999,999.', 2, NULL, 1, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (662, NULL, NULL, '"us.ny.nyc.opendata".good_through_date', 'Date', 'Good Through Date', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (663, NULL, NULL, '"us.ny.nyc.opendata".record_type', 'Text', 'Record Type', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (664, NULL, NULL, '"us.ny.nyc.opendata"."us.ny.nyc.opendata".document_id', 'Text', 'Document ID', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (665, NULL, NULL, '"us.ny.nyc.opendata"."us.ny.nyc.opendata".record_type', 'Text', 'Record Type', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (666, NULL, NULL, '"us.ny.nyc.opendata".block', 'Integer', 'Block', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (667, NULL, NULL, '"us.ny.nyc.opendata".lot', 'Integer', 'Lot', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (668, NULL, NULL, '"us.ny.nyc.opendata".easement', 'Text', 'Easement', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (669, NULL, NULL, '"us.ny.nyc.opendata".partial_lot', 'Text', 'Partial Lot', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (670, NULL, NULL, '"us.ny.nyc.opendata".air_rights', 'Text', 'Air Rights', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (671, NULL, NULL, '"us.ny.nyc.opendata".subterranean_rights', 'Text', 'Subterranean Rights', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (672, NULL, NULL, '"us.ny.nyc.opendata".property_type', 'Text', 'Property Type', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (673, NULL, NULL, '"us.ny.nyc.opendata".street_number', 'Text', 'Street Number', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (674, NULL, NULL, '"us.ny.nyc.opendata".street_name', 'Text', 'Street Name', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (675, NULL, NULL, '"us.ny.nyc.opendata".unit', 'Text', 'Unit', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (676, NULL, NULL, '"us.ny.nyc.opendata"."us.ny.nyc.opendata".good_through_date', 'Date', 'Good Through Date', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (677, NULL, NULL, '"us.census.spielman_singleton_segments".X10', 'Text', 'SS_segment_10_clusters', 'Sociodemographic classes from Spielman and Singleton 2015, 10 clusters', 0, NULL, 3, '{"categories": {"Hispanic and Young": "Hispanic and Young description", "Wealthy Nuclear Families": "Wealthy Nuclear Families desc", "Middle Income, Single Family Home": "Middle Income, Single Family Home desc", "Native American": "Native American desc", "Wealthy, urban without Kids": "Wealthy, urban without Kids desc", "Low income and diverse": "Low income and diverse desc", "Wealthy Old Caucasion": "Wealthy Old Caucasion desc", "Low income, mix of minorities": "Low income, mix of minorities desc", "Low income, African American": "Low income, African American desc", "Residential Institutions": "Residential Institutions desc"}}');
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (678, NULL, NULL, '"us.census.spielman_singleton_segments".X2', 'Text', 'SS_segment_2_clusters', 'Sociodemographic classes from Spielman and Singleton 2015, 10 clusters', 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (679, NULL, NULL, '"us.ny.nyc.opendata".crfn', 'Text', 'City Reel File Number', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (680, NULL, NULL, '"us.ny.nyc.opendata".borough', 'Text', 'borough', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (681, NULL, NULL, '"us.ny.nyc.opendata".doc_type', 'Text', 'Document Type', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (682, NULL, NULL, '"us.ny.nyc.opendata".doc_date', 'Text', 'Document Date', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (683, NULL, NULL, '"us.ny.nyc.opendata".doc_amt', 'Text', 'Document Amount', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (684, NULL, NULL, '"us.ny.nyc.opendata".recorded_filed', 'Text', 'Recorded / Filed', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (685, NULL, NULL, '"us.ny.nyc.opendata".modified_date', 'Date', 'Modified Date', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (686, NULL, NULL, '"us.ny.nyc.opendata".reel_year', 'Integer', 'Reel Year', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (687, NULL, NULL, '"us.ny.nyc.opendata".reel_nbr', 'Text', 'Reel Number', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (688, NULL, NULL, '"us.ny.nyc.opendata".reel_page', 'Text', 'Reel Pgae', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (689, NULL, NULL, '"us.ny.nyc.opendata".percent_transferred', 'Text', 'precent_transferred', NULL, 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (690, NULL, NULL, '"us.ny.nyc.opendata".party_type', 'Integer', 'Party Type', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (691, NULL, NULL, '"us.ny.nyc.opendata".name', 'Text', 'Name', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (692, NULL, NULL, '"us.ny.nyc.opendata".address1', 'Text', 'Address 1', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (693, NULL, NULL, '"us.ny.nyc.opendata".address2', 'Text', 'Address 2', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (694, NULL, NULL, '"us.ny.nyc.opendata".country', 'Text', 'country', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (695, NULL, NULL, '"us.ny.nyc.opendata".city', 'Text', 'city', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (696, NULL, NULL, '"us.ny.nyc.opendata".state', 'Text', 'state', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (697, NULL, NULL, '"us.ny.nyc.opendata".zip', 'Text', 'zip', NULL, 0, NULL, 0, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (698, NULL, NULL, '"us.census.spielman_singleton_segments".X31', 'Text', 'SS_segment_31_clusters', 'Sociodemographic classes from Spielman and Singleton 2015, 10 clusters', 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (699, NULL, NULL, '"us.census.spielman_singleton_segments".X55', 'Text', 'SS_segment_55_clusters', 'Sociodemographic classes from Spielman and Singleton 2015, 10 clusters', 0, NULL, 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (700, NULL, NULL, '"us.census.acs".B01001001_quantile', 'Numeric', 'Quantile:Total Population', 'The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (702, NULL, NULL, '"us.census.acs".B01001026_quantile', 'Numeric', 'Quantile:Female Population', 'The number of people within each geography who are female.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (703, NULL, NULL, '"us.census.acs".B01002001_quantile', 'Numeric', 'Quantile:Median Age', 'The median age of all people in a given geographic area.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (704, NULL, NULL, '"us.census.acs".B03002003_quantile', 'Numeric', 'Quantile:White Population', 'The number of people identifying as white, non-Hispanic in each geography.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (705, NULL, NULL, '"us.census.acs".B03002004_quantile', 'Numeric', 'Quantile:Black or African American Population', 'The number of people identifying as black or African American, non-Hispanic in each geography.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (706, NULL, NULL, '"us.census.acs".B03002006_quantile', 'Numeric', 'Quantile:Asian Population', 'The number of people identifying as Asian, non-Hispanic in each geography.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (707, NULL, NULL, '"us.census.acs".B03002012_quantile', 'Numeric', 'Quantile:Hispanic Population', 'The number of people identifying as Hispanic or Latino in each geography.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (708, NULL, NULL, '"us.census.acs".B03002005_quantile', 'Numeric', 'Quantile:American Indian and Alaska Native Population', 'The number of people identifying as American Indian or Alaska native in each geography.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (709, NULL, NULL, '"us.census.acs".B03002008_quantile', 'Numeric', 'Quantile:Other Race population', 'The number of people identifying as another race in each geography', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (710, NULL, NULL, '"us.census.acs".B03002009_quantile', 'Numeric', 'Quantile:Two or more races population', 'The number of people identifying as two or more races in each geography', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (711, NULL, NULL, '"us.census.acs".B03002002_quantile', 'Numeric', 'Quantile:Population not Hispanic', 'The number of people not identifying as Hispanic or Latino in each geography.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (712, NULL, NULL, '"us.census.acs".B05001006_quantile', 'Numeric', 'Quantile:Not a U.S. Citizen Population', 'The number of people within each geography who indicated that they are not U.S. citizens.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (713, NULL, NULL, '"us.census.acs".B08006001_quantile', 'Numeric', 'Quantile:Workers over the Age of 16', 'The number of people in each geography who work. Workers include those employed at private for-profit companies, the self-employed, government workers and non-profit employees.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (714, NULL, NULL, '"us.census.acs".B08006002_quantile', 'Numeric', 'Quantile:Commuters by Car, Truck, or Van', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by car, truck or van. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (715, NULL, NULL, '"us.census.acs".B08006003_quantile', 'Numeric', 'Quantile:Commuters who drove alone', 'The number of workers age 16 years and over within a geographic area who primarily traveled by car driving alone. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (716, NULL, NULL, '"us.census.acs".B08006004_quantile', 'Numeric', 'Quantile:Commuters by Carpool', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by carpool. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (717, NULL, NULL, '"us.census.acs".B08006008_quantile', 'Numeric', 'Quantile:Commuters by Public Transportation', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by public transportation. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (718, NULL, NULL, '"us.census.acs".B08006009_quantile', 'Numeric', 'Quantile:Commuters by Bus', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by bus. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (719, NULL, NULL, '"us.census.acs".B08006011_quantile', 'Numeric', 'Quantile:Commuters by Subway or Elevated', 'The number of workers age 16 years and over within a geographic area who primarily traveled to work by subway or elevated train. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (720, NULL, NULL, '"us.census.acs".B08006015_quantile', 'Numeric', 'Quantile:Walked to Work', 'The number of workers age 16 years and over within a geographic area who primarily walked to work. This would mean that of any way of getting to work, they travelled the most distance walking.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (721, NULL, NULL, '"us.census.acs".B08006017_quantile', 'Numeric', 'Quantile:Worked at Home', 'The count within a geographical area of workers over the age of 16 who worked at home.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (722, NULL, NULL, '"us.census.acs".B09001001_quantile', 'Numeric', 'Quantile:children under 18 Years of Age', 'The number of people within each geography who are under 18 years of age.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (723, NULL, NULL, '"us.census.acs".B11001001_quantile', 'Numeric', 'Quantile:Households', 'A count of the number of households in each geography. A household consists of one or more people who live in the same dwelling and also share at meals or living accommodation, and may consist of a single family or some other grouping of people. ', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (724, NULL, NULL, '"us.census.acs".B14001001_quantile', 'Numeric', 'Quantile:Population 3 Years and Over', 'The total number of people in each geography age 3 years and over. This denominator is mostly used to calculate rates of school enrollment.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (725, NULL, NULL, '"us.census.acs".B14001002_quantile', 'Numeric', 'Quantile:Students Enrolled in School', 'The total number of people in each geography currently enrolled at any level of school, from nursery or pre-school to advanced post-graduate education. Only includes those over the age of 3.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (726, NULL, NULL, '"us.census.acs".B14001005_quantile', 'Numeric', 'Quantile:Students Enrolled in Grades 1 to 4', 'The total number of people in each geography currently enrolled in grades 1 through 4 inclusive. This corresponds roughly to elementary school.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (727, NULL, NULL, '"us.census.acs".B14001006_quantile', 'Numeric', 'Quantile:Students Enrolled in Grades 5 to 8', 'The total number of people in each geography currently enrolled in grades 5 through 8 inclusive. This corresponds roughly to middle school.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (728, NULL, NULL, '"us.census.acs".B14001007_quantile', 'Numeric', 'Quantile:Students Enrolled in Grades 9 to 12', 'The total number of people in each geography currently enrolled in grades 9 through 12 inclusive. This corresponds roughly to high school.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (729, NULL, NULL, '"us.census.acs".B14001008_quantile', 'Numeric', 'Quantile:Students Enrolled as Undergraduate in College', 'The number of people in a geographic area who are enrolled in college at the undergraduate level. Enrollment refers to being registered or listed as a student in an educational program leading to a college degree. This may be a public school or college, a private school or college.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (730, NULL, NULL, '"us.census.acs".B15003001_quantile', 'Numeric', 'Quantile:Population 25 Years and Over', 'The number of people in a geographic area who are over the age of 25. This is used mostly as a denominator of educational attainment.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (731, NULL, NULL, '"us.census.acs".B15003017_quantile', 'Numeric', 'Quantile:Population Completed High School', 'The number of people in a geographic area over the age of 25 who completed high school, and did not complete a more advanced degree.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (732, NULL, NULL, '"us.census.acs".B15003019_quantile', 'Numeric', 'Quantile:Population completed less than one year of college, no degree', 'The number of people in a geographic area over the age of 25 who attended college for less than one year and no further.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (733, NULL, NULL, '"us.census.acs".B15003020_quantile', 'Numeric', 'Quantile:Population completed more than one year of college, no degree', 'The number of people in a geographic area over the age of 25 who attended college for more than one year but did not obtain a degree', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (734, NULL, NULL, '"us.census.acs".B15003021_quantile', 'Numeric', 'Quantile:Population Completed Associate''s Degree', 'The number of people in a geographic area over the age of 25 who obtained a associate''s degree, and did not complete a more advanced degree.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (735, NULL, NULL, '"us.census.acs".B15003022_quantile', 'Numeric', 'Quantile:Population Completed Bachelor''s Degree', 'The number of people in a geographic area over the age of 25 who obtained a bachelor''s degree, and did not complete a more advanced degree.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (736, NULL, NULL, '"us.census.acs".B15003023_quantile', 'Numeric', 'Quantile:Population Completed Master''s Degree', 'The number of people in a geographic area over the age of 25 who obtained a master''s degree, but did not complete a more advanced degree.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (737, NULL, NULL, '"us.census.acs".B16001001_quantile', 'Numeric', 'Quantile:Population 5 Years and Over', 'The number of people in a geographic area who are over the age of 5. This is primarily used as a denominator of measures of language spoken at home.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (738, NULL, NULL, '"us.census.acs".B16001002_quantile', 'Numeric', 'Quantile:Speaks only English at Home', 'The number of people in a geographic area over age 5 who speak only English at home.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (739, NULL, NULL, '"us.census.acs".B16001003_quantile', 'Numeric', 'Quantile:Speaks Spanish at Home', 'The number of people in a geographic area over age 5 who speak Spanish at home, possibly in addition to other languages.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (740, NULL, NULL, '"us.census.acs".B17001001_quantile', 'Numeric', 'Quantile:Population for Whom Poverty Status Determined', 'The number of people in each geography who could be identified as either living in poverty or not. This should be used as the denominator when calculating poverty rates, as it excludes people for whom it was not possible to determine poverty.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (741, NULL, NULL, '"us.census.acs".B17001002_quantile', 'Numeric', 'Quantile:Income In The Past 12 Months Below Poverty Level', 'The number of people in a geographic area who are part of a family (which could be just them as an individual) determined to be "in poverty" following the Office of Management and Budget''s Directive 14. (https://www.census.gov/hhes/povmeas/methodology/ombdir14.html)', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (742, NULL, NULL, '"us.census.acs".B19013001_quantile', 'Numeric', 'Quantile:Median Household Income in the past 12 Months', 'Within a geographic area, the median income received by every household on a regular basis before payments for personal income taxes, social security, union dues, medicare deductions, etc. It includes income received from wages, salary, commissions, bonuses, and tips; self-employment income from own nonfarm or farm businesses, including proprietorships and partnerships; interest, dividends, net rental income, royalty income, or income from estates and trusts; Social Security or Railroad Retirement income; Supplemental Security Income (SSI); any cash public assistance or welfare payments from the state or local welfare office; retirement, survivor, or disability benefits; and any other sources of income received regularly such as Veterans'' (VA) payments, unemployment and/or worker''s compensation, child support, and alimony.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (743, NULL, NULL, '"us.census.acs".B19083001_quantile', 'Numeric', 'Quantile:Gini Index', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (744, NULL, NULL, '"us.census.acs".B19301001_quantile', 'Numeric', 'Quantile:Per Capita Income in the past 12 Months', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (745, NULL, NULL, '"us.census.acs".B25001001_quantile', 'Numeric', 'Quantile:Housing Units', 'A count of housing units in each geography. A housing unit is a house, an apartment, a mobile home or trailer, a group of rooms, or a single room occupied as separate living quarters, or if vacant, intended for occupancy as separate living quarters.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (746, NULL, NULL, '"us.census.acs".B25002003_quantile', 'Numeric', 'Quantile:Vacant Housing Units', 'The count of vacant housing units in a geographic area. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (747, NULL, NULL, '"us.census.acs".B25004002_quantile', 'Numeric', 'Quantile:Vacant Housing Units for Rent', 'The count of vacant housing units in a geographic area that are for rent. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (748, NULL, NULL, '"us.census.acs".B25004004_quantile', 'Numeric', 'Quantile:Vacant Housing Units for Sale', 'The count of vacant housing units in a geographic area that are for sale. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (749, NULL, NULL, '"us.census.acs".B25058001_quantile', 'Numeric', 'Quantile:Median Rent', 'The median contract rent within a geographic area. The contract rent is the monthly rent agreed to or contracted for, regardless of any furnishings, utilities, fees, meals, or services that may be included. For vacant units, it is the monthly rent asked for the rental unit at the time of interview.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (750, NULL, NULL, '"us.census.acs".B08134004_quantile', 'Numeric', 'Quantile:Number of workers with a commute between 15 and 19 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 15 and 19 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (751, NULL, NULL, '"us.census.acs".B25071001_quantile', 'Numeric', 'Quantile:Percent of Household Income Spent on Rent', 'Within a geographic area, the median percentage of household income which was spent on gross rent. Gross rent is the amount of the contract rent plus the estimated average monthly cost of utilities (electricity, gas, water, sewer etc.) and fuels (oil, coal, wood, etc.) if these are paid by the renter. Household income is the sum of the income of all people 15 years and older living in the household.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (753, NULL, NULL, '"us.census.acs".B25075025_quantile', 'Numeric', 'Quantile:Owner-occupied Housing Units valued at $1,000,000 or more.', 'The count of owner occupied housing units in a geographic area that are valued at $1,000,000 or more. Value is the respondent''s estimate of how much the property (house and lot, mobile home and lot, or condominium unit) would sell for if it were for sale.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (795, NULL, NULL, '"us.census.acs".B08134006_quantile', 'Numeric', 'Quantile:Number of workers with a commute between 25 and 29 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 25 and 29 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (754, NULL, NULL, '"us.census.acs".B25081002_quantile', 'Numeric', 'Quantile:Owner-occupied Housing Units with a Mortgage', 'The count of housing units within a geographic area that are mortagaged. "Mortgage" refers to all forms of debt where the property is pledged as security for repayment of the debt, including deeds of trust, trust deed, contracts to purchase, land contracts, junior mortgages, and home equity loans.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (755, NULL, NULL, '"us.census.acs".B23008002_quantile', 'Numeric', 'Quantile:Families with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (756, NULL, NULL, '"us.census.acs".B23008003_quantile', 'Numeric', 'Quantile:Two-parent families with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (757, NULL, NULL, '"us.census.acs".B23008004_quantile', 'Numeric', 'Quantile:Two-parent families, both parents in labor force with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (758, NULL, NULL, '"us.census.acs".B23008005_quantile', 'Numeric', 'Quantile:Two-parent families, father only in labor force with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (759, NULL, NULL, '"us.census.acs".B23008006_quantile', 'Numeric', 'Quantile:Two-parent families, mother only in labor force with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (760, NULL, NULL, '"us.census.acs".B23008007_quantile', 'Numeric', 'Quantile:Two-parent families, neither parent in labor force with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (761, NULL, NULL, '"us.census.acs".B23008008_quantile', 'Numeric', 'Quantile:One-parent families with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (762, NULL, NULL, '"us.census.acs".B23008009_quantile', 'Numeric', 'Quantile:One-parent families, father, with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (763, NULL, NULL, '"us.census.acs".B15001027_quantile', 'Numeric', 'Quantile:Men age 45 to 64 ("middle aged")', '0', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (764, NULL, NULL, '"us.census.acs".B01001015_quantile', 'Numeric', 'Quantile:Men age 45 to 49', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (765, NULL, NULL, '"us.census.acs".B01001016_quantile', 'Numeric', 'Quantile:Men age 50 to 54', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (766, NULL, NULL, '"us.census.acs".B01001017_quantile', 'Numeric', 'Quantile:Men age 55 to 59', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (767, NULL, NULL, '"us.census.acs".B01001018_quantile', 'Numeric', 'Quantile:Men age 60 to 61', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (768, NULL, NULL, '"us.census.acs".B01001019_quantile', 'Numeric', 'Quantile:Men age 62 to 64', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (769, NULL, NULL, '"us.census.acs".B01001B012_quantile', 'Numeric', 'Quantile:Black Men age 45 to 54', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (770, NULL, NULL, '"us.census.acs".B01001B013_quantile', 'Numeric', 'Quantile:Black Men age 55 to 64', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (771, NULL, NULL, '"us.census.acs".B01001I012_quantile', 'Numeric', 'Quantile:Hispanic Men age 45 to 54', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (772, NULL, NULL, '"us.census.acs".B01001I013_quantile', 'Numeric', 'Quantile:Hispanic Men age 55 to 64', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (773, NULL, NULL, '"us.census.acs".B01001H012_quantile', 'Numeric', 'Quantile:White Men age 45 to 54', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (774, NULL, NULL, '"us.census.acs".B01001H013_quantile', 'Numeric', 'Quantile:White Men age 55 to 64', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (775, NULL, NULL, '"us.census.acs".B01001D012_quantile', 'Numeric', 'Quantile:Asian Men age 45 to 54', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (776, NULL, NULL, '"us.census.acs".B01001D013_quantile', 'Numeric', 'Quantile:Asian Men age 55 to 64', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (777, NULL, NULL, '"us.census.acs".B15001028_quantile', 'Numeric', 'Quantile:Men age 45 to 64 who attained less than a 9th grade education', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (778, NULL, NULL, '"us.census.acs".B15001029_quantile', 'Numeric', 'Quantile:Men age 45 to 64 who attained between 9th and 12th grade, no diploma', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (779, NULL, NULL, '"us.census.acs".B15001030_quantile', 'Numeric', 'Quantile:Men age 45 to 64 who completed high school or obtained GED', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (780, NULL, NULL, '"us.census.acs".B15001031_quantile', 'Numeric', 'Quantile:Men age 45 to 64 who completed some college, no degree', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (781, NULL, NULL, '"us.census.acs".B15001032_quantile', 'Numeric', 'Quantile:Men age 45 to 64 who obtained an associate''s degree', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (782, NULL, NULL, '"us.census.acs".B15001033_quantile', 'Numeric', 'Quantile:Men age 45 to 64 who obtained a bachelor''s degree', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (783, NULL, NULL, '"us.census.acs".B15001034_quantile', 'Numeric', 'Quantile:Men age 45 to 64 who obtained a graduate or professional degree', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (784, NULL, NULL, '"us.census.acs".B23008010_quantile', 'Numeric', 'Quantile:One-parent families, father in labor force, with young children (under 6 years of age)', '', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (785, NULL, NULL, '"us.census.acs".B12005001_quantile', 'Numeric', 'Quantile:Population 15 Years and Over', 'The number of people in a geographic area who are over the age of 15. This is used mostly as a denominator of marital status.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (786, NULL, NULL, '"us.census.acs".B12005002_quantile', 'Numeric', 'Quantile:Never Married', 'The number of people in a geographic area who have never been married.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (787, NULL, NULL, '"us.census.acs".B12005005_quantile', 'Numeric', 'Quantile:Currently married', 'The number of people in a geographic area who are currently married', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (788, NULL, NULL, '"us.census.acs".B12005008_quantile', 'Numeric', 'Quantile:Married but separated', 'The number of people in a geographic area who are married but separated', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (789, NULL, NULL, '"us.census.acs".B12005012_quantile', 'Numeric', 'Quantile:Widowed', 'The number of people in a geographic area who are widowed', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (790, NULL, NULL, '"us.census.acs".B12005015_quantile', 'Numeric', 'Quantile:Divorced', 'The number of people in a geographic area who are divorced', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (791, NULL, NULL, '"us.census.acs".B08134001_quantile', 'Numeric', 'Quantile:Workers age 16 and over who do not work from home', 'The number of workers over the age of 16 who do not work from home in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (792, NULL, NULL, '"us.census.acs".B08134002_quantile', 'Numeric', 'Quantile:Number of workers with less than 10 minute commute', 'The number of workers over the age of 16 who do not work from home and commute in less than 10 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (793, NULL, NULL, '"us.census.acs".B08134003_quantile', 'Numeric', 'Quantile:Number of workers with a commute between 10 and 14 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 10 and 14 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (794, NULL, NULL, '"us.census.acs".B08134005_quantile', 'Numeric', 'Quantile:Number of workers with a commute between 20 and 24 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 20 and 24 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (796, NULL, NULL, '"us.census.acs".B08134007_quantile', 'Numeric', 'Quantile:Number of workers with a commute between 30 and 34 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 30 and 34 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (797, NULL, NULL, '"us.census.acs".B08134008_quantile', 'Numeric', 'Quantile:Number of workers with a commute between 35 and 44 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 35 and 44 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (798, NULL, NULL, '"us.census.acs".B08134009_quantile', 'Numeric', 'Quantile:Number of workers with a commute between 45 and 59 minutes', 'The number of workers over the age of 16 who do not work from home and commute in between 45 and 59 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (799, NULL, NULL, '"us.census.acs".B08134010_quantile', 'Numeric', 'Quantile:Number of workers with a commute of over 60 minutes', 'The number of workers over the age of 16 who do not work from home and commute in over 60 minutes in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (800, NULL, NULL, '"us.census.acs".B08135001_quantile', 'Numeric', 'Quantile:Aggregate travel time to work', 'The total number of minutes every worker over the age of 16 who did not work from home spent spent commuting to work in one day in a geographic area', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (801, NULL, NULL, '"us.census.acs".B19001002_quantile', 'Numeric', 'Quantile:Households with income less than $10,000', 'The number of households in a geographic area whose annual income was less than $10,000.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (802, NULL, NULL, '"us.census.acs".B19001003_quantile', 'Numeric', 'Quantile:Households with income of $10,000 to $14,999', 'The number of households in a geographic area whose annual income was between $10,000 and $14,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (803, NULL, NULL, '"us.census.acs".B19001004_quantile', 'Numeric', 'Quantile:Households with income of $15,000 to $19,999', 'The number of households in a geographic area whose annual income was between $15,000 and $19,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (804, NULL, NULL, '"us.census.acs".B19001005_quantile', 'Numeric', 'Quantile:Households with income of $20,000 To $24,999', 'The number of households in a geographic area whose annual income was between $20,000 and $24,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (805, NULL, NULL, '"us.census.acs".B19001006_quantile', 'Numeric', 'Quantile:Households with income of $25,000 To $29,999', 'The number of households in a geographic area whose annual income was between $20,000 and $24,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (806, NULL, NULL, '"us.census.acs".B19001007_quantile', 'Numeric', 'Quantile:Households with income of $30,000 To $34,999', 'The number of households in a geographic area whose annual income was between $30,000 and $34,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (807, NULL, NULL, '"us.census.acs".B19001008_quantile', 'Numeric', 'Quantile:Households with income of $35,000 To $39,999', 'The number of households in a geographic area whose annual income was between $35,000 and $39,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (808, NULL, NULL, '"us.census.acs".B19001009_quantile', 'Numeric', 'Quantile:Households with income of $40,000 To $44,999', 'The number of households in a geographic area whose annual income was between $40,000 and $44,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (809, NULL, NULL, '"us.census.acs".B19001010_quantile', 'Numeric', 'Quantile:Households with income of $45,000 To $49,999', 'The number of households in a geographic area whose annual income was between $45,000 and $49,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (810, NULL, NULL, '"us.census.acs".B19001011_quantile', 'Numeric', 'Quantile:Households with income of $50,000 To $59,999', 'The number of households in a geographic area whose annual income was between $50,000 and $59,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (811, NULL, NULL, '"us.census.acs".B19001012_quantile', 'Numeric', 'Quantile:Households with income of $60,000 To $74,999', 'The number of households in a geographic area whose annual income was between $60,000 and $74,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (812, NULL, NULL, '"us.census.acs".B19001013_quantile', 'Numeric', 'Quantile:Households with income of $75,000 To $99,999', 'The number of households in a geographic area whose annual income was between $75,000 and $99,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (813, NULL, NULL, '"us.census.acs".B19001014_quantile', 'Numeric', 'Quantile:Households with income of $100,000 To $124,999', 'The number of households in a geographic area whose annual income was between $100,000 and $124,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (814, NULL, NULL, '"us.census.acs".B19001015_quantile', 'Numeric', 'Quantile:Households with income of $125,000 To $149,999', 'The number of households in a geographic area whose annual income was between $125,000 and $149,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (815, NULL, NULL, '"us.census.acs".B19001016_quantile', 'Numeric', 'Quantile:Households with income of $150,000 To $199,999', 'The number of households in a geographic area whose annual income was between $150,000 and $1999,999.', 0, 'quantile', 3, NULL);
|
|
||||||
INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (816, NULL, NULL, '"us.census.acs".B19001017_quantile', 'Numeric', 'Quantile:Households with income of $200,000 Or More', 'The number of households in a geographic area whose annual income was more than $200,000.', 0, 'quantile', 3, NULL);
|
|
||||||
|
|
||||||
CREATE SCHEMA IF NOT EXISTS observatory;
|
|
||||||
ALTER TABLE obs_column SET SCHEMA observatory;
|
|
||||||
-1819
File diff suppressed because it is too large
Load Diff
-294
@@ -1,294 +0,0 @@
|
|||||||
|
|
||||||
CREATE TABLE obs_column_to_column(cartodb_id bigint, the_geom geometry, the_geom_webmercator geometry, source_id text, target_id text, reltype text);
|
|
||||||
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (1, NULL, NULL, '"es.ine".pop_100_more', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (2, NULL, NULL, '"es.ine".pop_0_4', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (3, NULL, NULL, '"es.ine".pop_5_9', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (4, NULL, NULL, '"es.ine".pop_10_14', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (5, NULL, NULL, '"es.ine".pop_15_19', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (6, NULL, NULL, '"es.ine".pop_20_24', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (7, NULL, NULL, '"es.ine".pop_25_29', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (8, NULL, NULL, '"es.ine".pop_30_34', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (9, NULL, NULL, '"es.ine".pop_35_39', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (10, NULL, NULL, '"es.ine".pop_40_44', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (11, NULL, NULL, '"es.ine".pop_45_49', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (12, NULL, NULL, '"es.ine".pop_50_54', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (13, NULL, NULL, '"es.ine".pop_55_59', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (14, NULL, NULL, '"es.ine".pop_60_64', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (15, NULL, NULL, '"es.ine".pop_65_69', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (16, NULL, NULL, '"es.ine".pop_70_74', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (17, NULL, NULL, '"es.ine".pop_75_79', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (18, NULL, NULL, '"es.ine".pop_80_84', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (19, NULL, NULL, '"es.ine".pop_85_89', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (20, NULL, NULL, '"es.ine".pop_90_94', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (21, NULL, NULL, '"es.ine".pop_95_99', '"es.ine".total_pop', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (22, NULL, NULL, '"us.census.lodes".jobs_firm_age_500_more_employees', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (23, NULL, NULL, '"us.census.lodes".jobs_age_29_or_younger', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (24, NULL, NULL, '"us.census.lodes".jobs_age_30_to_54', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (25, NULL, NULL, '"us.census.lodes".jobs_age_55_or_older', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (26, NULL, NULL, '"us.census.lodes".jobs_earning_15000_or_less', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (27, NULL, NULL, '"us.census.lodes".jobs_earning_15001_to_40000', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (28, NULL, NULL, '"us.census.lodes".jobs_earning_40001_or_more', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (29, NULL, NULL, '"us.census.lodes".jobs_11_agriculture_forestry_fishing', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (30, NULL, NULL, '"us.census.lodes".jobs_21_mining_quarrying_oil_gas', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (31, NULL, NULL, '"us.census.lodes".jobs_22_utilities', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (32, NULL, NULL, '"us.census.lodes".jobs_23_construction', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (33, NULL, NULL, '"us.census.lodes".jobs_31_33_manufacturing', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (34, NULL, NULL, '"us.census.lodes".jobs_42_wholesale_trade', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (35, NULL, NULL, '"us.census.lodes".jobs_44_45_retail_trade', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (36, NULL, NULL, '"us.census.lodes".jobs_48_49_transport_warehousing', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (37, NULL, NULL, '"us.census.lodes".jobs_51_information', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (38, NULL, NULL, '"us.census.lodes".jobs_52_finance_and_insurance', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (39, NULL, NULL, '"us.census.lodes".jobs_53_real_estate_rental_leasing', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (40, NULL, NULL, '"us.census.lodes".jobs_54_professional_scientific_tech_services', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (41, NULL, NULL, '"us.census.lodes".jobs_55_management_of_companies_enterprises', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (42, NULL, NULL, '"us.census.lodes".jobs_56_admin_support_waste_management', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (43, NULL, NULL, '"us.census.lodes".jobs_61_educational_services', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (44, NULL, NULL, '"us.census.lodes".jobs_62_healthcare_social_assistance', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (45, NULL, NULL, '"us.census.lodes".jobs_71_arts_entertainment_recreation', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (46, NULL, NULL, '"us.census.lodes".jobs_72_accommodation_and_food', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (47, NULL, NULL, '"us.census.lodes".jobs_81_other_services_except_public_admin', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (48, NULL, NULL, '"us.census.lodes".jobs_92_public_administration', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (49, NULL, NULL, '"us.census.lodes".jobs_white', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (50, NULL, NULL, '"us.census.lodes".jobs_black', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (51, NULL, NULL, '"us.census.lodes".jobs_asian', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (52, NULL, NULL, '"us.census.lodes".jobs_hispanic', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (53, NULL, NULL, '"us.census.lodes".jobs_less_than_high_school', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (54, NULL, NULL, '"us.census.lodes".jobs_high_school', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (55, NULL, NULL, '"us.census.lodes".jobs_some_college', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (56, NULL, NULL, '"us.census.lodes".jobs_bachelors_or_advanced', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (57, NULL, NULL, '"us.census.lodes".jobs_male', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (58, NULL, NULL, '"us.census.lodes".jobs_female', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (59, NULL, NULL, '"us.census.lodes".jobs_firm_age_0_1_years', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (60, NULL, NULL, '"us.census.lodes".jobs_firm_age_2_3_years', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (61, NULL, NULL, '"us.census.lodes".jobs_firm_age_4_5_years', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (62, NULL, NULL, '"us.census.lodes".jobs_firm_age_6_10_years', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (63, NULL, NULL, '"us.census.lodes".jobs_firm_age_11_more_years', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (64, NULL, NULL, '"us.census.lodes".jobs_firm_age_0_19_employees', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (65, NULL, NULL, '"us.census.lodes".jobs_firm_age_20_49_employees', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (66, NULL, NULL, '"us.census.lodes".jobs_firm_age_50_249_employees', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (67, NULL, NULL, '"us.census.lodes".jobs_firm_age_250_499_employees', '"us.census.lodes".total_jobs', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (68, NULL, NULL, '"us.census.tiger".census_tract_geoid', '"us.census.tiger".census_tract', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (69, NULL, NULL, '"us.census.tiger".county_geoid', '"us.census.tiger".county', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (70, NULL, NULL, '"us.census.tiger".congressional_district_geoid', '"us.census.tiger".congressional_district', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (71, NULL, NULL, '"us.census.tiger".block_geoid', '"us.census.tiger".block', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (72, NULL, NULL, '"us.census.tiger".zcta5_geoid', '"us.census.tiger".zcta5', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (73, NULL, NULL, '"us.census.tiger".puma_geoid', '"us.census.tiger".puma', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (74, NULL, NULL, '"us.census.tiger".state_geoid', '"us.census.tiger".state', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (75, NULL, NULL, '"us.census.tiger".block_group_geoid', '"us.census.tiger".block_group', 'geom_ref');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (76, NULL, NULL, '"us.census.acs".B01001002', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (77, NULL, NULL, '"us.census.acs".B01001026', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (78, NULL, NULL, '"us.census.acs".B03002003', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (79, NULL, NULL, '"us.census.acs".B03002004', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (80, NULL, NULL, '"us.census.acs".B03002006', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (81, NULL, NULL, '"us.census.acs".B03002012', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (82, NULL, NULL, '"us.census.acs".B15001034', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (83, NULL, NULL, '"us.census.acs".B08006017', '"us.census.acs".B08006001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (84, NULL, NULL, '"us.census.acs".B08006015', '"us.census.acs".B08006008', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (85, NULL, NULL, '"us.census.acs".B03002005', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (86, NULL, NULL, '"us.census.acs".B14001002', '"us.census.acs".B14001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (87, NULL, NULL, '"us.census.acs".B14001008', '"us.census.acs".B14001002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (88, NULL, NULL, '"us.census.acs".B15003023', '"us.census.acs".B15003001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (89, NULL, NULL, '"us.census.acs".B16001003', '"us.census.acs".B16001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (90, NULL, NULL, '"us.census.acs".B17001002', '"us.census.acs".B17001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (91, NULL, NULL, '"us.census.acs".B25075001', '"us.census.acs".B25001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (92, NULL, NULL, '"us.census.acs".B25081002', '"us.census.acs".B25075001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (93, NULL, NULL, '"us.census.acs".B25004004', '"us.census.acs".B25002003', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (94, NULL, NULL, '"us.census.acs".B03002008', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (95, NULL, NULL, '"us.census.acs".B03002009', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (96, NULL, NULL, '"us.census.acs".B03002002', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (97, NULL, NULL, '"us.census.acs".B05001006', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (98, NULL, NULL, '"us.census.acs".B08006004', '"us.census.acs".B08006002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (99, NULL, NULL, '"us.census.acs".B08006003', '"us.census.acs".B08006002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (100, NULL, NULL, '"us.census.acs".B08006009', '"us.census.acs".B08006008', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (101, NULL, NULL, '"us.census.acs".B08006011', '"us.census.acs".B08006008', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (102, NULL, NULL, '"us.census.acs".B19001017', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (103, NULL, NULL, '"us.census.acs".B14001005', '"us.census.acs".B14001002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (104, NULL, NULL, '"us.census.acs".B14001006', '"us.census.acs".B14001002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (105, NULL, NULL, '"us.census.acs".B14001007', '"us.census.acs".B14001002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (106, NULL, NULL, '"us.census.acs".B15003017', '"us.census.acs".B15003001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (107, NULL, NULL, '"us.census.acs".B15003019', '"us.census.acs".B15003001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (108, NULL, NULL, '"us.census.acs".B15003020', '"us.census.acs".B15003001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (109, NULL, NULL, '"us.census.acs".B15003021', '"us.census.acs".B15003001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (110, NULL, NULL, '"us.census.acs".B15003022', '"us.census.acs".B15003001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (111, NULL, NULL, '"us.census.acs".B16001002', '"us.census.acs".B16001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (112, NULL, NULL, '"us.census.acs".B25004002', '"us.census.acs".B25002003', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (113, NULL, NULL, '"us.census.acs".B25075025', '"us.census.acs".B25075001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (114, NULL, NULL, '"us.census.acs".B23008010', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (115, NULL, NULL, '"us.census.acs".B23008003', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (116, NULL, NULL, '"us.census.acs".B23008004', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (117, NULL, NULL, '"us.census.acs".B23008005', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (118, NULL, NULL, '"us.census.acs".B23008006', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (119, NULL, NULL, '"us.census.acs".B23008007', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (120, NULL, NULL, '"us.census.acs".B23008008', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (121, NULL, NULL, '"us.census.acs".B23008009', '"us.census.acs".B23008002', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (122, NULL, NULL, '"us.census.acs".B01001015', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (123, NULL, NULL, '"us.census.acs".B01001016', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (124, NULL, NULL, '"us.census.acs".B01001017', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (125, NULL, NULL, '"us.census.acs".B01001018', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (126, NULL, NULL, '"us.census.acs".B01001019', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (127, NULL, NULL, '"us.census.acs".B01001B012', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (128, NULL, NULL, '"us.census.acs".B01001B013', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (129, NULL, NULL, '"us.census.acs".B01001I012', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (130, NULL, NULL, '"us.census.acs".B01001I013', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (131, NULL, NULL, '"us.census.acs".B01001H012', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (132, NULL, NULL, '"us.census.acs".B01001H013', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (133, NULL, NULL, '"us.census.acs".B01001D012', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (134, NULL, NULL, '"us.census.acs".B01001D013', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (135, NULL, NULL, '"us.census.acs".B15001028', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (136, NULL, NULL, '"us.census.acs".B15001029', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (137, NULL, NULL, '"us.census.acs".B15001030', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (138, NULL, NULL, '"us.census.acs".B15001031', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (139, NULL, NULL, '"us.census.acs".B15001032', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (140, NULL, NULL, '"us.census.acs".B15001033', '"us.census.acs".B01001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (141, NULL, NULL, '"us.census.acs".B12005015', '"us.census.acs".B12005001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (142, NULL, NULL, '"us.census.acs".B12005002', '"us.census.acs".B12005001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (143, NULL, NULL, '"us.census.acs".B12005005', '"us.census.acs".B12005001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (144, NULL, NULL, '"us.census.acs".B12005008', '"us.census.acs".B12005001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (145, NULL, NULL, '"us.census.acs".B12005012', '"us.census.acs".B12005001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (146, NULL, NULL, '"us.census.acs".B08135001', '"us.census.acs".B08134001', 'divisor');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (147, NULL, NULL, '"us.census.acs".B08134002', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (148, NULL, NULL, '"us.census.acs".B08134003', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (149, NULL, NULL, '"us.census.acs".B08134004', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (150, NULL, NULL, '"us.census.acs".B08134005', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (151, NULL, NULL, '"us.census.acs".B08134006', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (152, NULL, NULL, '"us.census.acs".B08134007', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (153, NULL, NULL, '"us.census.acs".B08134008', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (154, NULL, NULL, '"us.census.acs".B08134009', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (155, NULL, NULL, '"us.census.acs".B08134010', '"us.census.acs".B08134001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (156, NULL, NULL, '"us.census.acs".B19001002', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (157, NULL, NULL, '"us.census.acs".B19001003', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (158, NULL, NULL, '"us.census.acs".B19001004', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (159, NULL, NULL, '"us.census.acs".B19001005', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (160, NULL, NULL, '"us.census.acs".B19001006', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (161, NULL, NULL, '"us.census.acs".B19001007', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (162, NULL, NULL, '"us.census.acs".B19001008', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (163, NULL, NULL, '"us.census.acs".B19001009', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (164, NULL, NULL, '"us.census.acs".B19001010', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (165, NULL, NULL, '"us.census.acs".B19001011', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (166, NULL, NULL, '"us.census.acs".B19001012', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (167, NULL, NULL, '"us.census.acs".B19001013', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (168, NULL, NULL, '"us.census.acs".B19001014', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (169, NULL, NULL, '"us.census.acs".B19001015', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (170, NULL, NULL, '"us.census.acs".B19001016', '"us.census.acs".B11001001', 'denominator');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (171, NULL, NULL, '"us.census.acs".B01001001_quantile', '"us.census.acs".B01001001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (172, NULL, NULL, '"us.census.acs".B01001002_quantile', '"us.census.acs".B01001002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (173, NULL, NULL, '"us.census.acs".B01001026_quantile', '"us.census.acs".B01001026', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (174, NULL, NULL, '"us.census.acs".B01002001_quantile', '"us.census.acs".B01002001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (175, NULL, NULL, '"us.census.acs".B03002003_quantile', '"us.census.acs".B03002003', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (176, NULL, NULL, '"us.census.acs".B03002004_quantile', '"us.census.acs".B03002004', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (177, NULL, NULL, '"us.census.acs".B03002006_quantile', '"us.census.acs".B03002006', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (178, NULL, NULL, '"us.census.acs".B03002012_quantile', '"us.census.acs".B03002012', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (179, NULL, NULL, '"us.census.acs".B03002005_quantile', '"us.census.acs".B03002005', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (180, NULL, NULL, '"us.census.acs".B03002008_quantile', '"us.census.acs".B03002008', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (181, NULL, NULL, '"us.census.acs".B03002009_quantile', '"us.census.acs".B03002009', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (182, NULL, NULL, '"us.census.acs".B03002002_quantile', '"us.census.acs".B03002002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (183, NULL, NULL, '"us.census.acs".B05001006_quantile', '"us.census.acs".B05001006', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (184, NULL, NULL, '"us.census.acs".B08006001_quantile', '"us.census.acs".B08006001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (185, NULL, NULL, '"us.census.acs".B08006002_quantile', '"us.census.acs".B08006002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (186, NULL, NULL, '"us.census.acs".B08006003_quantile', '"us.census.acs".B08006003', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (187, NULL, NULL, '"us.census.acs".B08006004_quantile', '"us.census.acs".B08006004', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (188, NULL, NULL, '"us.census.acs".B08006008_quantile', '"us.census.acs".B08006008', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (189, NULL, NULL, '"us.census.acs".B08006009_quantile', '"us.census.acs".B08006009', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (190, NULL, NULL, '"us.census.acs".B08006011_quantile', '"us.census.acs".B08006011', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (191, NULL, NULL, '"us.census.acs".B08006015_quantile', '"us.census.acs".B08006015', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (192, NULL, NULL, '"us.census.acs".B08006017_quantile', '"us.census.acs".B08006017', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (193, NULL, NULL, '"us.census.acs".B09001001_quantile', '"us.census.acs".B09001001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (194, NULL, NULL, '"us.census.acs".B11001001_quantile', '"us.census.acs".B11001001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (195, NULL, NULL, '"us.census.acs".B14001001_quantile', '"us.census.acs".B14001001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (196, NULL, NULL, '"us.census.acs".B14001002_quantile', '"us.census.acs".B14001002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (197, NULL, NULL, '"us.census.acs".B14001005_quantile', '"us.census.acs".B14001005', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (198, NULL, NULL, '"us.census.acs".B14001006_quantile', '"us.census.acs".B14001006', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (199, NULL, NULL, '"us.census.acs".B14001007_quantile', '"us.census.acs".B14001007', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (200, NULL, NULL, '"us.census.acs".B14001008_quantile', '"us.census.acs".B14001008', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (201, NULL, NULL, '"us.census.acs".B15003001_quantile', '"us.census.acs".B15003001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (202, NULL, NULL, '"us.census.acs".B15003017_quantile', '"us.census.acs".B15003017', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (203, NULL, NULL, '"us.census.acs".B15003019_quantile', '"us.census.acs".B15003019', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (204, NULL, NULL, '"us.census.acs".B15003020_quantile', '"us.census.acs".B15003020', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (205, NULL, NULL, '"us.census.acs".B15003021_quantile', '"us.census.acs".B15003021', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (206, NULL, NULL, '"us.census.acs".B15003022_quantile', '"us.census.acs".B15003022', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (207, NULL, NULL, '"us.census.acs".B15003023_quantile', '"us.census.acs".B15003023', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (208, NULL, NULL, '"us.census.acs".B16001001_quantile', '"us.census.acs".B16001001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (209, NULL, NULL, '"us.census.acs".B16001002_quantile', '"us.census.acs".B16001002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (210, NULL, NULL, '"us.census.acs".B16001003_quantile', '"us.census.acs".B16001003', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (211, NULL, NULL, '"us.census.acs".B17001001_quantile', '"us.census.acs".B17001001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (212, NULL, NULL, '"us.census.acs".B17001002_quantile', '"us.census.acs".B17001002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (213, NULL, NULL, '"us.census.acs".B19013001_quantile', '"us.census.acs".B19013001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (214, NULL, NULL, '"us.census.acs".B19083001_quantile', '"us.census.acs".B19083001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (215, NULL, NULL, '"us.census.acs".B19301001_quantile', '"us.census.acs".B19301001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (216, NULL, NULL, '"us.census.acs".B25001001_quantile', '"us.census.acs".B25001001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (217, NULL, NULL, '"us.census.acs".B25002003_quantile', '"us.census.acs".B25002003', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (218, NULL, NULL, '"us.census.acs".B25004002_quantile', '"us.census.acs".B25004002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (219, NULL, NULL, '"us.census.acs".B25004004_quantile', '"us.census.acs".B25004004', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (220, NULL, NULL, '"us.census.acs".B25058001_quantile', '"us.census.acs".B25058001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (221, NULL, NULL, '"us.census.acs".B25071001_quantile', '"us.census.acs".B25071001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (222, NULL, NULL, '"us.census.acs".B25075001_quantile', '"us.census.acs".B25075001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (223, NULL, NULL, '"us.census.acs".B25075025_quantile', '"us.census.acs".B25075025', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (224, NULL, NULL, '"us.census.acs".B25081002_quantile', '"us.census.acs".B25081002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (225, NULL, NULL, '"us.census.acs".B23008002_quantile', '"us.census.acs".B23008002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (226, NULL, NULL, '"us.census.acs".B23008003_quantile', '"us.census.acs".B23008003', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (227, NULL, NULL, '"us.census.acs".B23008004_quantile', '"us.census.acs".B23008004', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (228, NULL, NULL, '"us.census.acs".B23008005_quantile', '"us.census.acs".B23008005', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (229, NULL, NULL, '"us.census.acs".B23008006_quantile', '"us.census.acs".B23008006', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (230, NULL, NULL, '"us.census.acs".B23008007_quantile', '"us.census.acs".B23008007', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (231, NULL, NULL, '"us.census.acs".B23008008_quantile', '"us.census.acs".B23008008', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (232, NULL, NULL, '"us.census.acs".B23008009_quantile', '"us.census.acs".B23008009', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (233, NULL, NULL, '"us.census.acs".B15001027_quantile', '"us.census.acs".B15001027', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (234, NULL, NULL, '"us.census.acs".B01001015_quantile', '"us.census.acs".B01001015', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (235, NULL, NULL, '"us.census.acs".B01001016_quantile', '"us.census.acs".B01001016', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (236, NULL, NULL, '"us.census.acs".B01001017_quantile', '"us.census.acs".B01001017', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (237, NULL, NULL, '"us.census.acs".B01001018_quantile', '"us.census.acs".B01001018', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (238, NULL, NULL, '"us.census.acs".B01001019_quantile', '"us.census.acs".B01001019', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (239, NULL, NULL, '"us.census.acs".B01001B012_quantile', '"us.census.acs".B01001B012', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (240, NULL, NULL, '"us.census.acs".B01001B013_quantile', '"us.census.acs".B01001B013', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (241, NULL, NULL, '"us.census.acs".B01001I012_quantile', '"us.census.acs".B01001I012', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (242, NULL, NULL, '"us.census.acs".B01001I013_quantile', '"us.census.acs".B01001I013', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (243, NULL, NULL, '"us.census.acs".B01001H012_quantile', '"us.census.acs".B01001H012', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (244, NULL, NULL, '"us.census.acs".B01001H013_quantile', '"us.census.acs".B01001H013', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (245, NULL, NULL, '"us.census.acs".B01001D012_quantile', '"us.census.acs".B01001D012', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (246, NULL, NULL, '"us.census.acs".B01001D013_quantile', '"us.census.acs".B01001D013', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (247, NULL, NULL, '"us.census.acs".B15001028_quantile', '"us.census.acs".B15001028', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (248, NULL, NULL, '"us.census.acs".B15001029_quantile', '"us.census.acs".B15001029', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (249, NULL, NULL, '"us.census.acs".B15001030_quantile', '"us.census.acs".B15001030', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (250, NULL, NULL, '"us.census.acs".B15001031_quantile', '"us.census.acs".B15001031', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (251, NULL, NULL, '"us.census.acs".B15001032_quantile', '"us.census.acs".B15001032', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (252, NULL, NULL, '"us.census.acs".B15001033_quantile', '"us.census.acs".B15001033', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (253, NULL, NULL, '"us.census.acs".B15001034_quantile', '"us.census.acs".B15001034', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (254, NULL, NULL, '"us.census.acs".B23008010_quantile', '"us.census.acs".B23008010', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (255, NULL, NULL, '"us.census.acs".B12005001_quantile', '"us.census.acs".B12005001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (256, NULL, NULL, '"us.census.acs".B12005002_quantile', '"us.census.acs".B12005002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (257, NULL, NULL, '"us.census.acs".B12005005_quantile', '"us.census.acs".B12005005', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (258, NULL, NULL, '"us.census.acs".B12005008_quantile', '"us.census.acs".B12005008', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (259, NULL, NULL, '"us.census.acs".B12005012_quantile', '"us.census.acs".B12005012', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (260, NULL, NULL, '"us.census.acs".B12005015_quantile', '"us.census.acs".B12005015', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (261, NULL, NULL, '"us.census.acs".B08134001_quantile', '"us.census.acs".B08134001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (262, NULL, NULL, '"us.census.acs".B08134002_quantile', '"us.census.acs".B08134002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (263, NULL, NULL, '"us.census.acs".B08134003_quantile', '"us.census.acs".B08134003', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (264, NULL, NULL, '"us.census.acs".B08134004_quantile', '"us.census.acs".B08134004', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (265, NULL, NULL, '"us.census.acs".B08134005_quantile', '"us.census.acs".B08134005', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (266, NULL, NULL, '"us.census.acs".B08134006_quantile', '"us.census.acs".B08134006', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (267, NULL, NULL, '"us.census.acs".B08134007_quantile', '"us.census.acs".B08134007', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (268, NULL, NULL, '"us.census.acs".B08134008_quantile', '"us.census.acs".B08134008', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (269, NULL, NULL, '"us.census.acs".B08134009_quantile', '"us.census.acs".B08134009', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (270, NULL, NULL, '"us.census.acs".B08134010_quantile', '"us.census.acs".B08134010', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (271, NULL, NULL, '"us.census.acs".B08135001_quantile', '"us.census.acs".B08135001', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (272, NULL, NULL, '"us.census.acs".B19001002_quantile', '"us.census.acs".B19001002', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (273, NULL, NULL, '"us.census.acs".B19001003_quantile', '"us.census.acs".B19001003', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (274, NULL, NULL, '"us.census.acs".B19001004_quantile', '"us.census.acs".B19001004', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (275, NULL, NULL, '"us.census.acs".B19001005_quantile', '"us.census.acs".B19001005', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (276, NULL, NULL, '"us.census.acs".B19001006_quantile', '"us.census.acs".B19001006', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (277, NULL, NULL, '"us.census.acs".B19001007_quantile', '"us.census.acs".B19001007', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (278, NULL, NULL, '"us.census.acs".B19001008_quantile', '"us.census.acs".B19001008', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (279, NULL, NULL, '"us.census.acs".B19001009_quantile', '"us.census.acs".B19001009', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (280, NULL, NULL, '"us.census.acs".B19001010_quantile', '"us.census.acs".B19001010', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (281, NULL, NULL, '"us.census.acs".B19001011_quantile', '"us.census.acs".B19001011', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (282, NULL, NULL, '"us.census.acs".B19001012_quantile', '"us.census.acs".B19001012', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (283, NULL, NULL, '"us.census.acs".B19001013_quantile', '"us.census.acs".B19001013', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (284, NULL, NULL, '"us.census.acs".B19001014_quantile', '"us.census.acs".B19001014', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (285, NULL, NULL, '"us.census.acs".B19001015_quantile', '"us.census.acs".B19001015', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (286, NULL, NULL, '"us.census.acs".B19001016_quantile', '"us.census.acs".B19001016', 'quantile_source');
|
|
||||||
INSERT INTO obs_column_to_column (cartodb_id, the_geom, the_geom_webmercator, source_id, target_id, reltype) VALUES (287, NULL, NULL, '"us.census.acs".B19001017_quantile', '"us.census.acs".B19001017', 'quantile_source');
|
|
||||||
|
|
||||||
|
|
||||||
CREATE SCHEMA IF NOT EXISTS observatory;
|
|
||||||
ALTER TABLE obs_column_to_column SET SCHEMA observatory;
|
|
||||||
Vendored
-37
@@ -1,37 +0,0 @@
|
|||||||
CREATE TABLE obs_table(cartodb_id bigint, the_geom geometry, the_geom_webmercator geometry, id text, tablename text, timespan text, bounds text, description text, version text);
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (1, NULL, NULL, '"us.census.spielman_singleton_segments".spielman_singleton_table_99914b932b', 'obs_65f29658e096ca1485bf683f65fdbc9f05ec3c5d', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 5);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (2, NULL, NULL, '"us.census.acs".extract_block_group_5yr_2013_69b156927c', 'obs_3e7cc9cfd403b912c57b42d5f9195af9ce2f3cdb', '2009 - 2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (3, NULL, NULL, '"us.census.tiger".sum_level_false_block_group_2013_5c764f39d2', 'obs_85328201013baa14e8e8a4a57a01e6f6fbc5f9b1', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (4, NULL, NULL, '"us.census.tiger".sum_level_false_census_tract_2013_c489085a44', 'obs_a92e1111ad3177676471d66bb8036e6d057f271b', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (5, NULL, NULL, '"us.ny.nyc.opendata".acris_master_99914b932b', 'obs_811c938d1307530a3db53fc69f11a2499174d224', '1966 - present', 'BOX(0 0,0 0)', NULL, 0);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (6, NULL, NULL, '"us.census.tiger".sum_level_false_county_2013_66804ade17', 'obs_b0ef6dd68d5faddbf231fd7f02916b3d00ec43c4', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (7, NULL, NULL, '"us.census.tiger".sum_level_false_puma_2013_4a11a4ba96', 'obs_0008b162b516c295d7204c9ba043ab5dbc67c59c', '2013', 'BOX(-179.231086 13.182335,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (8, NULL, NULL, '"us.census.tiger".sum_level_true_state_2013_f1ab8fce27', 'obs_a20f5260b618a2fe2eb95fc1e23febe0db7db096', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (9, NULL, NULL, '"us.census.tiger".sum_level_true_county_2013_39133ea7a1', 'obs_23da37d4e66e9de2f525572967f8618bde99a8c0', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (10, NULL, NULL, '"us.census.tiger".sum_level_false_zcta5_2013_bf420fa8c1', 'obs_d483723c5cc76c107d9e0af279d1e7056df3c2be', '2013', 'BOX(-176.684744 -14.373765,145.830505 71.341324)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (11, NULL, NULL, '"us.census.tiger".sum_level_true_census_tract_2013_6a2cf9dee9', 'obs_d125aeef87aaa23287a40b454519ece22ee25acf', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (12, NULL, NULL, '"us.census.tiger".sum_level_true_block_group_2013_5ecb940395', 'obs_d610cb3225f282693b8d4dcd98d2c2e2078354c6', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (13, NULL, NULL, '"us.census.acs".extract_state_5yr_2013_c6cc7dd346', 'obs_92bdae84ae8d41fabca52500e4e1f55c394b696e', '2009 - 2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (14, NULL, NULL, '"us.census.acs".extract_puma_5yr_2013_e9f0d7bc6c', 'obs_a875390344c7e36b72a8d6a3d25ae0f2bb41eaee', '2009 - 2013', 'BOX(-179.231086 13.182335,179.859681 71.441059)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (15, NULL, NULL, '"us.census.acs".extract_county_5yr_2013_5d7844896c', 'obs_75edf4ed5271a95f13755e9d06b80740b2fde0ba', '2009 - 2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (16, NULL, NULL, '"us.census.acs".extract_zcta5_5yr_2013_dc39ebe0d5', 'obs_e99034a8fff4654142aed05d887f745a32cedc9f', '2009 - 2013', 'BOX(-176.684744 -14.373765,145.830505 71.341324)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (17, NULL, NULL, '"us.census.acs".extract_census_tract_5yr_2013_a0eee6bf1a', 'obs_ab038198aaab3f3cb055758638ee4de28ad70146', '2009 - 2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (18, NULL, NULL, '"us.bls".raw_qcew_2013_dd20d99063', 'obs_530081a407e8793b7fef6666ebc46db0fcc9db2c', '2013', 'BOX(0 0,0 0)', NULL, 0);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (19, NULL, NULL, '"us.bls".naics_99914b932b', 'obs_609c848c80950261032da680294bb1e3ddcf43b6', NULL, 'BOX(0 0,0 0)', NULL, 0);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (20, NULL, NULL, '"us.bls".simple_qcew_4_2013_94c2fc9ef1', 'obs_4560238b6b0050979ad151becc37c6eecfb7e6ad', '2013Q4', 'BOX(0 0,0 0)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (21, NULL, NULL, '"us.census.lodes".workplace_area_characteristics_2013_dd20d99063', 'obs_5bc83d67ea2863b1712078813a730eee753cf316', '2013', 'BOX(0 0,0 0)', NULL, 0);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (22, NULL, NULL, '"us.bls".qcew_4_2013_94c2fc9ef1', 'obs_5ed30fab78289e09c30cfd16981b8143ca8fdaa4', '2013Q4', 'BOX(0 0,0 0)', NULL, 1);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (23, NULL, NULL, '"us.ny.nyc.opendata".acris_legals_99914b932b', 'obs_fd0a697088f5ffcbe4641fb62ad6e2c74eed55d5', '', 'BOX(0 0,0 0)', NULL, 0);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (24, NULL, NULL, '"us.census.spielman_singleton_segments".create_spielman_singleton_table_99914b932b', 'obs_11ee8b82c877c073438bc935a91d3dfccef875d1', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 3);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (25, NULL, NULL, '"us.census.acs".quantiles_block_group_5yr_2013_69b156927c', 'obs_0932dc0392ca14a6b43e6e131943de9af2ee46b2', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 5);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (26, NULL, NULL, '"us.census.acs".quantiles_puma_5yr_2013_e9f0d7bc6c', 'obs_032792417d754aa7708d6ba716eb446904f12c46', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 5);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (27, NULL, NULL, '"us.census.acs".quantiles_census_tract_5yr_2013_a0eee6bf1a', 'obs_d34555209878e8c4b37cf0b2b3d072ff129ec470', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 5);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (28, NULL, NULL, '"us.census.tiger".sum_level_false_state_2013_0b919d8984', 'obs_f3f0912fe24bc0c976e837b5a116d0c803cc01ce', '2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, 4);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (29, NULL, NULL, '"us.census.acs".quantiles_zcta5_5yr_2013_dc39ebe0d5', 'obs_a31255ed256a27d69a9ea777621ad218f6f1f030', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 5);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (30, NULL, NULL, '"us.census.acs".quantiles_state_5yr_2013_c6cc7dd346', 'obs_90e9293f578fab0bf2dabf5e387a57d9a2739a08', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 5);
|
|
||||||
INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (31, NULL, NULL, '"us.census.acs".quantiles_county_5yr_2013_5d7844896c', 'obs_98cefd377c2ff17a2d60b9a6fe090af629073ec4', '2009 - 2013', 'BOX(0 0,0 0)', NULL, 5);
|
|
||||||
|
|
||||||
CREATE SCHEMA IF NOT EXISTS observatory;
|
|
||||||
ALTER TABLE obs_table SET SCHEMA observatory;
|
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
-- Install dependencies
|
|
||||||
CREATE EXTENSION postgis;
|
|
||||||
CREATE EXTENSION plpythonu;
|
|
||||||
CREATE EXTENSION cartodb;
|
|
||||||
|
|
||||||
-- Install the extension
|
-- Install the extension
|
||||||
CREATE EXTENSION observatory VERSION 'dev';
|
\set ECHO none
|
||||||
|
\set QUIET on
|
||||||
|
SET client_min_messages TO ERROR;
|
||||||
|
|
||||||
|
-- For Postgis 3+ install postgis_raster. Otherwise observatory will fail to install
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
IF EXISTS (SELECT 1 FROM pg_available_extensions WHERE name = 'postgis_raster') THEN
|
||||||
|
CREATE EXTENSION postgis_raster WITH SCHEMA public CASCADE;
|
||||||
|
END IF;
|
||||||
|
END$$;
|
||||||
|
|
||||||
|
CREATE EXTENSION observatory VERSION 'dev' CASCADE;
|
||||||
|
|
||||||
|
\i test/fixtures/load_fixtures.sql
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
SET client_min_messages TO WARNING;
|
|
||||||
\set ECHO none
|
|
||||||
\echo Loading fixtures...
|
|
||||||
\i test/fixtures/obs_table.sql
|
|
||||||
\i test/fixtures/obs_column_table.sql
|
|
||||||
\i test/fixtures/obs_column.sql
|
|
||||||
\i test/fixtures/obs_column_to_column.sql
|
|
||||||
\echo Done.
|
|
||||||
\unset ECHO
|
|
||||||
@@ -1,50 +1,54 @@
|
|||||||
SELECT set_config(
|
\pset format unaligned
|
||||||
'search_path',
|
\set ECHO all
|
||||||
current_setting('search_path') || ',cdb_observatory',
|
SET client_min_messages TO WARNING;
|
||||||
false
|
\set ECHO none
|
||||||
) WHERE current_setting('search_path') !~ '(^|,)cdb_observatory(,|$)';
|
|
||||||
|
|
||||||
-- OBS_GeomTable
|
-- OBS_GeomTable
|
||||||
-- get table with known geometry_id
|
-- get table with known geometry_id
|
||||||
-- should give back a table like obs_{hex hash}
|
-- should give back a table like obs_{hex hash}
|
||||||
SELECT
|
SELECT
|
||||||
cdb_observatory.OBS_GeomTable(
|
cdb_observatory._OBS_GeomTable(
|
||||||
CDB_LatLng(40.7128,-74.0059),
|
ST_SetSRID(ST_Point(-74.0059, 40.7128), 4326),
|
||||||
'"us.census.tiger".census_tract'
|
'us.census.tiger.census_tract',
|
||||||
);
|
'2015'
|
||||||
|
) = 'obs_87a814e485deabe3b12545a537f693d16ca702c2' As _obs_geomtable_with_returned_table;
|
||||||
|
|
||||||
-- get null for unknown geometry_id
|
-- get null for unknown geometry_id
|
||||||
-- should give back null
|
-- should give back null
|
||||||
SELECT
|
SELECT
|
||||||
cdb_observatory.OBS_GeomTable(
|
cdb_observatory._OBS_GeomTable(
|
||||||
CDB_LatLng(40.7128,-74.0059),
|
ST_SetSRID(ST_Point(-74.0059, 40.7128), 4326),
|
||||||
'"us.census.tiger".nonexistant_id'
|
'us.census.tiger.nonexistant_id' -- not in catalog
|
||||||
);
|
) IS NULL _obs_geomtable_with_null_response;
|
||||||
|
|
||||||
-- OBS_GetColumnData
|
-- future test: give back nulls when geometry doesn't intersect
|
||||||
-- should give back:
|
-- SELECT
|
||||||
-- colname | tablename | aggregate
|
-- cdb_observatory._OBS_GeomTable(
|
||||||
-- -----------|-----------------|-----------
|
-- ST_SetSRID(ST_Point(0,0)), -- should give back null since it's in the ocean?
|
||||||
-- geoid | obs_{hex table} | null
|
-- 'us.census.tiger.census_tract'
|
||||||
-- total_pop | obs_{hex table} | sum
|
-- );
|
||||||
SELECT
|
|
||||||
(unnest(cdb_observatory.OBS_GetColumnData(
|
|
||||||
'"us.census.tiger".census_tract',
|
|
||||||
Array['"us.census.tiger".census_tract_geoid', '"us.census.acs".B01001001'],
|
|
||||||
'2009 - 2013'
|
|
||||||
))).*
|
|
||||||
ORDER BY 1 ASC;
|
|
||||||
|
|
||||||
-- OBS_LookupCensusHuman
|
|
||||||
-- should give back: {"\"us.census.acs\".B19083001"}
|
|
||||||
SELECT
|
|
||||||
cdb_observatory.OBS_LookupCensusHuman(
|
|
||||||
Array['gini_index']
|
|
||||||
);
|
|
||||||
|
|
||||||
-- OBS_BuildSnapshotQuery
|
-- OBS_BuildSnapshotQuery
|
||||||
-- Should give back: SELECT vals[1] As total_pop, vals[2] As male_pop, vals[3] As female_pop, vals[4] As median_age
|
-- Should give back: SELECT vals[1] As total_pop, vals[2] As male_pop, vals[3] As female_pop, vals[4] As median_age
|
||||||
SELECT
|
SELECT
|
||||||
cdb_observatory.OBS_BuildSnapshotQuery(
|
cdb_observatory._OBS_BuildSnapshotQuery(
|
||||||
Array['total_pop','male_pop','female_pop','median_age']
|
Array['total_pop','male_pop','female_pop','median_age']
|
||||||
);
|
) = 'SELECT vals[1] As total_pop, vals[2] As male_pop, vals[3] As female_pop, vals[4] As median_age' As _OBS_BuildSnapshotQuery_test_1;
|
||||||
|
|
||||||
|
-- should give back: SELECT vals[1] As mandarin_orange
|
||||||
|
SELECT
|
||||||
|
cdb_observatory._OBS_BuildSnapshotQuery(
|
||||||
|
Array['mandarin_orange']
|
||||||
|
) = 'SELECT vals[1] As mandarin_orange' As _OBS_BuildSnapshotQuery_test_2;
|
||||||
|
|
||||||
|
-- should give back a standardized measure name
|
||||||
|
SELECT cdb_observatory._OBS_StandardizeMeasureName('test 343 %% 2 qqq }}{{}}') = 'test_343_2_qqq' As _OBS_StandardizeMeasureName_test;
|
||||||
|
|
||||||
|
SELECT cdb_observatory.OBS_DumpVersion()
|
||||||
|
IS NOT NULL AS OBS_DumpVersion_notnull;
|
||||||
|
|
||||||
|
-- Should succeed in intersecting
|
||||||
|
SELECT ST_IsValid(cdb_observatory.safe_intersection(
|
||||||
|
cdb_observatory.OBS_GetBoundaryByID('48061', 'us.census.tiger.county'),
|
||||||
|
cdb_observatory.OBS_GetBoundaryByID('48061', 'us.census.tiger.county_clipped')
|
||||||
|
)) AS complex_safe_intersection_works;
|
||||||
|
|||||||
@@ -0,0 +1,958 @@
|
|||||||
|
\pset format unaligned
|
||||||
|
\set ECHO none
|
||||||
|
SET client_min_messages TO WARNING;
|
||||||
|
|
||||||
|
--
|
||||||
|
WITH result as(
|
||||||
|
Select count(coalesce(OBS_GetDemographicSnapshot->>'value', 'foo')) expected_columns
|
||||||
|
FROM cdb_observatory.OBS_GetDemographicSnapshot(cdb_observatory._TestPoint(), '2010 - 2014')
|
||||||
|
) select expected_columns = 52 as OBS_GetDemographicSnapshot_test_no_returns
|
||||||
|
FROM result;
|
||||||
|
|
||||||
|
SELECT cdb_observatory.OBS_GetSegmentSnapshot(
|
||||||
|
cdb_observatory._TestPoint(),
|
||||||
|
'us.census.tiger.census_tract'
|
||||||
|
)::JSONB =
|
||||||
|
'{"x10_segment": "Wealthy, urban without Kids", "x55_segment": "Wealthy transplants displacing long-term local residents", "us.census.acs.B01001002_quantile": "0.494716216216216", "us.census.acs.B01001026_quantile": "0.183756756756757", "us.census.acs.B01002001_quantile": "0.0752837837837838", "us.census.acs.B01003001_quantile": "0.3235", "us.census.acs.B03002003_quantile": "0.293162162162162", "us.census.acs.B03002004_quantile": "0.455527027027027", "us.census.acs.B03002006_quantile": "0.656405405405405", "us.census.acs.B03002012_quantile": "0.840081081081081", "us.census.acs.B05001006_quantile": "0.727135135135135", "us.census.acs.B08006001_quantile": "0.688635135135135", "us.census.acs.B08006002_quantile": "0.0204459459459459", "us.census.acs.B08006009_quantile": "0.679324324324324", "us.census.acs.B08006011_quantile": "0.996716216216216", "us.census.acs.B08006015_quantile": "0.967418918918919", "us.census.acs.B08006017_quantile": "0.512945945945946", "us.census.acs.B08301010_quantile": "0.994743243243243", "us.census.acs.B09001001_quantile": "0.0504864864864865", "us.census.acs.B11001001_quantile": "0.192405405405405", "us.census.acs.B14001001_quantile": "0.331702702702703", "us.census.acs.B14001002_quantile": "0.296283783783784", "us.census.acs.B14001005_quantile": "0.045472972972973", "us.census.acs.B14001006_quantile": "0.0442702702702703", "us.census.acs.B14001007_quantile": "0.0829054054054054", "us.census.acs.B14001008_quantile": "0.701135135135135", "us.census.acs.B15003001_quantile": "0.404527027027027", "us.census.acs.B15003017_quantile": "0.191824324324324", "us.census.acs.B15003022_quantile": "0.864162162162162", "us.census.acs.B15003023_quantile": "0.754297297297297", "us.census.acs.B16001001_quantile": "0.350054054054054", "us.census.acs.B16001002_quantile": "0.217635135135135", "us.census.acs.B16001003_quantile": "0.85972972972973", "us.census.acs.B17001001_quantile": "0.342851351351351", "us.census.acs.B17001002_quantile": "0.51204054054054", "us.census.acs.B19013001_quantile": "0.813540540540541", "us.census.acs.B19083001_quantile": "0.0948648648648649", "us.census.acs.B19301001_quantile": "0.678351351351351", "us.census.acs.B25001001_quantile": "0.146108108108108", "us.census.acs.B25002003_quantile": "0.149067567567568", "us.census.acs.B25004002_quantile": "0", "us.census.acs.B25004004_quantile": "0", "us.census.acs.B25058001_quantile": "0.944554054054054", "us.census.acs.B25071001_quantile": "0.398040540540541", "us.census.acs.B25075001_quantile": "0.0596081081081081", "us.census.acs.B25075025_quantile": "0"}'::JSONB as test_point_segmentation;
|
||||||
|
|
||||||
|
-- segmentation around null island
|
||||||
|
SELECT cdb_observatory.OBS_GetSegmentSnapshot(
|
||||||
|
ST_SetSRID(ST_Point(0, 0), 4326),
|
||||||
|
'us.census.tiger.census_tract'
|
||||||
|
)::text is null as null_island_segmentation;
|
||||||
|
|
||||||
|
-- Point-based OBS_GetMeasure with zillow
|
||||||
|
SELECT abs(OBS_GetMeasure_zhvi_point - 446000) / 446000 < 5.0 AS OBS_GetMeasure_zhvi_point_test FROM cdb_observatory.OBS_GetMeasure(
|
||||||
|
ST_SetSRID(ST_Point(-73.90820503234865, 40.69469600456701), 4326),
|
||||||
|
'us.zillow.AllHomes_Zhvi', null, 'us.census.tiger.zcta5', '2014-01'
|
||||||
|
) As t(OBS_GetMeasure_zhvi_point);
|
||||||
|
|
||||||
|
-- Point-based OBS_GetMeasure with later measure
|
||||||
|
SELECT abs(OBS_GetMeasure_zhvi_point_default_latest - 701400) / 701400 < 5.0 AS OBS_GetMeasure_zhvi_point_default_latest_test FROM cdb_observatory.OBS_GetMeasure(
|
||||||
|
ST_SetSRID(ST_Point(-73.90820503234865, 40.69469600456701), 4326),
|
||||||
|
'us.zillow.AllHomes_Zhvi', null, 'us.census.tiger.zcta5', '2016-06'
|
||||||
|
) As t(OBS_GetMeasure_zhvi_point_default_latest);
|
||||||
|
|
||||||
|
-- Point-based OBS_GetMeasure, default normalization (area)
|
||||||
|
-- is result within 0.1% of expected
|
||||||
|
SELECT abs(OBS_GetMeasure_total_pop_point - 10923.093200390833950) / 10923.093200390833950 < 0.001 As OBS_GetMeasure_total_pop_point_test FROM
|
||||||
|
cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestPoint(),
|
||||||
|
'us.census.acs.B01003001'
|
||||||
|
) As t(OBS_GetMeasure_total_pop_point);
|
||||||
|
|
||||||
|
-- Point-based OBS_GetMeasure, default normalization by NULL (area)
|
||||||
|
-- is result within 0.1% of expected
|
||||||
|
SELECT abs(OBS_GetMeasure_total_pop_point_null_normalization - 10923.093200390833950) / 10923.093200390833950 < 0.001 As OBS_GetMeasure_total_pop_point_null_normalization_test FROM
|
||||||
|
cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestPoint(),
|
||||||
|
'us.census.acs.B01003001', NULL
|
||||||
|
) As t(OBS_GetMeasure_total_pop_point_null_normalization);
|
||||||
|
|
||||||
|
-- Point-based OBS_GetMeasure, explicit area normalization area
|
||||||
|
-- is result within 0.1% of expected
|
||||||
|
SELECT abs(OBS_GetMeasure_total_pop_point_area - 10923.093200390833950) / 10923.093200390833950 < 0.001 As OBS_GetMeasure_total_pop_point_area_test FROM
|
||||||
|
cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestPoint(),
|
||||||
|
'us.census.acs.B01003001', 'area'
|
||||||
|
) As t(OBS_GetMeasure_total_pop_point_area);
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetMeasure, default normalization (none)
|
||||||
|
-- is result within 0.1% of expected
|
||||||
|
SELECT abs(OBS_GetMeasure_total_pop_polygon - 12327.3133495107) / 12327.3133495107 < 0.001 As OBS_GetMeasure_total_pop_polygon_test FROM
|
||||||
|
cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestArea(),
|
||||||
|
'us.census.acs.B01003001'
|
||||||
|
) As t(OBS_GetMeasure_total_pop_polygon);
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetMeasure, default normalization by NULL (none)
|
||||||
|
-- is result within 0.1% of expected
|
||||||
|
SELECT abs(OBS_GetMeasure_total_pop_polygon_null_normalization - 12327.3133495107) / 12327.3133495107 < 0.001 As OBS_GetMeasure_total_pop_polygon_null_normalization_test FROM
|
||||||
|
cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestArea(),
|
||||||
|
'us.census.acs.B01003001', NULL
|
||||||
|
) As t(OBS_GetMeasure_total_pop_polygon_null_normalization);
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetMeasure, explicit area normalization
|
||||||
|
-- is result within 0.1% of expected
|
||||||
|
SELECT abs(OBS_GetMeasure_total_pop_polygon_area - 15787.4325563538) / 15787.4325563538 < 0.001 As OBS_GetMeasure_total_pop_polygon_area_test FROM
|
||||||
|
cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestArea(),
|
||||||
|
'us.census.acs.B01003001', 'area'
|
||||||
|
) As t(OBS_GetMeasure_total_pop_polygon_area);
|
||||||
|
|
||||||
|
-- Point-based OBS_GetMeasure with denominator normalization
|
||||||
|
SELECT (abs(cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestPoint(),
|
||||||
|
'us.census.acs.B01001002', 'denominator') - 0.62157894736842105263) / 0.62157894736842105263) < 0.001 As OBS_GetMeasure_total_male_point_denominator;
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetMeasure with denominator normalization
|
||||||
|
SELECT abs(cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._TestArea(),
|
||||||
|
'us.census.acs.B01001002', 'denominator', null, '2010 - 2014') - 0.49026340444793965457) / 0.49026340444793965457 < 0.001 As OBS_GetMeasure_total_male_poly_denominator;
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetMeasure with one very bad geom
|
||||||
|
SELECT abs(cdb_observatory.OBS_GetMeasure(
|
||||||
|
cdb_observatory._ProblemTestArea(),
|
||||||
|
'us.census.acs.B01003001') - 96230.2929825897) / 96230.2929825897 < 0.001 As OBS_GetMeasure_bad_geometry;
|
||||||
|
|
||||||
|
-- OBS_GetMeasure with NULL Input geometry
|
||||||
|
SELECT cdb_observatory.OBS_GetMeasure(
|
||||||
|
NULL,
|
||||||
|
'us.census.acs.B01003001') IS NULL As OBS_GetMeasure_null_geometry;
|
||||||
|
|
||||||
|
-- OBS_GetMeasure where there is no data
|
||||||
|
SELECT cdb_observatory.OBS_GetMeasure(
|
||||||
|
ST_SetSRID(st_point(0, 0), 4326),
|
||||||
|
'us.census.acs.B01003001') IS NULL As OBS_GetMeasure_out_of_bounds_geometry;
|
||||||
|
|
||||||
|
-- OBS_GetMeasure over arbitrary area for a measure we cannot estimate
|
||||||
|
SELECT cdb_observatory.OBS_GetMeasure(
|
||||||
|
ST_Buffer(cdb_observatory._testpoint(), 0.1),
|
||||||
|
'us.census.acs.B19083001') IS NULL As OBS_GetMeasure_estimate_for_blank_aggregate;
|
||||||
|
|
||||||
|
-- OBS_GetMeasure over arbitrary area for an average measure we can estimate
|
||||||
|
SELECT abs(cdb_observatory.OBS_GetMeasure(
|
||||||
|
ST_Buffer(cdb_observatory._testpoint(), 0.01),
|
||||||
|
'us.census.acs.B19301001') - 20025) / 20025 < 0.001 As OBS_GetMeasure_per_capita_income_average;
|
||||||
|
|
||||||
|
-- OBS_GetMeasure over arbitrary area for a median measure we can estimate
|
||||||
|
SELECT abs(cdb_observatory.OBS_GetMeasure(
|
||||||
|
ST_Buffer(cdb_observatory._testpoint(), 0.01),
|
||||||
|
'us.census.acs.B19013001') - 39266) / 39266 < 0.001 As OBS_GetMeasure_median_capita_income_average;
|
||||||
|
|
||||||
|
-- Point-based OBS_GetCategory
|
||||||
|
SELECT cdb_observatory.OBS_GetCategory(
|
||||||
|
cdb_observatory._TestPoint(), 'us.census.spielman_singleton_segments.X10') = 'Wealthy, urban without Kids' As OBS_GetCategory_point;
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetCategory
|
||||||
|
SELECT cdb_observatory.OBS_GetCategory(
|
||||||
|
cdb_observatory._TestArea(), 'us.census.spielman_singleton_segments.X10') = 'Hispanic and Young' As obs_getcategory_polygon;
|
||||||
|
|
||||||
|
-- NULL Input OBS_GetCategory
|
||||||
|
SELECT cdb_observatory.OBS_GetCategory(
|
||||||
|
NULL, 'us.census.spielman_singleton_segments.X10') IS NULL As obs_getcategory_null;
|
||||||
|
|
||||||
|
-- Point-based OBS_GetPopulation, default normalization (area)
|
||||||
|
SELECT (abs(OBS_GetPopulation - 10923.093200390833950) / 10923.093200390833950) < 0.001 As OBS_GetPopulation FROM
|
||||||
|
cdb_observatory.OBS_GetPopulation(
|
||||||
|
cdb_observatory._TestPoint()
|
||||||
|
) As m(OBS_GetPopulation);
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetPopulation, default normalization (none)
|
||||||
|
SELECT (abs(obs_getpopulation_polygon - 12327.3133495107) / 12327.3133495107) < 0.001 As obs_getpopulation_polygon_test
|
||||||
|
FROM
|
||||||
|
cdb_observatory.OBS_GetPopulation(
|
||||||
|
cdb_observatory._TestArea()
|
||||||
|
) As m(obs_getpopulation_polygon);
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetPopulation, default normalization (none) specified as NULL
|
||||||
|
SELECT (abs(obs_getpopulation_polygon_null - 12327.3133495107) / 12327.3133495107) < 0.001 As obs_getpopulation_polygon_null_test
|
||||||
|
FROM
|
||||||
|
cdb_observatory.OBS_GetPopulation(
|
||||||
|
cdb_observatory._TestArea(), NULL
|
||||||
|
) As m(obs_getpopulation_polygon_null);
|
||||||
|
|
||||||
|
-- Null input OBS_GetPopulation
|
||||||
|
SELECT obs_getpopulation_polygon_null_geom IS NULL As obs_getpopulation_polygon_null_geom_test
|
||||||
|
FROM
|
||||||
|
cdb_observatory.OBS_GetPopulation(
|
||||||
|
NULL, NULL
|
||||||
|
) As m(obs_getpopulation_polygon_null_geom);
|
||||||
|
|
||||||
|
-- Point-based OBS_GetUSCensusMeasure, default normalization (area)
|
||||||
|
SELECT (abs(cdb_observatory.obs_getuscensusmeasure(
|
||||||
|
cdb_observatory._testpoint(), 'male population') - 6789.5647735060920500) / 6789.5647735060920500) < 0.001 As obs_getuscensusmeasure_point_male_pop;
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetUSCensusMeasure, default normalization (none)
|
||||||
|
SELECT (abs(cdb_observatory.obs_getuscensusmeasure(
|
||||||
|
cdb_observatory._testarea(), 'male population') - 6043.63061042765) / 6043.63061042765) < 0.001 As obs_getuscensusmeasure;
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetUSCensusMeasure, default normalization (none) specified
|
||||||
|
-- with NULL
|
||||||
|
SELECT (abs(cdb_observatory.obs_getuscensusmeasure(
|
||||||
|
cdb_observatory._testarea(), 'male population', NULL) - 6043.63061042765) / 6043.63061042765) < 0.001 As obs_getuscensusmeasure_null;
|
||||||
|
|
||||||
|
-- Poly-based OBS_GetUSCensusMeasure, Null input geom
|
||||||
|
SELECT cdb_observatory.obs_getuscensusmeasure(
|
||||||
|
NULL, 'male population', NULL) IS NULL As obs_getuscensusmeasure_null_geom;
|
||||||
|
|
||||||
|
|
||||||
|
-- Point-based OBS_GetUSCensusCategory
|
||||||
|
SELECT cdb_observatory.OBS_GetUSCensusCategory(
|
||||||
|
cdb_observatory._testpoint(), 'Spielman-Singleton Segments: 10 Clusters') = 'Wealthy, urban without Kids' As OBS_GetUSCensusCategory_point;
|
||||||
|
|
||||||
|
-- Area-based OBS_GetUSCensusCategory
|
||||||
|
SELECT cdb_observatory.OBS_GetUSCensusCategory(
|
||||||
|
cdb_observatory._testarea(), 'Spielman-Singleton Segments: 10 Clusters') = 'Hispanic and Young' As OBS_GetUSCensusCategory_polygon;
|
||||||
|
|
||||||
|
-- Null-input OBS_GetUSCensusCategory
|
||||||
|
SELECT cdb_observatory.OBS_GetUSCensusCategory(
|
||||||
|
NULL, 'Spielman-Singleton Segments: 10 Clusters') IS NULL As OBS_GetUSCensusCategory_null;
|
||||||
|
|
||||||
|
|
||||||
|
-- OBS_GetMeasureById tests
|
||||||
|
-- typical query
|
||||||
|
SELECT (cdb_observatory.OBS_GetMeasureById(
|
||||||
|
'36047048500',
|
||||||
|
'us.census.acs.B01003001',
|
||||||
|
'us.census.tiger.census_tract',
|
||||||
|
'2010 - 2014'
|
||||||
|
) - 3241) / 3241 < 0.0001 As OBS_GetMeasureById_cartodb_census_tract;
|
||||||
|
|
||||||
|
-- no boundary_id should give null
|
||||||
|
SELECT cdb_observatory.OBS_GetMeasureById(
|
||||||
|
'36047048500',
|
||||||
|
'us.census.acs.B01003001',
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
) IS NULL As OBS_GetMeasureById_null_boundary_null_timespan;
|
||||||
|
|
||||||
|
-- query at block_group level
|
||||||
|
SELECT (cdb_observatory.OBS_GetMeasureById(
|
||||||
|
'360470485002',
|
||||||
|
'us.census.acs.B01003001',
|
||||||
|
'us.census.tiger.block_group',
|
||||||
|
'2010 - 2014'
|
||||||
|
) - 1900) / 1900 < 0.0001 As OBS_GetMeasureById_cartodb_block_group;
|
||||||
|
|
||||||
|
-- geom ref / boundary mismatch
|
||||||
|
SELECT cdb_observatory.OBS_GetMeasureById(
|
||||||
|
'36047048500',
|
||||||
|
'us.census.acs.B01003001',
|
||||||
|
'us.census.tiger.block_group',
|
||||||
|
'2010 - 2014'
|
||||||
|
) IS NULL As OBS_GetMeasureById_nulls;
|
||||||
|
|
||||||
|
-- NULL input id
|
||||||
|
SELECT cdb_observatory.OBS_GetMeasureById(
|
||||||
|
NULL,
|
||||||
|
'us.census.acs.B01003001',
|
||||||
|
'us.census.tiger.block_group',
|
||||||
|
'2010 - 2014'
|
||||||
|
) IS NULL As OBS_GetMeasureById_null_id;
|
||||||
|
|
||||||
|
-- OBS_GetMeta null/null
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(NULL, NULL) IS NULL
|
||||||
|
AS OBS_GetMeta_null_null_is_null;
|
||||||
|
|
||||||
|
-- OBS_GetMeta null/empty array
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(NULL, '[]') IS NULL
|
||||||
|
AS OBS_GetMeta_null_empty_is_null;
|
||||||
|
|
||||||
|
-- OBS_GetMeta nullisland/null
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(ST_Point(0, 0), NULL) IS NULL
|
||||||
|
AS OBS_GetMeta_nullisland_null_is_null;
|
||||||
|
|
||||||
|
-- OBS_GetMeta nullisland/empty array
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(ST_Point(0, 0), '[]') IS NULL
|
||||||
|
AS OBS_GetMeta_nullisland_empty_is_null;
|
||||||
|
|
||||||
|
-- OBS_GetMeta nullisland/us_measure data
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(ST_Point(0, 0),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]') IS NULL
|
||||||
|
AS OBS_GetMeta_nullisland_us_measure_is_null;
|
||||||
|
|
||||||
|
-- OBS_GetMeta for point completes one partial measure with "best" metadata
|
||||||
|
-- with no denominator
|
||||||
|
WITH meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]') meta)
|
||||||
|
SELECT
|
||||||
|
(meta->0->>'id')::integer = 1 id,
|
||||||
|
(meta->0->>'numer_id') = 'us.census.acs.B01003001' numer_id,
|
||||||
|
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
|
(meta->0->>'score_rank')::integer = 1 score_rank,
|
||||||
|
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
|
(meta->0->>'numer_colname') = 'total_pop' numer_colname,
|
||||||
|
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
||||||
|
(meta->0->>'numer_name') = 'Total Population' numer_name,
|
||||||
|
(meta->0->>'denom_id') IS NULL denom_id,
|
||||||
|
(meta->0->>'geom_id') = 'us.census.tiger.block_group' geom_id,
|
||||||
|
(meta->0->>'normalization') = 'area' normalization
|
||||||
|
FROM meta;
|
||||||
|
|
||||||
|
-- OBS_GetMeta for point completes one partial measure with "best" metadata
|
||||||
|
-- with a denominator
|
||||||
|
WITH meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002"}]') meta)
|
||||||
|
SELECT
|
||||||
|
(meta->0->>'id')::integer = 1 id,
|
||||||
|
(meta->0->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
||||||
|
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
|
(meta->0->>'score_rank')::integer = 1 score_rank,
|
||||||
|
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
|
(meta->0->>'numer_colname') = 'male_pop' numer_colname,
|
||||||
|
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
||||||
|
(meta->0->>'numer_name') = 'Male Population' numer_name,
|
||||||
|
(meta->0->>'denom_id') = 'us.census.acs.B01003001' denom_id,
|
||||||
|
(meta->0->>'denom_aggregate') = 'sum' denom_aggregate,
|
||||||
|
(meta->0->>'denom_colname') = 'total_pop' denom_colname,
|
||||||
|
(meta->0->>'denom_type') = 'Numeric' denom_type,
|
||||||
|
(meta->0->>'denom_name') = 'Total Population' denom_name,
|
||||||
|
(meta->0->>'geom_id') = 'us.census.tiger.block_group' geom_id,
|
||||||
|
(meta->0->>'normalization') = 'denominated' normalization
|
||||||
|
FROM meta;
|
||||||
|
|
||||||
|
-- OBS_GetMeta for polygon completes one partial measure with "best" metadata
|
||||||
|
-- with no denominator
|
||||||
|
WITH meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]') meta)
|
||||||
|
SELECT
|
||||||
|
(meta->0->>'id')::integer = 1 id,
|
||||||
|
(meta->0->>'numer_id') = 'us.census.acs.B01003001' numer_id,
|
||||||
|
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
|
(meta->0->>'score_rank')::integer = 1 score_rank,
|
||||||
|
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
|
(meta->0->>'numer_colname') = 'total_pop' numer_colname,
|
||||||
|
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
||||||
|
(meta->0->>'numer_name') = 'Total Population' numer_name,
|
||||||
|
(meta->0->>'denom_id') IS NULL denom_id,
|
||||||
|
(meta->0->>'geom_id') = 'us.census.tiger.block_group' geom_id,
|
||||||
|
(meta->0->>'normalization') = 'area' normalization
|
||||||
|
FROM meta;
|
||||||
|
|
||||||
|
-- OBS_GetMeta for polygon completes one partial measure with "best" metadata
|
||||||
|
-- with a denominator
|
||||||
|
WITH meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002"}]') meta)
|
||||||
|
SELECT
|
||||||
|
(meta->0->>'id')::integer = 1 id,
|
||||||
|
(meta->0->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
||||||
|
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
|
(meta->0->>'score_rank')::integer = 1 score_rank,
|
||||||
|
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
|
(meta->0->>'numer_colname') = 'male_pop' numer_colname,
|
||||||
|
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
||||||
|
(meta->0->>'numer_name') = 'Male Population' numer_name,
|
||||||
|
(meta->0->>'denom_id') = 'us.census.acs.B01003001' denom_id,
|
||||||
|
(meta->0->>'denom_aggregate') = 'sum' denom_aggregate,
|
||||||
|
(meta->0->>'denom_colname') = 'total_pop' denom_colname,
|
||||||
|
(meta->0->>'denom_type') = 'Numeric' denom_type,
|
||||||
|
(meta->0->>'denom_name') = 'Total Population' denom_name,
|
||||||
|
(meta->0->>'geom_id') = 'us.census.tiger.block_group' geom_id,
|
||||||
|
(meta->0->>'normalization') = 'denominated' normalization
|
||||||
|
FROM meta;
|
||||||
|
|
||||||
|
-- OBS_GetMeta for point completes several partial measures with "best"
|
||||||
|
-- metadata, includes geom alternatives if asked
|
||||||
|
WITH meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002", "max_score_rank": 2}]', null, 2) meta)
|
||||||
|
SELECT
|
||||||
|
(meta->0->>'id')::integer = 1 id,
|
||||||
|
(meta->0->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
||||||
|
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
|
(meta->0->>'score_rank')::integer = 1 OR (meta->0->>'score_rank')::integer = 2 score_rank,
|
||||||
|
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
|
(meta->0->>'numer_colname') = 'male_pop' numer_colname,
|
||||||
|
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
||||||
|
(meta->0->>'numer_name') = 'Male Population' numer_name,
|
||||||
|
(meta->0->>'denom_id') = 'us.census.acs.B01003001' denom_id,
|
||||||
|
(meta->0->>'denom_aggregate') = 'sum' denom_aggregate,
|
||||||
|
(meta->0->>'denom_colname') = 'total_pop' denom_colname,
|
||||||
|
(meta->0->>'denom_type') = 'Numeric' denom_type,
|
||||||
|
(meta->0->>'denom_name') = 'Total Population' denom_name,
|
||||||
|
(meta->0->>'geom_id') = 'us.census.tiger.block_group' OR (meta->0->>'geom_id') = 'us.census.tiger.census_tract' geom_id,
|
||||||
|
(meta->0->>'normalization') = 'denominated' normalization,
|
||||||
|
(meta->1->>'id')::integer = 1 id,
|
||||||
|
(meta->1->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
||||||
|
(meta->1->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
|
(meta->1->>'score_rank')::integer = 1 OR (meta->1->>'score_rank')::integer = 2 score_rank,
|
||||||
|
(meta->1->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
|
(meta->1->>'numer_colname') = 'male_pop' numer_colname,
|
||||||
|
(meta->1->>'numer_type') = 'Numeric' numer_type,
|
||||||
|
(meta->1->>'numer_name') = 'Male Population' numer_name,
|
||||||
|
(meta->1->>'denom_id') = 'us.census.acs.B01003001' denom_id,
|
||||||
|
(meta->1->>'denom_aggregate') = 'sum' denom_aggregate,
|
||||||
|
(meta->1->>'denom_colname') = 'total_pop' denom_colname,
|
||||||
|
(meta->1->>'denom_type') = 'Numeric' denom_type,
|
||||||
|
(meta->1->>'denom_name') = 'Total Population' denom_name,
|
||||||
|
(meta->1->>'geom_id') = 'us.census.tiger.block_group' OR (meta->1->>'geom_id') = 'us.census.tiger.census_tract' geom_id,
|
||||||
|
(meta->1->>'normalization') = 'denominated' normalization
|
||||||
|
FROM meta;
|
||||||
|
|
||||||
|
-- OBS_GetMeta for point completes several partial measures with "best" metadata
|
||||||
|
-- with pre-computed geom
|
||||||
|
WITH meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002", "geom_id": "us.census.tiger.census_tract"}]') meta)
|
||||||
|
SELECT
|
||||||
|
(meta->0->>'id')::integer = 1 id,
|
||||||
|
(meta->0->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
||||||
|
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
|
(meta->0->>'score_rank')::integer = 1 score_rank,
|
||||||
|
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
|
(meta->0->>'numer_colname') = 'male_pop' numer_colname,
|
||||||
|
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
||||||
|
(meta->0->>'numer_name') = 'Male Population' numer_name,
|
||||||
|
(meta->0->>'denom_id') = 'us.census.acs.B01003001' denom_id,
|
||||||
|
(meta->0->>'denom_aggregate') = 'sum' denom_aggregate,
|
||||||
|
(meta->0->>'denom_colname') = 'total_pop' denom_colname,
|
||||||
|
(meta->0->>'denom_type') = 'Numeric' denom_type,
|
||||||
|
(meta->0->>'denom_name') = 'Total Population' denom_name,
|
||||||
|
(meta->0->>'geom_id') = 'us.census.tiger.census_tract' geom_id,
|
||||||
|
(meta->0->>'normalization') = 'denominated' normalization
|
||||||
|
FROM meta;
|
||||||
|
|
||||||
|
-- OBS_GetMeta for point completes several partial measures with conflicting
|
||||||
|
-- metadata
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002", "denom_id": "us.census.acs.B01001002", "geom_id": "us.census.tiger.census_tract"}]') IS NULL
|
||||||
|
AS obs_getmeta_conflicting_metadata;
|
||||||
|
|
||||||
|
-- OBS_GetMeta provides suggested name for simple meta request
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "predenom"}]'
|
||||||
|
)->0->>'suggested_name' = 'total_pop_2010_2014' obs_getmeta_suggested_name;
|
||||||
|
|
||||||
|
-- OBS_GetMeta provides suggested name for simple meta request with area norm
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]'
|
||||||
|
)->0->>'suggested_name' = 'total_pop_per_sq_km_2010_2014' obs_getmeta_suggested_name_implicit_area;
|
||||||
|
|
||||||
|
-- OBS_GetMeta provides suggested name for simple meta request with area norm
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "area"}]'
|
||||||
|
)->0->>'suggested_name' = 'total_pop_per_sq_km_2010_2014' obs_getmeta_suggested_name_area;
|
||||||
|
|
||||||
|
-- OBS_GetMeta provides suggested name for simple meta request with denom
|
||||||
|
SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002", "normalization": "denom"}]'
|
||||||
|
)->0->>'suggested_name' = 'male_pop_2010_2014_by_total_pop' obs_getmeta_suggested_name_denom;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by id with empty list/null
|
||||||
|
WITH data AS (SELECT * FROM cdb_observatory.OBS_GetData(ARRAY[]::TEXT[], null))
|
||||||
|
SELECT ARRAY_AGG(data) IS NULL AS obs_getdata_geomval_empty_null FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with empty list/null
|
||||||
|
WITH data AS (SELECT * FROM cdb_observatory.OBS_GetData(ARRAY[]::GEOMVAL[], null))
|
||||||
|
SELECT ARRAY_AGG(data) IS NULL AS obs_getdata_text_empty_null FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with empty list
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(ARRAY[]::GEOMVAL[],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT ARRAY_AGG(data) IS NULL AS obs_getdata_geomval_empty_one_measure FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by point geom with one standard measure NULL
|
||||||
|
-- normalization
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]') 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 - 10923) / 10923 < 0.001 data_point_measure_null,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by polygon geom with one standard measure NULL
|
||||||
|
-- normalization
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}]') 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 - 15787) / 15787 < 0.001 data_polygon_measure_null,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by point geom with one standard measure area
|
||||||
|
-- normalization
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "area"}]') 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 - 10923) / 10923 < 0.001 data_point_measure_area,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by polygon geom with one standard measure area
|
||||||
|
-- normalization
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "area"}]') 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 - 15787) / 15787 < 0.001 data_polygon_measure_area,
|
||||||
|
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(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "predenominated"}]') 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_predenominated,
|
||||||
|
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(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "predenominated"}]') 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_predenominated,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by point geom with impossible denom
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "denominated"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestPoint(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = 1 id,
|
||||||
|
data->0->>'value' IS NULL data_point_measure_impossible_denominated,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by polygon geom with one impossible denom
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "denominated"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = 1 id,
|
||||||
|
data->0->>'value' IS NULL data_polygon_measure_impossible_denominated,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by point geom with denom
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002", "normalization": "denominated"}]') 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 - 0.6215) / 0.6215 < 0.001 data_point_measure_denominated,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by polygon geom with one denom measure
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01001002", "normalization": "denominated"}]') 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 - 0.4902) / 0.4902 < 0.001 data_polygon_measure_denominated,
|
||||||
|
data->1 IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with two standard measures NULL normalization
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001"}, {"numer_id": "us.census.acs.B01001002"}]') 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 - 15787) / 15787 < 0.001 data_polygon_measure_one_null,
|
||||||
|
abs((data->1->>'value')::Numeric - 0.4902) / 0.4902 < 0.001 data_polygon_measure_two_null
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with two measures and one return null
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B19013001_quantile"}, {"numer_id": "us.census.acs.B01001002"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = 1 id,
|
||||||
|
(data->0->>'value') is NULL data_polygon_measure_one_null,
|
||||||
|
abs((data->1->>'value')::Numeric - 0.4902) / 0.4902 < 0.001 data_polygon_measure_two_null
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with two standard measures predenom normalization
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "predenom"}, {"numer_id": "us.census.acs.B01001002", "normalization": "predenom"}]') 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_one_predenom,
|
||||||
|
abs((data->1->>'value')::Numeric - 6043) / 6043 < 0.001 data_polygon_measure_two_predenom
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with two standard measures area normalization
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "normalization": "area"}, {"numer_id": "us.census.acs.B01001002", "normalization": "area"}]') 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 - 15787) / 15787 < 0.001 data_polygon_measure_one_area,
|
||||||
|
abs((data->1->>'value')::Numeric - 7739) / 7739 < 0.001 data_polygon_measure_two_area
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with two standard measures different geoms
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.census_tract"}, {"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.block_group"}]') 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 - 16960) / 16960 < 0.001 data_polygon_measure_tract,
|
||||||
|
abs((data->1->>'value')::Numeric - 15787) / 15787 < 0.001 data_polygon_measure_bg
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by point geom with one categorical
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestPoint(),
|
||||||
|
'[{"numer_id": "us.census.spielman_singleton_segments.X55"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestPoint(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = 1 id,
|
||||||
|
data->0->>'value' = 'Wealthy transplants displacing long-term local residents' data_point_categorical,
|
||||||
|
data->1->>'value' IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by polygon geom with one categorical
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.spielman_singleton_segments.X55"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = 1 id,
|
||||||
|
data->0->>'value' = 'Hispanic Black mix multilingual, high poverty, renters, uses public transport' data_poly_categorical,
|
||||||
|
data->1->>'value' IS NULL nullcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with one categorical and one measure
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"numer_id": "us.census.spielman_singleton_segments.X55"}, {"numer_id": "us.census.acs.B01003001"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = 1 id,
|
||||||
|
data->0->>'value' = 'Hispanic Black mix multilingual, high poverty, renters, uses public transport' data_poly_categorical,
|
||||||
|
abs((data->1->>'value')::Numeric - 15790) / 15790 < 0.0001 valcol
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with polygons inside a polygon
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"geom_id": "us.census.tiger.block_group"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta), false))
|
||||||
|
SELECT every(id = 1) is TRUE id,
|
||||||
|
count(distinct (data->0->>'value')::geometry) = 16 correct_num_geoms
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with polygons inside a polygon + one measure
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"geom_id": "us.census.tiger.block_group"}, {"numer_id": "us.census.acs.B01003001", "normalization": "predenom", "geom_id": "us.census.tiger.block_group"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta), false))
|
||||||
|
SELECT every(id = 1) is TRUE id,
|
||||||
|
count(distinct (data->0->>'value')::geometry) = 16 correct_num_geoms,
|
||||||
|
abs(sum((data->1->>'value')::numeric) - 12329) / 12329 < 0.001 correct_pop
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by geom with polygons inside a polygon + one measure + one text
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"geom_id": "us.census.tiger.block_group"}, {"numer_id": "us.census.acs.B01003001", "normalization": "predenom", "geom_id": "us.census.tiger.block_group"}, {"numer_id": "us.census.tiger.block_group_geoname", "geom_id": "us.census.tiger.block_group"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY[(cdb_observatory._TestArea(), 1)::geomval],
|
||||||
|
(SELECT meta FROM meta), false))
|
||||||
|
SELECT every(id = 1) is TRUE id,
|
||||||
|
count(distinct (data->0->>'value')::geometry) = 16 correct_num_geoms,
|
||||||
|
abs(sum((data->1->>'value')::numeric) - 12329) / 12329 < 0.001 correct_pop,
|
||||||
|
array_agg(distinct data->2->>'value') = '{"Block Group 1","Block Group 2","Block Group 3","Block Group 4","Block Group 5"}' correct_bg_names
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData by id with one standard measure
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"geom_id": "us.census.tiger.census_tract", "numer_id": "us.census.acs.B01003001"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY['36047048500'],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = '36047048500' AS id,
|
||||||
|
(abs((data->0->>'value')::numeric) - 5578) / 5578 < 0.001 obs_getdata_by_id_one_measure_null
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData by id with one standard measure, predenominated
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"normalization": "predenominated", "geom_id": "us.census.tiger.census_tract", "numer_id": "us.census.acs.B01003001"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY['36047048500'],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = '36047048500' AS id,
|
||||||
|
(abs((data->0->>'value')::numeric) - 3241) / 3241 < 0.001 obs_getdata_by_id_one_measure_predenom
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by id with two standard measures
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"geom_id": "us.census.tiger.census_tract", "numer_id": "us.census.acs.B01003001"}, {"geom_id": "us.census.tiger.census_tract", "numer_id": "us.census.acs.B01001002"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY['36047048500'],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = '36047048500' AS id,
|
||||||
|
(abs((data->0->>'value')::numeric) - 5578) / 5578 < 0.001 obs_getdata_by_id_one_measure_null,
|
||||||
|
(abs((data->1->>'value')::numeric) - 0.6053) / 0.6053 < 0.001 obs_getdata_by_id_two_measure_null
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by id with one categorical
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"geom_id": "us.census.tiger.census_tract", "numer_id": "us.census.spielman_singleton_segments.X55"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY['36047048500'],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = '36047048500' AS id,
|
||||||
|
data->0->>'value' = 'Wealthy transplants displacing long-term local residents' obs_getdata_by_id_categorical
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData/OBS_GetMeta by id with one geometry
|
||||||
|
WITH
|
||||||
|
meta AS (SELECT cdb_observatory.OBS_GetMeta(cdb_observatory._TestArea(),
|
||||||
|
'[{"geom_id": "us.census.tiger.census_tract"}]') meta),
|
||||||
|
data AS (SELECT * FROM cdb_observatory.OBS_GetData(
|
||||||
|
ARRAY['36047048500'],
|
||||||
|
(SELECT meta FROM meta)))
|
||||||
|
SELECT id = '36047048500' AS id,
|
||||||
|
ST_GeometryType((data->0->>'value')::geometry) = 'ST_MultiPolygon' obs_getdata_by_id_geometry
|
||||||
|
FROM data;
|
||||||
|
|
||||||
|
-- OBS_GetData with an API + geomvals, no args
|
||||||
|
SELECT (SELECT array_agg(json_array_elements::text) @> array['"us.census.tiger.census_tract"']
|
||||||
|
FROM json_array_elements(data->0->'value'))
|
||||||
|
AS OBS_GetData_API_geomvals_no_args
|
||||||
|
FROM cdb_observatory.obs_getdata(array[(cdb_observatory._testarea(), 1)::geomval],
|
||||||
|
'[{"numer_type": "text", "numer_colname": "boundary_id", "api_method": "obs_getavailableboundaries"}]');
|
||||||
|
|
||||||
|
-- OBS_GetData with an API + geomvals, args, numeric
|
||||||
|
SELECT json_typeof(data->0->'value') = 'array' ary_type,
|
||||||
|
json_typeof(data->0->'value'->0) = 'number'
|
||||||
|
AS OBS_GetData_API_geomvals_args_numer_return
|
||||||
|
FROM cdb_observatory.obs_getdata(array[(cdb_observatory._testarea(), 1)::geomval],
|
||||||
|
'[{"numer_type": "numeric", "numer_colname": "obs_getmeasure", "api_method": "obs_getmeasure", "api_args": ["us.census.acs.B01003001"]}]');
|
||||||
|
|
||||||
|
-- OBS_GetData with an API + geomvals, args, text
|
||||||
|
SELECT json_typeof(data->0->'value') = 'array' ary_type,
|
||||||
|
json_typeof(data->0->'value'->0) = 'string'
|
||||||
|
AS OBS_GetData_API_geomvals_args_string_return
|
||||||
|
FROM cdb_observatory.obs_getdata(array[(cdb_observatory._testarea(), 1)::geomval],
|
||||||
|
'[{"numer_type": "text", "numer_colname": "obs_getcategory", "api_method": "obs_getcategory", "api_args": ["us.census.spielman_singleton_segments.X55"]}]');
|
||||||
|
|
||||||
|
-- OBS_GetData with an API + geomrefs, args, numeric
|
||||||
|
SELECT json_typeof(data->0->'value') = 'array' ary_type,
|
||||||
|
json_typeof(data->0->'value'->0) = 'number'
|
||||||
|
AS OBS_GetData_API_geomrefs_args_numer_return
|
||||||
|
FROM cdb_observatory.obs_getdata(array['36047076200'],
|
||||||
|
'[{"numer_type": "numeric", "numer_colname": "obs_getmeasurebyid", "api_method": "obs_getmeasurebyid", "api_args": ["us.census.acs.B01003001", "us.census.tiger.census_tract"]}]');
|
||||||
|
|
||||||
|
-- OBS_GetData with an API + geomrefs, args, text
|
||||||
|
SELECT json_typeof(data->0->'value') = 'array' ary_type,
|
||||||
|
json_typeof(data->0->'value'->0) = 'string'
|
||||||
|
AS OBS_GetData_API_geomrefs_args_string_return
|
||||||
|
FROM cdb_observatory.obs_getdata(array['36047'],
|
||||||
|
'[{"numer_type": "text", "numer_colname": "obs_getboundarybyid", "api_method": "obs_getboundarybyid", "api_args": ["us.census.tiger.county"]}]');
|
||||||
|
|
||||||
|
-- Ensure consistent results below.
|
||||||
|
select setseed(0);
|
||||||
|
|
||||||
|
-- Check that random assortment of block groups in Brooklyn return accurate data
|
||||||
|
WITH _geoms AS (
|
||||||
|
SELECT
|
||||||
|
(data->0->>'value')::geometry the_geom,
|
||||||
|
data->0->>'geomref' geom_ref,
|
||||||
|
(data->1->>'value')::numeric total_pop
|
||||||
|
FROM cdb_observatory.OBS_GetData(
|
||||||
|
array[(st_buffer(cdb_observatory._testpoint(), 0.2), 1)::geomval],
|
||||||
|
(SELECT cdb_observatory.OBS_GetMeta(ST_MakeEnvelope(-179, 89, 179, -89, 4326),
|
||||||
|
'[{"geom_id": "us.census.tiger.block_group"},
|
||||||
|
{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.block_group", "normalization": "predenom"}]')),
|
||||||
|
FALSE
|
||||||
|
)
|
||||||
|
WHERE data->0->>'geomref' LIKE '36047%'
|
||||||
|
ORDER BY RANDOM()
|
||||||
|
), geoms AS (
|
||||||
|
SELECT *, row_number() OVER () cartodb_id FROM _geoms
|
||||||
|
), samples AS (
|
||||||
|
SELECT COUNT(*) cnt, unnest(ARRAY[1, 2, 3, 5, 10, 25, 50, 100, COUNT(*)]) sample FROM geoms
|
||||||
|
), filtered AS (
|
||||||
|
SELECT * FROM geoms, samples WHERE cartodb_id % (cnt / sample) = 0
|
||||||
|
), summary AS (
|
||||||
|
SELECT sample, ST_SetSRID(ST_Extent(the_geom), 4326) extent,
|
||||||
|
COUNT(*)::INT cnt,
|
||||||
|
ARRAY_AGG((the_geom, cartodb_id)::geomval) geomvals,
|
||||||
|
SUM(ST_Area(the_geom))::Numeric sumarea
|
||||||
|
FROM filtered
|
||||||
|
GROUP BY sample
|
||||||
|
), meta AS (
|
||||||
|
SELECT sample, cdb_observatory.OBS_GetMeta(extent,
|
||||||
|
('[{"numer_id": "us.census.acs.B01003001", "normalization": "predenom", "target_area": ' || sumarea || '}]')::JSON,
|
||||||
|
1, 1, cnt) meta
|
||||||
|
FROM summary
|
||||||
|
GROUP BY sample, extent, cnt, sumarea
|
||||||
|
), results AS (
|
||||||
|
SELECT summary.sample, id, meta->0->>'geom_id' geom_id, (data->0->>'value')::Numeric as val
|
||||||
|
FROM summary, meta, LATERAL cdb_observatory.OBS_GetData(geomvals, meta) data
|
||||||
|
WHERE summary.sample = meta.sample
|
||||||
|
) SELECT sample bg_sample
|
||||||
|
, MAX(100 * abs((geoms.total_pop - val) / Coalesce(NullIf(total_pop, 0), NULL)))::Numeric(10, 2) < 10 bg_max_error
|
||||||
|
, AVG(100 * abs((geoms.total_pop - val) / Coalesce(NullIf(total_pop, 0), NULL)))::Numeric(10, 2) < 10 bg_avg_error
|
||||||
|
, MIN(100 * abs((geoms.total_pop - val) / Coalesce(NullIf(total_pop, 0), NULL)))::Numeric(10, 2) < 10 bg_min_error
|
||||||
|
FROM geoms, results
|
||||||
|
WHERE cartodb_id = id
|
||||||
|
GROUP BY sample
|
||||||
|
ORDER BY sample
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Check that random assortment of tracts in Brooklyn return accurate data
|
||||||
|
WITH _geoms AS (
|
||||||
|
SELECT
|
||||||
|
(data->0->>'value')::geometry the_geom,
|
||||||
|
data->0->>'geomref' geom_ref,
|
||||||
|
(data->1->>'value')::numeric total_pop
|
||||||
|
FROM cdb_observatory.OBS_GetData(
|
||||||
|
array[(st_buffer(cdb_observatory._testpoint(), 0.2), 1)::geomval],
|
||||||
|
(SELECT cdb_observatory.OBS_GetMeta(ST_MakeEnvelope(-179, 89, 179, -89, 4326),
|
||||||
|
'[{"geom_id": "us.census.tiger.census_tract"},
|
||||||
|
{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.census_tract", "normalization": "predenom"}]')),
|
||||||
|
FALSE
|
||||||
|
)
|
||||||
|
WHERE data->0->>'geomref' LIKE '36047%'
|
||||||
|
and (data->1->>'value')::numeric > 1000
|
||||||
|
ORDER BY geom_ref
|
||||||
|
), geoms AS (
|
||||||
|
SELECT *, row_number() OVER () cartodb_id FROM _geoms
|
||||||
|
), samples AS (
|
||||||
|
SELECT COUNT(*) cnt, unnest(ARRAY[1, 2, 3, 5, 10, 25, 50, 100, COUNT(*)]) sample FROM geoms
|
||||||
|
), filtered AS (
|
||||||
|
SELECT * FROM geoms, samples WHERE cartodb_id % (cnt / sample) = 0
|
||||||
|
), summary AS (
|
||||||
|
SELECT sample, ST_SetSRID(ST_Extent(the_geom), 4326) extent,
|
||||||
|
COUNT(*)::INT cnt,
|
||||||
|
ARRAY_AGG((the_geom, cartodb_id)::geomval) geomvals,
|
||||||
|
SUM(ST_Area(the_geom))::Numeric sumarea
|
||||||
|
FROM filtered
|
||||||
|
GROUP BY sample
|
||||||
|
), meta AS (
|
||||||
|
SELECT sample, cdb_observatory.OBS_GetMeta(extent,
|
||||||
|
('[{"numer_id": "us.census.acs.B01003001", "normalization": "predenom", "target_area": ' || sumarea || '}]')::JSON,
|
||||||
|
1, 1, cnt) meta
|
||||||
|
FROM summary
|
||||||
|
GROUP BY sample, extent, cnt, sumarea
|
||||||
|
), results AS (
|
||||||
|
SELECT summary.sample, id, meta->0->>'geom_id' geom_id, (data->0->>'value')::Numeric as val
|
||||||
|
FROM summary, meta, LATERAL cdb_observatory.OBS_GetData(geomvals, meta) data
|
||||||
|
WHERE summary.sample = meta.sample
|
||||||
|
) SELECT sample tract_sample
|
||||||
|
, MAX(100 * abs((geoms.total_pop - val) / Coalesce(NullIf(total_pop, 0), NULL)))::Numeric(10, 2) < 10 tract_max_error
|
||||||
|
, AVG(100 * abs((geoms.total_pop - val) / Coalesce(NullIf(total_pop, 0), NULL)))::Numeric(10, 2) < 10 tract_avg_error
|
||||||
|
, MIN(100 * abs((geoms.total_pop - val) / Coalesce(NullIf(total_pop, 0), NULL)))::Numeric(10, 2) < 10 tract_min_error
|
||||||
|
FROM geoms, results
|
||||||
|
WHERE cartodb_id = id
|
||||||
|
GROUP BY sample
|
||||||
|
ORDER BY sample
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Check that random assortment of block group points in Brooklyn return accurate data
|
||||||
|
WITH _geoms AS (
|
||||||
|
SELECT
|
||||||
|
ST_PointOnSurface((data->0->>'value')::geometry) the_geom,
|
||||||
|
data->0->>'geomref' geom_ref,
|
||||||
|
(data->1->>'value')::numeric total_pop
|
||||||
|
FROM cdb_observatory.OBS_GetData(
|
||||||
|
array[(st_buffer(cdb_observatory._testpoint(), 0.2), 1)::geomval],
|
||||||
|
(SELECT cdb_observatory.OBS_GetMeta(ST_MakeEnvelope(-179, 89, 179, -89, 4326),
|
||||||
|
'[{"geom_id": "us.census.tiger.block_group"},
|
||||||
|
{"numer_id": "us.census.acs.B01003001", "geom_id": "us.census.tiger.block_group", "normalization": "predenom"}]')),
|
||||||
|
FALSE
|
||||||
|
)
|
||||||
|
WHERE data->0->>'geomref' LIKE '36047%'
|
||||||
|
), geoms AS (
|
||||||
|
SELECT *, row_number() OVER () cartodb_id FROM _geoms
|
||||||
|
), samples AS (
|
||||||
|
SELECT COUNT(*) cnt, unnest(ARRAY[1, 2, 3, 5, 10, 25, 50, 100, COUNT(*)]) sample FROM geoms
|
||||||
|
), filtered AS (
|
||||||
|
SELECT * FROM geoms, samples WHERE cartodb_id % (cnt / sample) = 0
|
||||||
|
), summary AS (
|
||||||
|
SELECT sample, ST_SetSRID(ST_Extent(the_geom), 4326) extent,
|
||||||
|
COUNT(*)::INT cnt,
|
||||||
|
ARRAY_AGG((the_geom, cartodb_id)::geomval) geomvals,
|
||||||
|
SUM(ST_Area(the_geom))::Numeric sumarea
|
||||||
|
FROM filtered
|
||||||
|
GROUP BY sample
|
||||||
|
), meta AS (
|
||||||
|
SELECT sample, cdb_observatory.OBS_GetMeta(extent,
|
||||||
|
('[{"numer_id": "us.census.acs.B01003001", "normalization": "predenom", "target_area": ' || sumarea || '}]')::JSON,
|
||||||
|
1, 1, cnt) meta
|
||||||
|
FROM summary
|
||||||
|
GROUP BY sample, extent, cnt, sumarea
|
||||||
|
), results AS (
|
||||||
|
SELECT summary.sample, id, meta->0->>'geom_id' geom_id, (data->0->>'value')::Numeric as val
|
||||||
|
FROM summary, meta, LATERAL cdb_observatory.OBS_GetData(geomvals, meta) data
|
||||||
|
WHERE summary.sample = meta.sample
|
||||||
|
) SELECT
|
||||||
|
BOOL_AND(abs((geoms.total_pop - val) /
|
||||||
|
Coalesce(NullIf(total_pop, 0), 1)) = 0) is True no_bg_point_error
|
||||||
|
FROM geoms, results
|
||||||
|
WHERE cartodb_id = id
|
||||||
|
;
|
||||||
|
|
||||||
|
-- OBS_MetadataValidation
|
||||||
|
|
||||||
|
SELECT * FROM cdb_observatory.OBS_MetadataValidation(NULL, 'ST_Polygon', '[{"numer_id": "us.census.acs.B01003001","denom_id": null,"normalization": "prenormalized","geom_id": null,"numer_timespan": "2010 - 2014"}]'::json, 500);
|
||||||
|
SELECT * FROM cdb_observatory.OBS_MetadataValidation(NULL, 'ST_Polygon', '[{"numer_id": "us.census.acs.B25058001","denom_id": null,"normalization": "denominated","geom_id": null,"numer_timespan": "2010 - 2014"}]'::json, 500);
|
||||||
|
SELECT * FROM cdb_observatory.OBS_MetadataValidation(NULL, 'ST_Polygon', '[{"numer_id": "us.census.acs.B15003001","denom_id": null,"normalization": "denominated","geom_id": null,"numer_timespan": "2010 - 2014"}]'::json, 500);
|
||||||
@@ -0,0 +1,703 @@
|
|||||||
|
\pset format unaligned
|
||||||
|
\set ECHO none
|
||||||
|
SET client_min_messages TO WARNING;
|
||||||
|
|
||||||
|
-- set up variables for use in testing
|
||||||
|
|
||||||
|
\set cartodb_census_tract_geometry ''
|
||||||
|
|
||||||
|
\set cartodb_county_geometry ''
|
||||||
|
|
||||||
|
-- _OBS_SearchTables tests
|
||||||
|
SELECT
|
||||||
|
t.table_name = 'obs_0310c639744a2014bb1af82709228f05b59e7d3d' As _OBS_SearchTables_tables_match,
|
||||||
|
t.timespan = '2015' As _OBS_SearchTables_timespan_matches
|
||||||
|
FROM cdb_observatory._OBS_SearchTables(
|
||||||
|
'us.census.tiger.county',
|
||||||
|
'2015'
|
||||||
|
) As t(table_name, timespan);
|
||||||
|
|
||||||
|
-- _OBS_SearchTables tests
|
||||||
|
-- should not return tables for year that does not match
|
||||||
|
SELECT count(*) = 0 As _OBS_SearchTables_timespan_does_not_match
|
||||||
|
FROM cdb_observatory._OBS_SearchTables(
|
||||||
|
'us.census.tiger.county',
|
||||||
|
'1988' -- year before first tiger data was collected
|
||||||
|
) As t(table_name, timespan);
|
||||||
|
|
||||||
|
SELECT COUNT(*) > 0 AS _OBS_SearchTotalPop
|
||||||
|
FROM cdb_observatory.OBS_Search('total_pop')
|
||||||
|
AS t(id, description, name, aggregate, source);
|
||||||
|
|
||||||
|
SELECT COUNT(*) > 0 AS _OBS_GetAvailableBoundariesExist
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableBoundaries(
|
||||||
|
cdb_observatory._TestPoint()
|
||||||
|
) AS t(boundary_id, description, time_span, tablename);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- OBS_GetAvailableNumerators tests
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators())
|
||||||
|
AS _obs_getavailablenumerators_usa_pop_in_all;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailablenumerators_usa_pop_in_nyc_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakeEnvelope(
|
||||||
|
-169.8046875, 21.289374355860424,
|
||||||
|
-47.4609375, 72.0739114882038
|
||||||
|
), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailablenumerators_usa_pop_in_usa_extents;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(0, 0), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailablenumerators_no_usa_pop_not_in_zero_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ARRAY['subsection/tags.age_gender']
|
||||||
|
))
|
||||||
|
AS _obs_getavailablenumerators_usa_pop_in_age_gender_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ARRAY['subsection/tags.income']
|
||||||
|
))
|
||||||
|
AS _obs_getavailablenumerators_no_pop_in_income_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01001002' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getavailablenumerators_male_pop_denom_by_total_pop;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B19013001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getavailablenumerators_no_income_denom_by_total_pop;
|
||||||
|
|
||||||
|
SELECT 'us.zillow.AllHomes_Zhvi' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'us.census.tiger.zcta5'
|
||||||
|
) WHERE valid_geom = True)
|
||||||
|
AS _obs_getavailablenumerators_zillow_at_zcta5;
|
||||||
|
|
||||||
|
SELECT 'us.zillow.AllHomes_Zhvi' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'us.census.tiger.block_group'
|
||||||
|
) WHERE valid_geom = True)
|
||||||
|
AS _obs_getavailablenumerators_no_zillow_at_block_group;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, '2010 - 2014'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getavailablenumerators_total_pop_2010_2014;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, '1996'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getavailablenumerators_no_total_pop_1996;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- _OBS_GetNumerators tests
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators())
|
||||||
|
AS _obs_getnumerators_usa_pop_in_all;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getnumerators_usa_pop_in_nyc_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakeEnvelope(
|
||||||
|
-169.8046875, 21.289374355860424,
|
||||||
|
-47.4609375, 72.0739114882038
|
||||||
|
), 4326),
|
||||||
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getnumerators_usa_pop_in_usa_extents;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(0, 0), 4326),
|
||||||
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getnumerators_no_usa_pop_not_in_zero_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
subsection_tags => ARRAY['subsection/tags.age_gender']
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_usa_pop_in_age_gender_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
subsection_tags => ARRAY['subsection/tags.income']
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_no_pop_in_income_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01001002' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
denom_id => 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getnumerators_male_pop_denom_by_total_pop;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B19013001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
denom_id => 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getnumerators_no_income_denom_by_total_pop;
|
||||||
|
|
||||||
|
SELECT 'us.zillow.AllHomes_Zhvi' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
geom_id => 'us.census.tiger.zcta5'
|
||||||
|
) WHERE valid_geom = True)
|
||||||
|
AS _obs_getnumerators_zillow_at_zcta5;
|
||||||
|
|
||||||
|
SELECT 'us.zillow.AllHomes_Zhvi' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
geom_id => 'us.census.tiger.block_group'
|
||||||
|
) WHERE valid_geom = True)
|
||||||
|
AS _obs_getnumerators_no_zillow_at_block_group;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
timespan => '2010 - 2014'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getnumerators_total_pop_2010_2014;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
timespan => '1996'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getnumerators_no_total_pop_1996;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
name => 'tot'
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_total_pop_by_name;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
section_tags => '{section/tags.united_states}'
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_total_pop_by_section;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
section_tags => '{section/tags.ca}'
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_total_pop_not_in_canada;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
section_tags => '{section/tags.united_states}',
|
||||||
|
subsection_tags => '{subsection/tags.age_gender}'
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_total_pop_by_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
section_tags => '{section/tags.united_states}',
|
||||||
|
subsection_tags => '{subsection/tags.employment}'
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_total_pop_not_in_employment_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ids => '{us.census.acs.B01003001}'
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_total_pop_by_id;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT numer_id
|
||||||
|
FROM cdb_observatory._OBS_GetNumerators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ids => '{us.census.acs.B01003002}'
|
||||||
|
))
|
||||||
|
AS _obs_getnumerators_total_pop_not_with_other_id;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- OBS_GetAvailableDenominators tests
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators())
|
||||||
|
AS _obs_getavailabledenominators_usa_pop_in_all;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailabledenominators_usa_pop_in_nyc_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakeEnvelope(
|
||||||
|
-169.8046875, 21.289374355860424,
|
||||||
|
-47.4609375, 72.0739114882038
|
||||||
|
), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailabledenominators_usa_pop_in_usa_extents;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(0, 0), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailabledenominators_no_usa_pop_not_in_zero_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ARRAY['subsection/tags.age_gender']
|
||||||
|
))
|
||||||
|
AS _obs_getavailabledenominators_usa_pop_in_age_gender_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ARRAY['subsection/tags.income']
|
||||||
|
))
|
||||||
|
AS _obs_getavailabledenominators_no_pop_in_income_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'us.census.acs.B01001002'
|
||||||
|
) WHERE valid_numer = True)
|
||||||
|
AS _obs_getavailabledenominators_male_pop_denom_by_total_pop;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'us.census.acs.B19013001'
|
||||||
|
) WHERE valid_numer = True)
|
||||||
|
AS _obs_getavailabledenominators_no_income_denom_by_total_pop;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'us.census.tiger.zcta5'
|
||||||
|
) WHERE valid_geom = True)
|
||||||
|
AS _obs_getavailabledenominators_at_zcta5;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'es.ine.the_geom'
|
||||||
|
) WHERE valid_geom = True)
|
||||||
|
AS _obs_getavailabledenominators_none_spanish_geom;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, '2010 - 2014'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getavailabledenominators_total_pop_2010_2014;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' NOT IN (SELECT denom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableDenominators(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, '1996'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getavailabledenominators_no_total_pop_1996;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- OBS_GetAvailableGeometries tests
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries())
|
||||||
|
AS _obs_getavailablegeometries_usa_bg_in_all;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailablegeometries_usa_bg_in_nyc_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakeEnvelope(
|
||||||
|
-169.8046875, 21.289374355860424,
|
||||||
|
-47.4609375, 72.0739114882038
|
||||||
|
), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailablegeometries_usa_bg_in_usa_extents;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' NOT IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(0, 0), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailablegeometries_no_usa_bg_not_in_zero_point;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ARRAY['subsection/tags.boundary']
|
||||||
|
))
|
||||||
|
AS _obs_getavailablegeometries_usa_bg_in_boundary_subsection;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' NOT IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
ARRAY['section/tags.uk']
|
||||||
|
))
|
||||||
|
AS _obs_getavailablegeometries_no_bg_in_uk_section;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_numer = True)
|
||||||
|
AS _obs_getavailablegeometries_total_pop_in_usa_bg;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' NOT IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'foo.bar.baz'
|
||||||
|
) WHERE valid_numer = True)
|
||||||
|
AS _obs_getavailablegeometries_foobarbaz_not_in_usa_bg;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getavailablegeometries_total_pop_denom_in_usa_bg;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' NOT IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'foo.bar.baz'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getavailablegeometries_foobarbaz_denom_not_in_usa_bg;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, '2015'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getavailablegeometries_bg_2015;
|
||||||
|
|
||||||
|
SELECT 'us.census.tiger.block_group' NOT IN (SELECT geom_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, '1996'
|
||||||
|
) WHERE valid_timespan = True)
|
||||||
|
AS _obs_getavailablegeometries_bg_not_1996;
|
||||||
|
|
||||||
|
SELECT 'subsection/tags.boundary' IN (SELECT (Jsonb_Each(geom_tags)).key
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableGeometries(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)
|
||||||
|
)) AS _obs_getavailablegeometries_has_boundary_tag;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- OBS_GetAvailableTimespans tests
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans())
|
||||||
|
AS _obs_getavailabletimespans_2010_2014_in_all;
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailabletimespans_2010_2014_in_nyc_point;
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
ST_SetSRID(ST_MakeEnvelope(
|
||||||
|
-169.8046875, 21.289374355860424,
|
||||||
|
-47.4609375, 72.0739114882038
|
||||||
|
), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailabletimespans_2010_2014_in_usa_extents;
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' NOT IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
ST_SetSRID(ST_MakePoint(0, 0), 4326),
|
||||||
|
NULL, NULL, NULL, NULL
|
||||||
|
)) AS _obs_getavailabletimespans_no_usa_bg_not_in_zero_point;
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_numer = True)
|
||||||
|
AS _obs_getavailabletimespans_total_pop_in_2010_2014;
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' NOT IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, 'foo.bar.baz'
|
||||||
|
) WHERE valid_numer = True)
|
||||||
|
AS _obs_getavailabletimespans_foobarbaz_not_in_2010_2014;
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'us.census.acs.B01003001'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getavailablegeometries_total_pop_denom_in_2010_2014;
|
||||||
|
|
||||||
|
SELECT '2010 - 2014' NOT IN (SELECT timespan_id
|
||||||
|
FROM cdb_observatory.OBS_GetAvailableTimespans(
|
||||||
|
ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326),
|
||||||
|
NULL, NULL, 'foo.bar.baz'
|
||||||
|
) WHERE valid_denom = True)
|
||||||
|
AS _obs_getavailablegeometries_foobarbaz_denom_not_in_2010_2014;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- _OBS_GetGeometryScores tests
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC) =
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.county', 'us.census.tiger.zcta5']
|
||||||
|
AS _obs_geometryscores_500m_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 500)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.county', 'us.census.tiger.zcta5'])
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC)
|
||||||
|
= ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county']
|
||||||
|
AS _obs_geometryscores_5km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 5000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.county', 'us.census.tiger.zcta5'])
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC) =
|
||||||
|
ARRAY['us.census.tiger.census_tract', 'us.census.tiger.block_group',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county']
|
||||||
|
AS _obs_geometryscores_50km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 50000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'])
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC) =
|
||||||
|
ARRAY[ 'us.census.tiger.zcta5', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.county', 'us.census.tiger.block_group' ]
|
||||||
|
AS _obs_geometryscores_500km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 500000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'])
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC)
|
||||||
|
= ARRAY['us.census.tiger.county', 'us.census.tiger.zcta5',
|
||||||
|
'us.census.tiger.census_tract', 'us.census.tiger.block_group']
|
||||||
|
AS _obs_geometryscores_2500km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 2500000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.county', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.block_group'])
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT column_id, numgeoms::int AS _obs_geometryscores_numgeoms_500m_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 500)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'])
|
||||||
|
WHERE table_id LIKE '%2015%'
|
||||||
|
ORDER BY numgeoms DESC;
|
||||||
|
|
||||||
|
SELECT column_id, numgeoms::int AS _obs_geometryscores_numgeoms_5km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 5000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'])
|
||||||
|
WHERE table_id LIKE '%2015%'
|
||||||
|
ORDER BY numgeoms DESC;
|
||||||
|
|
||||||
|
SELECT column_id, numgeoms::int AS _obs_geometryscores_numgeoms_50km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 50000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'])
|
||||||
|
WHERE table_id LIKE '%2015%'
|
||||||
|
ORDER BY numgeoms DESC;
|
||||||
|
|
||||||
|
SELECT column_id, numgeoms::int AS _obs_geometryscores_numgeoms_500km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 500000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'])
|
||||||
|
WHERE table_id LIKE '%2015%'
|
||||||
|
ORDER BY numgeoms DESC;
|
||||||
|
|
||||||
|
SELECT column_id, numgeoms::int AS _obs_geometryscores_numgeoms_2500km_buffer
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 2500000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'])
|
||||||
|
WHERE table_id LIKE '%2015%'
|
||||||
|
ORDER BY numgeoms DESC;
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC) =
|
||||||
|
ARRAY['us.census.tiger.county', 'us.census.tiger.zcta5',
|
||||||
|
'us.census.tiger.census_tract', 'us.census.tiger.block_group']
|
||||||
|
AS _obs_geometryscores_500km_buffer_50_geoms
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 50000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'], 50)
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC)
|
||||||
|
= ARRAY['us.census.tiger.zcta5', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.block_group', 'us.census.tiger.county']
|
||||||
|
AS _obs_geometryscores_500km_buffer_500_geoms
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 50000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'], 500)
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC) =
|
||||||
|
ARRAY['us.census.tiger.census_tract', 'us.census.tiger.block_group',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county']
|
||||||
|
AS _obs_geometryscores_500km_buffer_2500_geoms
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 50000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'], 2500)
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
SELECT ARRAY_AGG(column_id ORDER BY score DESC)
|
||||||
|
= ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county']
|
||||||
|
AS _obs_geometryscores_500km_buffer_25000_geoms
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
ST_Buffer(ST_SetSRID(ST_MakePoint(-73.9, 40.7), 4326)::Geography, 50000)::Geometry(Geometry, 4326),
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'], 25000)
|
||||||
|
WHERE table_id LIKE '%2015%';
|
||||||
|
|
||||||
|
-- Check that one small geom approximates tract data
|
||||||
|
WITH geoms AS (SELECT cdb_observatory._testarea() the_geom),
|
||||||
|
summary AS (SELECT ST_SetSRID(ST_Extent(the_geom), 4326) extent,
|
||||||
|
COUNT(*)::INT cnt,
|
||||||
|
SUM(ST_Area(the_geom))::Numeric sumarea
|
||||||
|
FROM geoms)
|
||||||
|
SELECT column_id = 'us.census.tiger.census_tract' testarea_uses_tract
|
||||||
|
FROM summary, LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM cdb_observatory._OBS_GetGeometryScores(extent,
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'],
|
||||||
|
cnt, sumarea)) foo
|
||||||
|
ORDER BY score DESC LIMIT 1;
|
||||||
|
|
||||||
|
-- Check that randomly distributed points always use smallest geometry if we
|
||||||
|
-- order by numgeoms desc
|
||||||
|
WITH geoms as (SELECT UNNEST(ARRAY[
|
||||||
|
cdb_observatory._testpoint(),
|
||||||
|
st_translate(cdb_observatory._testpoint(), -0.003, 0),
|
||||||
|
st_translate(cdb_observatory._testpoint(), -0.006, 0)
|
||||||
|
]) the_geom),
|
||||||
|
summary as (SELECT
|
||||||
|
ST_SetSRID(ST_Extent(the_geom), 4326) extent,
|
||||||
|
SUM(ST_Area(the_geom))::Numeric area,
|
||||||
|
COUNT(*)::INTEGER cnt
|
||||||
|
FROM geoms
|
||||||
|
)
|
||||||
|
SELECT column_id = 'us.census.tiger.block_group' points_use_bg
|
||||||
|
FROM summary, LATERAL (
|
||||||
|
SELECT * FROM cdb_observatory._OBS_GetGeometryScores(
|
||||||
|
extent,
|
||||||
|
ARRAY['us.census.tiger.block_group', 'us.census.tiger.census_tract',
|
||||||
|
'us.census.tiger.zcta5', 'us.census.tiger.county'],
|
||||||
|
cnt, area)) foo
|
||||||
|
WHERE table_id LIKE '%2015%'
|
||||||
|
ORDER BY numgeoms DESC LIMIT 1;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- OBS_LegacyBuilderMetadata tests
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT
|
||||||
|
(jsonb_array_elements(((jsonb_array_elements(subsection))->'f1')->'columns')->'f1')->>'id' AS id
|
||||||
|
FROM cdb_observatory.OBS_LegacyBuilderMetadata()
|
||||||
|
) AS _total_pop_in_legacy_builder_metadata;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B19013001' IN (SELECT
|
||||||
|
(jsonb_array_elements(((jsonb_array_elements(subsection))->'f1')->'columns')->'f1')->>'id' AS id
|
||||||
|
FROM cdb_observatory.OBS_LegacyBuilderMetadata()
|
||||||
|
) AS _median_income_in_legacy_builder_metadata;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B19083001' IN (SELECT
|
||||||
|
(jsonb_array_elements(((jsonb_array_elements(subsection))->'f1')->'columns')->'f1')->>'id' AS id
|
||||||
|
FROM cdb_observatory.OBS_LegacyBuilderMetadata()
|
||||||
|
) AS _gini_in_legacy_builder_metadata;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B01003001' IN (SELECT
|
||||||
|
(jsonb_array_elements(((jsonb_array_elements(subsection))->'f1')->'columns')->'f1')->>'id' AS id
|
||||||
|
FROM cdb_observatory.OBS_LegacyBuilderMetadata('sum')
|
||||||
|
) AS _total_pop_in_legacy_builder_metadata_sums;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B19013001' IN (SELECT
|
||||||
|
(jsonb_array_elements(((jsonb_array_elements(subsection))->'f1')->'columns')->'f1')->>'id' AS id
|
||||||
|
FROM cdb_observatory.OBS_LegacyBuilderMetadata('sum')
|
||||||
|
) AS _median_income_in_legacy_builder_metadata_sums;
|
||||||
|
|
||||||
|
SELECT 'us.census.acs.B19083001' NOT IN (SELECT
|
||||||
|
(jsonb_array_elements(((jsonb_array_elements(subsection))->'f1')->'columns')->'f1')->>'id' AS id
|
||||||
|
FROM cdb_observatory.OBS_LegacyBuilderMetadata('sum')
|
||||||
|
) AS _gini_not_in_legacy_builder_metadata_sums;
|
||||||
|
|
||||||
|
SELECT COUNT(*) = 0 _no_dupe_subsections_in_legacy_builder_metadata FROM (
|
||||||
|
SELECT name, subsection, count(*) FROM
|
||||||
|
(SELECT name, ((JSONB_Array_Elements(subsection))->'f1')->>'id' subsection
|
||||||
|
FROM cdb_observatory.obs_legacybuildermetadata()) foo
|
||||||
|
GROUP BY name, subsection
|
||||||
|
HAVING count(*) > 1
|
||||||
|
) bar;
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user