|
||
---|---|---|
website | ||
.gitignore | ||
boundaries.geo.json | ||
contributors.txt | ||
package.json | ||
process.js | ||
README.md |
Public library data map
This project collects and maps data from public libraries across the Australia and the external Territories of Christmas Island and the Cocos (Keeling) Islands.
You should be able to find the location of every public library in Australia territory, plus the standard loan period for each libary service, and whether they charge overdue fines (if known, in both cases).
Check out the map at librarymap.hugh.run.
Find more on this project at about.
Attributions
See sources.
Want to help?
I'm very happy for some help! Especially if you have updates on the data.
See contributing, especially which files to update.
Deployment
The website for this project uses git-webhooks with a customisation to run the process.js
file that is found in this repository on each pull. The process.js
file is stored with the webhooks files so that everything can be npm install
ed together. Documentation for this will be updated soon as it is a little confusing right now.
This process.js
file syncs any changes from the csv files into the topojson attributes (e.g. when a library changes their ILS).
We also need a MapBox public token. THese are safe to use in public code, especially if you set the scope to a specific domain you control. Add your token in secrets.js
.
Updating the topojson
Each time a new changes is pulled into the repository, the code will be pushed to the website via a webhook. This processes any changes in data
and updates the topojoson
file as needed. If we did this all in the repository on the server, it would cause merge conflicts. Instead, we first copy the necessary files over to /srv/
and then process the files.
This uses the process.js
file in this repository, but the file has been copied over to the git-webhook
files on the server so that the webhook can run it. This required a few adjustments to what is npm install
ed.
1. Update boundaries
This could be a bit of faffing around, depending what you are trying to do. Merging existing entities together is reasonably easy, but if you need to pull a council area out of a regional library, for example, you might need to mess around with LGA maps.
Always work with copies of the original files.
-
boundaries.geo.json
should be aligned withboundaries.topo.json
. If in doubt, usetopojson-client
'stopo2geo
to get a geojson file with the most up to date data from the topojson:topo2geo boundaries_new.geo.json < boundaries.topo.json
-
update in
qgis
-
export out to geojson
2. Simplify to reduce the file size
Option 1
- upload to https://mapshaper.org/ and 'simplify' the boundaries
- download the simplified version
- replace
/public_library_map/boundaries.geo.json
Option 2
sudo npm install -g mapshaper # if not already installed
mapshaper boundaries.geo.json snap -clean -o force precision=0.0001 format=geojson boundaries.geo.json
3. Turn it back into topojson
:
sudo npm install -g topojson-server # if not already installed
geo2topo boundaries.geo.json -q 50000 > website/data/boundaries.topo.json
Contributing
To contribute to the map data you can contact Hugh at librarymap [at] hugh.run. If necessary, I will add an account for you on git.suboptimal.solutions
if you want to contribute to the code.
Contributors are listed at contributors.txt.
Licenses
/website/data: CC-BY-SA
everything else: GPL-3.0-or-later