kgjenkins, 2020-11-10
Before using any of the methods below, make sure that your polygon layer has a spatial index.
Reported timings are based on test data of 1606 counties in the eastern US.
select
a.GEOID,
kgjenkins, 2020-06-26
The US Census has PUMA boundary shapefiles available by state. Here's the directory of all the 2010 PUMAs, 2019 vintage: https://www2.census.gov/geo/tiger/TIGER2019/PUMA/
Download manually one at a time, or automate using wget:
| # this script goes through a directory of tif files and a shapefile of cities | |
| # and reports which city points are contained within each tif | |
| # 2024-04-17 kgjenkins | |
| import os | |
| import fiona | |
| import rasterio | |
| import shapely | |
| from pyproj import Transformer |
| # this script goes through a list of files from Excel "data from folder" | |
| # and computes a hash of the file contents (to be used for deduplication) | |
| import csv | |
| import os | |
| import hashlib | |
| import time | |
| # columns: Name,Extension,Date accessed,Date modified,Date created,Folder Path,Hash |
The same image (an illustrated book cover) was scanned on the flatbed scanner (EPSON WF-2630) three times at 300dpi.
Analysis of the variation across the three scans:
| band | min | max | mean | std dev |
|---|---|---|---|---|
| red | 0 | 36 | 4.47 | 2.59 |
| green | 0 | 36 | 4.41 | 2.68 |
| blue | 0 | 37 | 4.72 | 2.95 |
| # this script goes through a directory of tif files and a shapefile of cities | |
| # and reports which city points are contained within each tif | |
| import os | |
| import fiona | |
| import rasterio | |
| import shapely | |
| from pyproj import Transformer | |
| tifpath = "path/to/tiffs" |
| The limiting factor in terms of the speed of the Iso-areas tool seems | |
| to be the number of starting points. I've tried a number of | |
| variations, trying to reduce the number of points while retaining | |
| enough points that the analysis is still accurate. After several | |
| failed attempts, I think I've come up with a workflow that ends up | |
| keeping just the points along the park perimeters that end up being | |
| the closest points to the road network. Here's the general workflow, | |
| assuming we are starting with 2 layers, "streets" and "parks". I'd | |
| suggest creating temporary outputs for each of these steps, and then | |
| make the final result permanent. |
See the video demo at https://youtu.be/t-pb5-1Q_Qg
The files here were used to convert UrbanWatch from RGB images to numeric rasters with simple landcover values 0-9, as follows:
| Value | Category | Color |
|---|---|---|
| 0 | No Data | Black |
| 1 | Building | Red |
See the video demo at https://youtu.be/mdYnBFYqXpg
The files here can be used to convert UrbanWatch rasters from RGB images to numeric rasters with simple landcover values 0-9, as follows:
| Value | Category | Color |
|---|---|---|
| 0 | No Data | Black |
| 1 | Building | Red |
by Keith Jenkins, [email protected]
GIS Librarian at Mann Library, Cornell University
Fall 2022