• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 6 pages
Exam (elaborations)

PYTHON D522 Geocomputation with Python Chapman and Hall CRC The Python Series-25.pdf latest update with complete solutions 100 % correct & verified

Document preview thumbnail
Preview 2 out of 6 pages

PYTHON D522 Geocomputation with Python Chapman and Hall CRC The Python S latest update with complete solutions 100 % correct & verified

Content preview

geometry id population
149 POLYGON ((1990143 158 NaN
4848536, 2090…

Figure 3.14 shows the final result grid with the incongruently-joined population
attribute from nz.


base = grid.plot(
column='population',
edgecolor='black',
legend=True,
cmap='Reds'
);
nz.plot(ax=base, color='none', edgecolor='grey', legend=True);

, Figure 3.14: The nz layer and a regular grid of rectangles: final result


We can demonstrate that, expectedly, the summed population in nz and grid is
identical, even though the geometry is different (since we created grid to completely
cover nz), by comparing the .sum of the population attribute in both layers.


nz['Population'].sum()




np.float64(4787200.0)



grid['population'].sum()




np.float64(4787199.999999998)

The procedure in this section is known as an area-weighted interpolation of a
spatially extensive (e.g., population) variable. In extensive interpolation, we assume
that the variable of interest represents counts (such as, here, inhabitants) uniformly
distributed across space. In such case, each part of a given polygon captures the
respective proportion of counts (such as, half of a region with N inhabitants contains
N/2 inhabitants). Accordingly, summing the parts gives the total count of the total
area.

An area-weighted interpolation of a spatially intensive variable (e.g., population
density) is almost identical, except that we would have to calculate the weighted
.mean rather than .sum, to preserve the average rather than the sum. In intensive
interpolation, we assume that the variable of interest represents counts per unit area,
i.e., density. Since density is (assumed to be) uniform, any part of a given polygon
has exactly the same density as that of the whole polygon. Density values are
therefore computed as weighted averages, rather than sums, of the parts. Also, see the
‘Area-weighted interpolation’ section in Pebesma and Bivand (2023).

Document information

Uploaded on
August 29, 2026
Number of pages
6
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Brainarium
3.8
(342)
Sold
2080
Followers
1049
Items
24593
Last sold
15 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions