|
On 11/07/2012 03:34,
[email protected] wrote:
This kind of aggregate job is probably best done right in a database. You can import both vectors into a spatialite database, add a column for the population in the post_codes table, then run a SUM query such as:I need to estimate the population of post codes by doing an areal overlay with smaller census tracts over the postal codes.How is this done in QGIS? .loadshp 'post codes' post_codes LATIN1 <your coordinate system SRID> ; .loadshp 'census_tracts' census_tracts LATIN1 <coordinate SRID> ; ALTER TABLE post_codes ADD COLUMN population integer; UPDATE post_codes SET population=SUM(census_tracts.population) WHERE Intersects(post_codes.Geometry, census_tracts.Geometry) GROUP BY post_codes.zip; If you have a large number of census tracts, you'll most likely want to add a Spatial Index and use it in the query to speed things up. HTH, Micha Thanks - R Hoskins Anchorage, AK _______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user This mail was received via Mail-SeCure System. -- Micha Silver 052-3665918 |
_______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
