update docs and merge file

- add instructions for updating CSV and not JSON
- fix filepaths in merge_service_data.py
- add info about license agreement for contributors
- explain about large files that are currently missing

Fixes #7
Fixes #15
This commit is contained in:
Hugh Rundle 2021-01-23 19:43:03 +11:00
parent fafbf5e6b3
commit 883195cf83
3 changed files with 42 additions and 4 deletions

View file

@ -51,3 +51,16 @@ If this naming convention makes you uncomfortable, you may view the map in *Whit
* Indigenous Knowledge Centres * Indigenous Knowledge Centres
* Mechanics Institutes * Mechanics Institutes
* National & State Libraries * National & State Libraries
### Important files that are not in this repository
If you look at `merge_service_data.py` you will notice that there are two files used in creating `website/data/boundaries.topo.json` that are missing from this repository:
* website/data/boundaries.geojson
* website/data/all_library_services.geojson
The first is the "core" geojson file with boundaries for each library service. The only other data it holds is the name of each area. The second is the file created when we run `merge_service_data.py` to merge data from `website/data/library_services_information.csv` into `website/data/boundaries.topo.json`.
These files aren't included in the GitHub repo for the simple reason that Git has a 100MB limit, and both files are larger than that.
If you want to update library service data (e.g. to add missing data about the standard loan period for a particular library service) then **you should edit `website/data/library_services_information.csv`** — *not* `website/data/boundaries.topo.json`. After I merge your PR I will then pull down the updated file, run the merge script, and update the topoJSON file. It would be better to automate this and I can probably rewrite the script to update the TopoJSON directly, but currently that's the workflow, and it will *always* be that contributors should update the CSV file, not the JSON.

View file

@ -8,6 +8,23 @@ I'd love your help to make *Library Map* as accurate and useful as possible.
2. You can [send a pull request](https://docs.github.com/en/github/.collaborating-with-issues-and-pull-requests/about-pull-requests) — though it is *strongly preferred* that you either ask to be assigned to an existing issue, or create a new issue, first. 2. You can [send a pull request](https://docs.github.com/en/github/.collaborating-with-issues-and-pull-requests/about-pull-requests) — though it is *strongly preferred* that you either ask to be assigned to an existing issue, or create a new issue, first.
3. You can just send an email to `librarymap`@`hugh`.`run`. 3. You can just send an email to `librarymap`@`hugh`.`run`.
### Which files to update
To update information about library *services* (e.g. fines info, loan period etc) you should edit `website/data/library_services_information.csv`
To update information about library *locations* (e.g. street address, phone number, coordinates) you shoudl edit the relevant csv location file:
* `website/data/indigenous_knowledge_centre_locations.csv`
* `website/data/mechanics_institute_locations.csv`
* `website/data/nsla_library_locations.csv`
* `website/data/public_library_locations.csv`
Do not directly edit JSON files - these are [updated programatically](about#important-files-that-are-not-in-this-repository).
### Citing and crediting data sources
If you are adding a lot of data and have a new source for it, make sure it is cited. You should update the list of sources at both `sources.md` *and* `website/sources/index.html`. If your source is "I just know because it's my local library" or "I looked it up on their website" you don't need to add that to the list of sources. If your source is "I found a PDF listing every public library on the State Library website", you do.
### Missing or inaccurate data ### Missing or inaccurate data
Currently we're missing data for some library services in relation to **standard loan periods** and **fines for overdue items**. Currently we're missing data for some library services in relation to **standard loan periods** and **fines for overdue items**.
@ -31,3 +48,11 @@ I'm always — *always* — happy to hear how I can improve documentatio
### Improvements to the website design, layout, or information ### Improvements to the website design, layout, or information
You might have an idea for an improvement that's not about the data per se, but rather about the website. Maybe there's some accessibilty improvements I can make. Let me know! You might have an idea for an improvement that's not about the data per se, but rather about the website. Maybe there's some accessibilty improvements I can make. Let me know!
### Licensing and copyright
By contributing to this project you agree to license your work under the following licenses:
**/website/data/\***: [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)
**everything else**: [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.txt)

View file

@ -5,15 +5,15 @@ import json
from titlecase import titlecase # you need to install the titlecase package from PyPi :-) from titlecase import titlecase # you need to install the titlecase package from PyPi :-)
# files to merge # files to merge
geojson_file = 'data/all_library_services.geojson' geojson_file = 'website/data/all_library_services.geojson'
csv_file = 'data/library_services.csv' csv_file = 'website/data/library_services_information.csv'
# fields to match on # fields to match on
geojson_match = 'name' geojson_match = 'name'
csv_match = 'short_name' csv_match = 'short_name'
# output file name # output file name
output_file = 'data/boundaries.geojson' output_file = 'website/data/boundaries.geojson'
# open the geojson file # open the geojson file
file = open(geojson_file, 'r') file = open(geojson_file, 'r')