Skip to content

Commit

Permalink
added nakuru water's setting file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin IGARASHI committed Aug 16, 2020
1 parent 6d950d7 commit c94604f
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 74 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: npm run extract
- name: configure git and deploy
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
git config --global user.name "nakuruwater+githubci"
git config --global user.email "[email protected]"
git remote set-url origin https://x-access-token:${NODE_AUTH_TOKEN}@github.com/nakuruwater/vt.git
npm run deploy
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# vt-boilerplate
![](https://github.com/narwassco/vt/workflows/Node.js%20CI/badge.svg)
![GitHub](https://img.shields.io/github/license/watergis/vt-boilerplate)
![](https://github.com/nakuruwater/vt/workflows/Node.js%20CI/badge.svg)
![GitHub](https://img.shields.io/github/license/nakuruwater/vt)
![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/narwassco/vt)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/narwassco/vt)

This is a template to manage vectortiles for water services providers in Github pages. You can create your own `vt` repository by using this template repository.
This is a template to manage vectortiles for Nakuru Water in Github pages. You can create your own `vt` repository by using this template repository.

Please also refer to [watergis/awesome-vector-tiles](https://github.com/watergis/awesome-vector-tiles). There is some instruction guide how to use tools and host your vectortiles in Github pages as open data.

Expand Down Expand Up @@ -137,8 +137,8 @@ jobs:
This source code under the repository is licensed by
`MIT license`. You can use it freely for your purposes.

However, these data under [data](./data) and `gh-pages` branch are owned and maintained by `{your organization name}` in Kenya. It is under a [Creative Commons Attribution 4.0 International
License](http://creativecommons.org/licenses/by/4.0/), which is different from main repository. You can use this data freely, but please mention our credit `©{your organization name}` on attribution of your web application.
However, these data under [data](./data) and `gh-pages` branch are owned and maintained by `Nakuru Water and Sanitation Services Company (NAWASSCO)` in Kenya. It is under a [Creative Commons Attribution 4.0 International
License](http://creativecommons.org/licenses/by/4.0/), which is different from main repository. You can use this data freely, but please mention our credit `©NARWASSCO,Ltd.` on attribution of your web application.

---
Copyright (c) 2020 Jin IGARASHI
2 changes: 1 addition & 1 deletion config-extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ module.exports = {
ghpages:{
tiles: __dirname + '/public/tiles'
},
mbtiles: __dirname + '/data/data.mbtiles',
mbtiles: __dirname + '/data/nakuru.mbtiles',
}
27 changes: 9 additions & 18 deletions config-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module.exports = {
password:process.env.db_password,
host:process.env.db_host,
post:process.env.db_port,
database:'{your database name}',
database:'nawassco_restored_13_11_2019',
},
layers : [
{
name: 'meter',
geojsonFileName: __dirname + '/public/meter.geojson',
name: 'accounts',
geojsonFileName: __dirname + '/public/accounts.geojson',
select:`
SELECT row_to_json(featurecollection) AS json FROM (
SELECT
Expand All @@ -20,26 +20,17 @@ module.exports = {
FROM (
SELECT
'Feature' AS type,
ST_AsGeoJSON(ST_TRANSFORM(x.geom,4326))::json AS geometry,
ST_AsGeoJSON(ST_SetSRID(geom,4326))::json AS geometry,
row_to_json((
SELECT p FROM (
SELECT
x.meterid as fid,
CASE WHEN x.connno=-1 THEN NULL ELSE LPAD(CAST(x.connno as text), 4, '0') || x.zonecd END as connno,
x.serialno,
b.name as customer,
c.name as village
gid as fid,
accountno,
serino as serialno
) AS p
)) AS properties
FROM meter x
INNER JOIN metertype a
ON x.metertypeid = a.metertypeid
LEFT JOIN customer b
ON x.zonecd = b.zonecd
AND x.connno = b.connno
LEFT JOIN village c
on b.villageid = c.villageid
WHERE NOT ST_IsEmpty(x.geom) AND x.metertypeid = 1
FROM accounts
WHERE NOT ST_IsEmpty(geom)
) AS feature
) AS featurecollection
`
Expand Down
Loading

0 comments on commit c94604f

Please sign in to comment.