Skip to content

Instantly share code, notes, and snippets.

@soiqualang
Last active August 7, 2019 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soiqualang/2e8c577bdd65de43e1e4c6618748c318 to your computer and use it in GitHub Desktop.
Save soiqualang/2e8c577bdd65de43e1e4c6618748c318 to your computer and use it in GitHub Desktop.
[sql] ghep bang - UNION ALL #sql #UNION #ghep_bang
SELECT hientrang_cong.name,
replace(replace(replace((''::text || box2d(st_transform(hientrang_cong.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM hientrang_cong
UNION ALL
SELECT hientrang_dap.name,
replace(replace(replace((''::text || box2d(st_transform(hientrang_dap.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM hientrang_dap
UNION ALL
SELECT hientrang_debao.name,
replace(replace(replace((''::text || box2d(st_transform(hientrang_debao.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM hientrang_debao
UNION ALL
SELECT quyhoach_cong_authuyen.name,
replace(replace(replace((''::text || box2d(st_transform(quyhoach_cong_authuyen.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM quyhoach_cong_authuyen
UNION ALL
SELECT quyhoach_debao.name,
replace(replace(replace((''::text || box2d(st_transform(quyhoach_debao.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM quyhoach_debao
UNION ALL
SELECT quyhoach_trambom.name,
replace(replace(replace((''::text || box2d(st_transform(quyhoach_trambom.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox
FROM quyhoach_trambom;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment