Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel authored and Samuel committed Jun 20, 2019
0 parents commit 2e24e62
Show file tree
Hide file tree
Showing 8 changed files with 714 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.DS_Store
570 changes: 570 additions & 0 deletions README.md

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const osmToGeojson = require('osm-public-transport-export')
const fs = require('fs')
osmToGeojson({
bounds: {
south: 5.509657,
west: -0.316450,
north: 5.886880,
east: 0.120503,
},
assumeFirstWayIsStart: true,
outputDir: __dirname + '/out',
mapProperties: (tags) => ({
...tags,
stroke: '#164154',
"stroke-width": 5,
}),
stopNameSeparator: ' and ',
stopNameFallback: 'unnamed',
})
.then(data => {
let route_with_error = 0
let out_file = `### Ghana-Accra
| Id | Name | Ref | From | To | State |
| -- | ---- | --- | ---- | -- | ----- |`
data.log.forEach(element => {
if (element.error_log) route_with_error++
let error_log = element.error_log ? element.error_log.extractor_error ? `[${element.error_log.extractor_error}](${element.error_log.uri})` : element.error_log : "✅"
out_file += `\n[${element.id}](https://www.openstreetmap.org/relation/${element.id}) | ${element.name} | ${element.ref} | ${element.from} | ${element.to} | ${error_log}`
});
// console.log(out_file)
out_file = `### Count
**Total**: ${data.log.length} **Correct**: ${data.log.length - route_with_error} **With error**: ${route_with_error}
${out_file}`
fs.writeFileSync("README.md", out_file)
console.log("done!!")
})
.catch(error => console.error(error))
1 change: 1 addition & 0 deletions out/log.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions out/routes.geojson

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions out/stops.json

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "geojson-ghana-accra",
"version": "1.0.0",
"description": "GoeJSON from accra",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SamuelRioTz/GeoJSON-Ghana-Accra.git"
},
"keywords": [
"geojson","accra"
],
"author": "Samuel Rioja",
"license": "ISC",
"bugs": {
"url": "https://github.com/SamuelRioTz/GeoJSON-Ghana-Accra/issues"
},
"homepage": "https://github.com/SamuelRioTz/GeoJSON-Ghana-Accra#readme",
"dependencies": {
"osm-public-transport-export": "github:SamuelRioTz/osm-public-transport-export#refactor/log-format"
}
}

0 comments on commit 2e24e62

Please sign in to comment.