Degree of Urbanization
The Degree of Urbanization (DoU) is a method for quantifying urbanization using thresholds applied to gridded population data. More information on the DoU can be found here.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 9
6 import pandas as pd
8 import GOSTurban.UrbanRaster as urban
----> 9 import GOSTRocks.mapMisc as mapMisc
ModuleNotFoundError: No module named 'GOSTRocks'
Map of population density in study area
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[3], line 1
----> 1 mapMisc.static_map_raster(inR, thresh=[1, 5, 50, 100, 300, 1000, 3000])
NameError: name 'mapMisc' is not defined
Extract and map urban clusters
00:23:33 : Read in urban data
00:23:33 : Creating Shape 0
00:23:37 : Creating Shape 1000
00:23:40 : Creating Shape 2000
00:23:44 : Creating Shape 3000
00:23:47 : Creating Shape 4000
00:23:50 : Creating Shape 5000
00:23:53 : Creating Shape 6000
00:23:55 : Creating Shape 7000
|
ID |
Pop |
geometry |
Type |
0 |
6044 |
18641.011719 |
POLYGON ((-78.75958 44.38292, -78.75958 44.349... |
1 |
1 |
6045 |
147162.718750 |
POLYGON ((-79.71792 44.42458, -79.71792 44.416... |
1 |
2 |
6046 |
8065.728516 |
POLYGON ((-79.90958 44.33292, -79.90958 44.324... |
1 |
3 |
6047 |
18561.923828 |
POLYGON ((-79.55125 44.36625, -79.55125 44.357... |
1 |
4 |
6049 |
11521.957031 |
POLYGON ((-69.78458 44.34125, -69.78458 44.316... |
1 |
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[5], line 2
1 # Map of urban extents
----> 2 mapMisc.static_map_vector(urban_extents, "Type")
NameError: name 'mapMisc' is not defined
Extract and map high-density urban extents
00:23:56 : Read in urban data
00:23:56 : Creating Shape 0
00:24:01 : Creating Shape 1000
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/numpy/core/_methods.py:49: RuntimeWarning: overflow encountered in reduce
return umr_sum(a, axis, dtype, out, keepdims, initial, where)
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/GOSTurban/UrbanRaster.py:404: UserWarning: Geometry is in a geographic CRS. Results from 'buffer' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
xxGeom["geometry"] = xxGeom.buffer((popRaster.res[0] / 2))
|
geometry |
ID |
Pop |
Type |
group |
|
|
|
|
0 |
POLYGON ((-79.47625 44.07875, -79.43458 44.078... |
1920 |
8.631687e+04 |
2 |
1 |
POLYGON ((-78.87625 43.95375, -78.83458 43.953... |
1921 |
2.058095e+05 |
2 |
2 |
POLYGON ((-79.04292 43.90375, -79.00958 43.903... |
1922 |
1.838872e+05 |
2 |
3 |
POLYGON ((-79.45958 43.93708, -79.45125 43.937... |
1924 |
4.903070e+06 |
2 |
4 |
POLYGON ((-79.87625 43.54542, -79.85958 43.545... |
1925 |
8.413600e+04 |
2 |
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[7], line 1
----> 1 mapMisc.static_map_vector(hd_urban_extents, "Type", colormap="Blues")
NameError: name 'mapMisc' is not defined
Map combined extents and write output
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[8], line 2
1 combo_extents = pd.concat([urban_extents, hd_urban_extents])
----> 2 mapMisc.static_map_vector(combo_extents, "Type", colormap="magma")
NameError: name 'mapMisc' is not defined