SQL Query for population values by grid point

Bug #954852 reported by Paul Henshaw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Undecided
Paul Henshaw

Bug Description

Experimenting with SQL query to create a GeoTIFF from GED population data for a given region.

SELECT
 point.lat, point.lon, pop.pop_value, att.is_urban
INTO
 gem.pop_vals_ita
FROM
 eqged.grid_point point
JOIN
 eqged.population pop
 ON point.id=pop.grid_point_id
JOIN
 eqged.grid_point_country country
 ON country.grid_point_id=point.id
JOIN
 eqged.grid_point_attribute att
 ON att.grid_point_id=point.id
WHERE
 country.gadm_country_id=112
AND
 pop.population_src_id=5;

For four countries:
 MAC 137 (Macao)
 LUX 135
 ITA = 112
 JPN = 116

Revision history for this message
Paul Henshaw (paul-sl-henshaw) wrote :
Revision history for this message
Ben Wyss (bmwyss) wrote :

149591.609375

This is the maximum value for eqged.population.pop_value

description: updated
Revision history for this message
Ben Wyss (bmwyss) wrote :

and the scale for rural should be from 0 to 17052

Revision history for this message
Paul Henshaw (paul-sl-henshaw) wrote :

I have also added Switzerland in gem.pop_vals_che (gadm_country_id =188)

Revision history for this message
Paul Henshaw (paul-sl-henshaw) wrote :

I have also added Australia gem.pop_vals_aus (gadm_country_id=16)

Changed in openquake:
assignee: nobody → Paul Henshaw (paul-sl-henshaw)
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.