Errata

Python for Geospatial Data Analysis

Errata for Python for Geospatial Data Analysis

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Page Ch. 2, "Visualizing Environmental Complaints in New York"
Paragraph 1

The paragraph has a hyperlink attached to the sentence "This particular dataset can be downloaded from the GitHub repository accompanying this book."

The URL redirects to the following no-longer-functioning repository and repository entry.
github.com/datamongerbonny/Python-for-geospatial-analysis/blob/main/DOHMH_Indoor_Environmental_Complaints.csv

The same broken URL is present in the Chapter 4 Section "Leafmap: An Alternative to Google Earth Engine" in Paragraph 3 of the section, and vitally, the initial appearance of the broken URL is pointed to in the book's index entry "Github Repository for this book", returning the reader back to the first appearance in the Ch. 2, "Visualizing Environmental Complaints in New York" section.

Note from the Author or Editor:
This is available here:
github.com/datamongerbonny/SQL-for-Geospatial/blob/main/DOHMH_Indoor_Environmental_Complaints.csv

We will update the links in the book. Thanks!

Anonymous  Dec 02, 2022  Dec 06, 2022
Printed
Page p.65
Code in figure--pointed out by Japanese translation

Q3. [P.65] For database with 110m resolution, I couldn't find any city near amazon river. When I used 10m resolution map instead of 110m, I get good result as shown in fig3-22.png.

rivers = '{}|layername=ne_110m_rivers_lake_centerlines'.format(my_gpkg)
places ='{}|layername=ne_110m_populated_places'.format(my_gpkg)

are replaced with,

rivers = '{}|layername=ne_10m_rivers_lake_centerlines'.format(my_gpkg)
places ='{}|layername=ne_10m_populated_places'.format(my_gpkg)

Bonny McClain
Bonny McClain
 
Dec 15, 2022 
PDF
Page page 117
Last paragraph

Working with QuickOSM in QGIS
You got acquainted with QGIS in Chapter 3, and I want to point out briefly that you can also use QGIS to interact with OSM data. QuickOSM in QGIS works similarly within a GUI.

[[Asking the reader to download the plug-in appears to be missing:]]
Navigate to the plug-in menu and download the Quick OSM plug-in.




Open QGIS and select Vector in the toolbar, and you will see a “Quick query” option for Quick OSM (Figure 5-18). QuickOSM allows you to run these quick queries in the console and display results directly on a canvas.
Getting access to the level of data in GIS format within QGIS allows you to select a variety of amenities to include in a single map layer. This is an opportunity to explore key:value relationships outside of a Notebook as your data questions grow in scope.

Bonny McClain
Bonny McClain
 
Dec 15, 2022 
Printed
Page page 181
second paragraph

This is stated:

GeoPandas is a Cartesian coordinate reference system, which means that each point is defined by a pair of numerical coordinates, such as latitude and longitude in our example.

It should be corrected to this:

GeoPandas is a Cartesian coordinate reference system, which means that each point is defined by a horizontal x-axis and a vertical y-axis on a planar surface.

Bonny McClain
Bonny McClain
 
Dec 18, 2022 
PDF
Page 173
figure 8-5

This current code should run above the figure 8-5:

size, scale = 1000, 10
Complaints = pd.Series(np.random.gamma(scale, size=size) ** 1.5)
Complaints.plot.hist(grid=True, bins=20, rwidth=0.9, color='#607c8e')
plt.title('Distribution of Complaint Types')
plt.xlabel('CMPLNT_NUM')
plt.ylabel('OFNS_DESC')
plt.grid(axis='y', alpha=0.75)size, scale = 1000, 10
Complaints = pd.Series(np.random.gamma(scale, size=size) ** 1.5)

[[new text]]
If instead of running a random sample (np.random.gamma()), we run a sample from the dataset, you will generate the outcome in figure 8-5a.

size, scale = 1000, 10
Complaints = pd.Series(df['CMPLNT_NUM'], df['PD_CD'])
Complaints.plot.hist(grid=True, bins=10, rwidth=0.9,
color='#607c8e')
plt.title('Distribution of Complaint Types')
plt.xlabel('CMPLNT_NUM')
plt.ylabel('PD_CD')
plt.grid(axis='y', alpha=0.75)


The visualization now does not yield a pattern in the distribution of complaint types (Figure 8-5a).

The updated figure will be sent directly...

Bonny McClain
Bonny McClain
 
Jan 11, 2023