Population geoprocessing

1555
4
Jump to solution
11-07-2013 01:47 AM
by Anonymous User
Not applicable
Original User: M.P.N.Mark_RUG

Good day all,

i have a question about the dissolving of polygons into new polygons, based on a 'more than x inhabitants' selection.
So, my data is a 500m grid polygon with attributes which tell me the inhabitants of that specific polygon for the year 2000 to 2012 (in different fields).

My first step is to select the polygon which have more than 100 inhabitants. This data will be used to create the new polygons. My first thought was to make a model based on the following idea:

Select by attributes -> Inhabitants > 100.
Export selected data
Dissolve the polygons in one polygon if they are connected and add all the attributes from the 2012 inhabitants field into one field if applicable.
So you will get a new polygon based on 100 or more inhabitants with the attributes from the year I choose.

However, when I try the dissolve tool, I still get the same results as the select by attributes.
I think I overlooked something, but I don't know what. In what way can I create polygons based on attributes and also calculates the attributes into one new attribute? Do I have to write a python script?

Thanks in advance,

Mark
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: xander_bakker

Hi Mark,

What you can do is follow these steps:

You can select by attribute those polygons with a population > 100. There is no need to export this to a new feature class, since geoprocessing tool use selected data.

[ATTACH=CONFIG]28952[/ATTACH]

Make sure you have a field on which you would like to dissolve. So add a new field (like "diss") and assign it the value 1 (any value will do). Open the Dissolve tool and specify the following things:

[ATTACH=CONFIG]28953[/ATTACH]

Dissolve field is the field ("diss") that only has a single value. You can add statistics like the sum of the population, and uncheck the Create multipart, so only connected polygons will be merged into a single polygon.

What you will notice is that the summed population in the output has summed the population for all the output polygons. This is due to the fact that the "diss" field only has 1 single value and doesn't distinguish between the merged polygons.

In order to get this right you can join (based on location) the dissolved polygons to the original polygons, like this:

[ATTACH=CONFIG]28954[/ATTACH]

The result will be that the original grids (or in fact the copy of the original grids) are enriched with the data from the dissolved polygons. Since the dissolved polygons have a OBJECTID that is unique for each merged polygon, you can now dissolve the polygons again, using the OBJECTID from the dissolved polygons and calculation the SUM of the original population:

[ATTACH=CONFIG]28957[/ATTACH]

The result will have the dissolved polygons with the correctly summed population for each dissolved polygon.

[ATTACH=CONFIG]28958[/ATTACH]

Kind regards,

Xander

View solution in original post

0 Kudos
4 Replies
by Anonymous User
Not applicable
Original User: xander_bakker

Hi Mark,

What you can do is follow these steps:

You can select by attribute those polygons with a population > 100. There is no need to export this to a new feature class, since geoprocessing tool use selected data.

[ATTACH=CONFIG]28952[/ATTACH]

Make sure you have a field on which you would like to dissolve. So add a new field (like "diss") and assign it the value 1 (any value will do). Open the Dissolve tool and specify the following things:

[ATTACH=CONFIG]28953[/ATTACH]

Dissolve field is the field ("diss") that only has a single value. You can add statistics like the sum of the population, and uncheck the Create multipart, so only connected polygons will be merged into a single polygon.

What you will notice is that the summed population in the output has summed the population for all the output polygons. This is due to the fact that the "diss" field only has 1 single value and doesn't distinguish between the merged polygons.

In order to get this right you can join (based on location) the dissolved polygons to the original polygons, like this:

[ATTACH=CONFIG]28954[/ATTACH]

The result will be that the original grids (or in fact the copy of the original grids) are enriched with the data from the dissolved polygons. Since the dissolved polygons have a OBJECTID that is unique for each merged polygon, you can now dissolve the polygons again, using the OBJECTID from the dissolved polygons and calculation the SUM of the original population:

[ATTACH=CONFIG]28957[/ATTACH]

The result will have the dissolved polygons with the correctly summed population for each dissolved polygon.

[ATTACH=CONFIG]28958[/ATTACH]

Kind regards,

Xander
0 Kudos
by Anonymous User
Not applicable
Original User: M.P.N.Mark_RUG

Thank you! This is exactly what I was looking for! I knew I missed something and that was the join based on location and after that another Dissolve!

Again: thank you!
0 Kudos
by Anonymous User
Not applicable
Original User: M.P.N.Mark_RUG

Dear Xander (and others),

It works perfectly when I perform this manually. I would like to automate the sequences for multiple years. So I made a model. Everything works perfectly, until the last step. The calculation doesn't work properly. The SUM is not the 2012, but a negative number.
Could you help me solve this?
0 Kudos
XanderBakker
Esri Esteemed Contributor
Hi Mark,

Personally I don't like models, but if you are willing to export the model to a Python script (Model\Export\To Python script) and post this using the "#" button to wrap "CODE" tags arround the code, I can have a look what may be going wrong.

And when you say that the last year produces a negative number, this may have to do with Null values. For that I would need to see (part of) the data.

Kind regards,

Xander
0 Kudos