Created
November 17, 2016 14:50
-
-
Save mtravis/ee372b42f0db5a8292b1bc8206133447 to your computer and use it in GitHub Desktop.
Creates a SQL statement that will output the total area of each layer in a PostGIS database
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
Select 'Select ''' || quote_ident(f_table_name) || ''' as name, Sum((ST_Area(' || quote_ident(f_geometry_column) || ')) from ' | |
|| quote_ident(f_table_schema) || '.' || quote_ident(f_table_name) || ' UNION' | |
FROM geometry_columns | |
order by f_table_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment