Skip to Content
Mastering Geospatial Analysis with Python
book

Mastering Geospatial Analysis with Python

by Silas Toms, Paul Crickard, Eric van Rees
April 2018
Beginner to intermediate content levelBeginner to intermediate
440 pages
11h 36m
English
Packt Publishing
Content preview from Mastering Geospatial Analysis with Python

Creating a graduated color visualization

This code will manually assign colors to specific sections of the data, breaking the data into categories. This also assigns specific radius sizes to data so that the visualization will convey information with both color and circle size:

color_stops = [    [0.0, 'rgb(107,174,214)'],    [3000.0, 'rgb(116,196,118)'],    [8000.0, 'rgb(254,153,41)'],    [max(tract_points['Total Population']), 'rgb(222,45,38)'], ]minmax = [min(tract_points['Percent Male']),          max(tract_points['Percent Male'])]diff = minmax[1] - minmax[0]radius_stops = [    [round(minmax[0],2), 4.0],    [round(minmax[0]+(diff/6.0),2), 7.0],    [round(minmax[1]-(diff/2.0),2), 10.0],    [minmax[1], 15.0],]

With these radius sizes and color ranges set, they can be applied ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Geospatial Analysis with Python

Learning Geospatial Analysis with Python

Joel Lawhead

Publisher Resources

ISBN: 9781788293334Supplemental Content