update readme and repository links #200

Merged
hugh merged 2 commits from contribs into main 2024-08-10 11:04:05 +10:00
8 changed files with 83 additions and 15 deletions
Showing only changes of commit 9919985b93 - Show all commits

View file

@ -16,6 +16,41 @@ See [sources](https://librarymap.hugh.run/sources).
See [contributing](https://librarymap.hugh.run/contributing/), especially *[which files to update](https://librarymap.hugh.run/contributing/#which-files-to-update)*.
## Deployment
The website for this project uses [git-webhooks](https://git.suboptimal.solutions/hugh/git-webhooks) with a customisation to run the `process.js` file that is found in this repository on each pull. The file is stored with the webhooks files so that everything can be `npm install`ed together.
This `process.js` file syncs any changes from the csv files into the topojson attributes (e.g. when a library changes their ILS).
## Updating the topojson
### Update boundaries
* make a copy of `/public_library_map/boundaries.geo.json`
* update in `qgis`
* save the copied file
### 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
```bash
sudo npm install -g mapshaper
mapshaper boundaries.geo.json snap -clean -o force precision=0.0001 format=geojson boundaries.geo.json
```
### Turn it into `topojson`:
```bash
sudo npm install -g topojson-server
geo2topo boundaries.geo.json -q 50000 > website/data/boundaries.topo.json
```
## Contributors
Contributors are listed at [contributors.txt](contributors.txt).

35
process.js Normal file
View file

@ -0,0 +1,35 @@
import csv from 'csv-parser'
import fs from 'fs'
const data_directory = '/srv/public_library_map/website/data'
// read json file into memory
const mapData = fs.readFileSync(`${data_directory}/boundaries.topo.json`)
let data = JSON.parse(mapData)
let geometries = data.objects['boundaries.geo'].geometries
// read csv file
// 'data' should be a single line (excl headers)
fs.createReadStream(`${data_directory}/library_services_information.csv`)
.pipe(csv())
.on('data', (data) => {
for (let feature in geometries) {
if (geometries[feature].properties.name == data.name) {
for (let k in data) {
if (k != "long_name" && k != "") {
geometries[feature].properties[k] = data[k]
}
}
}
}
})
.on('end', () => {
// write back to object
data.objects['boundaries.geo'].geometries = geometries
// write back to file
try {
fs.writeFileSync(`${data_directory}/boundaries.topo.json`, JSON.stringify(data))
} catch (err) {
console.err('ERROR writing topo file')
}
console.log('topo updated')
})

View file

@ -23,7 +23,7 @@
<li class="active-tab">About</li>
<li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
<li><a href="https://git.suboptimal.solutions/hugh/public_library_map">Code</a></li>
</ul>
</nav>
</header>

View file

@ -23,7 +23,7 @@
<li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li>
<li class="active-tab">Contribute</li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
<li><a href="https://git.suboptimal.solutions/hugh/public_library_map">Code</a></li>
</ul>
</nav>
</header>
@ -33,16 +33,14 @@
<p>Id love your help to make <em>Library Map</em> as accurate and useful as possible.</p>
<h3 id="how-to-contribute-your-idea-bug-report-or-improvement">How to contribute your idea, bug report or improvement</h3>
<ol type="1">
<li>Look at the <a href="https://github.com/hughrun/public_library_map/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22">current GitHub issues tagged <code>help wanted</code></a> to see if you can help. Most of these will be to do with updating data, like finding street addresses or other information.</li>
<li>You can <a href="https://github.com/hughrun/public_library_map/issues">create a new issue</a> on GitHub.</li>
<li>You can <a href="https://docs.github.com/en/github/.collaborating-with-issues-and-pull-requests/about-pull-requests">send a pull request</a> — though it is <em>strongly preferred</em> that you either ask to be assigned to an existing issue (so everyone knows youre working on it), or create a new issue, first.</li>
<li>You can just send an email to <code>librarymap</code>@<code>hugh</code>.<code>run</code> and ask me to fix/add something.</li>
<li>Look at the <a href="https://git.suboptimal.solutions/hugh/public_library_map/issues?q=&type=all&state=open&labels=9&milestone=0&assignee=0&poster=0">current issues tagged <code>help wanted</code></a> to see if you can help. Most of these will be to do with updating data, like finding street addresses or other information.</li>
<li>Email <code>librarymap</code>@<code>hugh</code>.<code>run</code> and ask me to open a <code>git.suboptimal.solutions</code> account for you, or just request that I fix/add something.</li>
</ol>
<h3 id="if-you-have-not-used-git-or-github-before">If you have not used Git or GitHub before</h3>
<p>There is a class outline for an <a href="https://librarycarpentry.org/lc-git/">introduction to Git and GitHub aimed at librarians</a> at <code>librarycarpentry.org</code>. This assumes you are using the command line. If you create or already have a GitHub account, you can also <a href="https://docs.github.com/en/github/managing-files-in-a-repository/editing-files-in-another-users-repository">edit files directly in the browser</a>, or use <a href="https://desktop.github.com/">GitHub Desktop</a> - both of which are probably less intimidating options if you dont have any desire to learn how to use a command line/shell interface, or just want to make a single minor update.</p>
<h3 id="if-you-have-not-used-git-before">If you have not used Git before</h3>
<p>There is a class outline for an <a href="https://librarycarpentry.org/lc-git/">introduction to Git and GitHub aimed at librarians</a> at <code>librarycarpentry.org</code>. This assumes you are using the command line.
<h3 id="which-files-to-update">Which files to update</h3>
<p>To update information about library <em>services</em> (e.g. fines info, loan period etc) you should edit <code>website/data/library_services_information.csv</code>.</p>
<p>To update information about library <em>locations</em> (e.g. street address, phone number, coordinates) you should edit the relevant csv location file:</p>
<p>To update information about library <em>services</em> (e.g. fines info, loan period etc) you should edit <code>website/data/library_services_information.csv</code>.</p>
<p>To update information about library <em>locations</em> (e.g. street address, phone number, coordinates) you should edit the relevant csv location file:</p>
<ul>
<li><code>website/data/indigenous_knowledge_centre_locations.csv</code></li>
<li><code>website/data/mechanics_institute_locations.csv</code></li>
@ -56,7 +54,7 @@
<h3 id="missing-or-inaccurate-data">Missing or inaccurate data</h3>
<p>Currently were missing data for some library services in relation to <strong>standard loan periods</strong> and <strong>fines for overdue items</strong>. Any acurate and specific information about fines for South and Western Australia would be particularly helpful.</p>
<p>Its likely that some <strong>library location data</strong> is inaccurate — especially for New South Wales. Its also possible that the address data is wrong (even though the location shown may be correct), and in some cases it is missing.</p>
<p>Its possible that some of the <strong>fines data for Queensland</strong> is a little off. This came from the State Library of Queensland but some of the data was wrong (e.g. Gold Coast Libraries does not charge overdue fines, but the SLQ report says it does).</p>
<p>Its possible that some of the <strong>fines data for Queensland</strong> is a little off. This came from the State Library of Queensland but some of the data was wrong (e.g. Gold Coast Libraries does not charge overdue fines, but the SLQ report says it does).</p>
<p>I am particularly interested if you know of data sources for entire regions, states, or Australia — especially if theyre reliably kept up to date.</p>
<p>If you can fill in any of these blanks, please update the relevant CSV file and send a pull request. If your data is coming from somewhere in particular, you should also add that to <code>sources.md</code> in the relevant table.</p>
<h3 id="ideas-for-additional-data">Ideas for additional data</h3>

View file

@ -25,7 +25,7 @@
<li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
<li><a href="https://git.suboptimal.solutions/hugh/public_library_map">Code</a></li>
</ul>
</nav>
</header>

View file

@ -25,7 +25,7 @@
<li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
<li><a href="https://git.suboptimal.solutions/hugh/public_library_map">Code</a></li>
</ul>
</nav>
</header>

View file

@ -23,7 +23,7 @@
<li><a href="/about">About</a></li>
<li class="active-tab">Acknowledgements</li>
<li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
<li><a href="https://git.suboptimal.solutions/hugh/public_library_map">Code</a></li>
</ul>
</nav>
</header>

View file

@ -23,7 +23,7 @@
<li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
<li><a href="https://git.suboptimal.solutions/hugh/public_library_map">Code</a></li>
</ul>
</nav>
</header>