Last active
August 29, 2015 14:17
-
-
Save javisantana/37ddfe3a410a347a2a68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_postgis=# select count(*) from sigpac_47_valladolid_parfe; | |
count | |
-------- | |
342691 | |
test_postgis=# select sum(st_memsize(the_geom_webmercator)) from sigpac_47_valladolid_parfe; | |
sum | |
----------- | |
254827296 | |
(1 row) | |
test_postgis=# copy ( | |
with a as ( | |
select CDB_XYZ_resolution(0) as res, ceil(log(CDB_XYZ_resolution(0)))::int as decimals | |
) | |
select ST_AsTWKB( | |
ST_ClipByBox2d( | |
st_snaptogrid(the_geom_webmercator, res/10, res/10), | |
CDB_XYZ_Extent(0, 0, 0) | |
), | |
decimals | |
) from sigpac_47_valladolid_parfe, a) to '/tmp/tile.test.bin'; | |
➜ postgis git:(quadtree) ✗ ls -lh /tmp/tile.test.bin | |
-rw-r--r-- 1 j wheel 3.3M Mar 14 10:19 /tmp/tile.test.bin | |
➜ postgis git:(quadtree) ✗ ls -lh /tmp/tile.test.bin | |
-rw-r--r-- 1 j wheel 3.3M Mar 14 10:19 /tmp/tile.test.bin | |
➜ postgis git:(quadtree) ✗ gzip /tmp/tile.test.bin | |
➜ postgis git:(quadtree) ✗ ls -lh /tmp/tile.test.bin.gz | |
-rw-r--r-- 1 j wheel 17K Mar 14 10:19 /tmp/tile.test.bin.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with a as ( | |
select CDB_XYZ_resolution(0) as res, ceil(log(CDB_XYZ_resolution(0)))::int as decimals | |
) | |
select ST_AsTWKB( | |
ST_ClipByBox2d( | |
st_snaptogrid(the_geom_webmercator, res/10, res/10), | |
CDB_XYZ_Extent(0, 0, 0) | |
), | |
decimals | |
) from sigpac_47_valladolid_parfe, a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment