Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alifeee/hmo-licences-in-sheffield
a map of HMO licenced premises in the Sheffield district
https://github.com/alifeee/hmo-licences-in-sheffield
geojson hmo-licences open-data sheffield
Last synced: 2 days ago
JSON representation
a map of HMO licenced premises in the Sheffield district
- Host: GitHub
- URL: https://github.com/alifeee/hmo-licences-in-sheffield
- Owner: alifeee
- License: other
- Created: 2024-11-14T14:56:42.000Z (6 days ago)
- Default Branch: main
- Last Pushed: 2024-11-14T17:13:14.000Z (6 days ago)
- Last Synced: 2024-11-14T17:34:52.456Z (6 days ago)
- Topics: geojson, hmo-licences, open-data, sheffield
- Language: Shell
- Homepage: https://geojson.io/#data=data:text/x-url,https%3A%2F%2Fraw.githubusercontent.com%2Falifeee%2Fhmo-licences-in-sheffield%2Frefs%2Fheads%2Fmain%2Fhmos.geojson
- Size: 140 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HMO Licences in Sheffield
HMO licences from displayed on a map.
on geojson.io:
on Google Maps:
see more maps on
![screenshot of map showing many markers. one has a popup with information](./images/map.png)
## Generate
the script takes around 10 minutes and should report an ETA when run
```bash
./geocode.sh
# i.e., with format of hmo_licences_issued_to_9_september_2024.csv
./geocode.sh hmo_licences_issued_to_9_september_2024.csv "%2 %3 %1" 4
```a `hmos.csv` file should now be available. there may be blank rows to be manually set, find them with:
```
while read num; do
sed "${num}"'q;d' hmos.csv
done <<< $(cat hmos.csv | csvtool namedcol latitude - | awk '$0 ~ "null" {print NR}')
```add some style information (from "Permitted Occupants" column)
```bash
# find min/max
csvtool namedcol "Permitted Occupants" hmo_licences_issued_to_9_september_2024.csv | sort -n | uniq -c
# make colour array
# e.g., with https://hihayk.github.io/scale/ or https://www.learnui.design/tools/data-color-picker.html
colors=(0A2F51 0F596B 16837A 1D9A6C 48B16D 74C67A ADDAA1 DEEDCF)while read row; do
occupants=$(echo "${row}" | csvtool col 5 -)
index=$(($occupants - 4))
[[ $index -lt 0 ]] && index=0
[[ $index -ge "${#colors[@]}" ]] && index=$(( "${#colors[@]}" - 1 ))
echo "home,#${colors[$index]}"
done <<< $(cat hmos.csv | awk 'NR>1') | sed '1s/^/marker-symbol,marker-color\n/' > /tmp/hmo_colors.csv
csvtool paste hmos.csv /tmp/hmo_colors.csv > /tmp/hmos.csv; mv /tmp/hmos.csv hmos.csv
```to turn this into a geojson file, use https://github.com/pvernier/csv2geojson with:
```bash
git clone [email protected]:pvernier/csv2geojson.git
(cd csv2geojson/; go build main.go)
./csv2geojson/main hmos.csv
```make GPX by using an online tool like
## make google maps map
create a KML file by uploading `hmos.geojson` to and `Save > KML`
import it to Google Maps ([how?](https://www.google.com/maps/about/mymaps/)), view the data table, duplicate the "Permitted Occupants" column and change the type to `number`, and style by Permitted Occupants, range 10 (or otherwise).