[Qgis-user] sorting a density field column (was: Re: AREA ATTRIBUTE FOR VECTOR LAYER)

Erik Josefsson erik.hjalmar.josefsson at gmail.com
Thu Aug 17 23:04:07 PDT 2017


On 17/08/17 22:41, Christine wrote:
> if you want to get a density of school points in each polygon, you may
> calculate this in the field calculator. 
> Assure, you are working in a projected coordinate sytem. Open attribute
> table and choose 'open field calculator'. With the field calculator dialog
> open, give a name to a new attribute for school density, choose an
> appropriate output field type (probably decimal number, real), output field
> length and precision and use an expression pattern like 
>  <name of attribute of points count>  / $area 

Thanks Christine! That solved my problem too :-)

I have 136 polygons, or rather city sub-areas, with data on different
kinds of densities (e.g. density of schools, density of churches and
density of pizzerias).

I would like to create a field with the field calculator, for each kind
of density, that preserves the order of the polygons: the sub-area with
the most pizzerias per square meter gets number one, the second densest
sub-area the number two, etc...

There should be a smarter way to do that then manually sorting a density
field column, then create a new "density order"-field, and then typing
in 1, 2, 3, ... , 134, 135, 136 from the top to the bottom (and then
repeat that procedure for each kind of density!).

Grateful for advice!

Best regards.

//Erik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 533 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170818/1a99cd5c/attachment.sig>


More information about the Qgis-user mailing list