-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxx_testing.sql
70 lines (48 loc) · 1.54 KB
/
xx_testing.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
select count(*)
from admin_bdys_202411.abs_2021_sa2;
select *
from gnaf_202411.boundary_concordance
where from_bdy = 'postcode'
and to_bdy = 'poa';
select *
from admin_bdys_202411.abs_2016_sa1;
select *
from gnaf_202411.address_principal_census_2016_boundaries;
select *
from census_2021_bdys_gda94.mb_2021_aust_gda94;
-- test getting centroids for bdy overlaps
select *,
st_centroid(st_intersection(from_bdy.geom, to_bdy.geom)) as geom
from census_2016_bdys.sa2_2016_aust as from_bdy
inner join census_2016_bdys.lga_2016_aust as to_bdy on st_intersects(from_bdy.geom, to_bdy.geom)
;
select *
from gnaf_202411;
select *
from admin_bdys_202411.abs_2016_mb as adm
full outer join census_2016_bdys.mb_2016_aust as abs on adm.mb_16code::text = abs.mb_code16
where not st_equals(adm.geom, abs.geom)
;
select *
from census_2016_bdys.poa_2016_aust
where poa_code16 in ('POA2050', 'POA2042')
;
select from_id as postcode,
to_id as lga_id,
to_name as lga_name,
address_count,
address_percent
from gnaf_202411.boundary_concordance
where from_bdy = 'postcode'
and to_source = 'abs 2016'
and to_bdy = 'lga'
and from_id in ('2050', '2042')
;
-- test table for concordance preso
drop table if exists testing.temp_mb;
create table testing.temp_mb as
select mb.*
from admin_bdys_202411.abs_2021_mb as mb
inner join admin_bdys_202411.postcode_bdys as pc on st_intersects(mb.geom, pc.geom)
-- inner join admin_bdys_202411.postcode_bdys as pc on st_intersects(st_centroid(mb.geom), pc.geom)
and postcode in ('2050', '2042');