12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>256 / 310ExamplesSELECT Find_SRID(’public’, ’tiger_us_state_2007’, ’the_geom_4269’);find_srid----------4269See AlsoST_SRID7.12.9 ST_Mem_SizeST_Mem_Size — Returns the amount of space (in bytes) the geometry takes.Synopsisinteger ST_Mem_Size(geometry geomA);DescriptionReturns the amount of space (in bytes) the geometry takes.This is a nice compliment to PostgreSQL built in functions pg_size_pretty, pg_relation_size, pg_total_relation_size.Notepg_relation_size which gives the byte size of a table may return byte size lower than ST_Mem_Size. This is becausepg_relation_size does not add toasted table contribution and large geometries are stored in TOAST tables.pg_total_relation_size - includes, the table, the toasted tables, and the indexes.This function supports 3d and will not drop the z-index.This method supports Circular Strings and CurvesExamples--Return how much byte space Boston takes up in our Mass data setSELECT pg_size_pretty(SUM(ST_Mem_Size(the_geom))) as totgeomsum,pg_size_pretty(SUM(CASE WHEN town = ’BOSTON’ THEN st_mem_size(the_geom) ELSE 0 END)) Asbossum,CAST(SUM(CASE WHEN town = ’BOSTON’ THEN st_mem_size(the_geom) ELSE 0 END)*1.00 /SUM(st_mem_size(the_geom))*100 As numeric(10,2)) As perbosFROM towns;←↪totgeomsum bossum perbos---------- ------ ------1522 kB 30 kB 1.99SELECT ST_Mem_Size(ST_GeomFromText(’CIRCULARSTRING(220268 150415,220227 150505,220227150406)’));←↪

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!