{"id":21975066,"url":"https://github.com/watergis/open-building-vt-generator","last_synced_at":"2025-03-22T23:42:35.218Z","repository":{"id":109406423,"uuid":"390690617","full_name":"watergis/open-building-vt-generator","owner":"watergis","description":"This module is to convert csv files of Google's building data in Africa to GeoJSON files.","archived":false,"fork":false,"pushed_at":"2021-08-01T19:51:34.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-30T05:43:06.505Z","etag":null,"topics":["google","mbtiles","open-building","vector-tiles"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/watergis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-07-29T10:44:43.000Z","updated_at":"2021-08-01T20:21:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf4ab015-3fc3-4263-ba5f-6082107d5467","html_url":"https://github.com/watergis/open-building-vt-generator","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"639267ffc8038484d2b3e526b94a15003b360a57"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fopen-building-vt-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fopen-building-vt-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fopen-building-vt-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fopen-building-vt-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watergis","download_url":"https://codeload.github.com/watergis/open-building-vt-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902917,"owners_count":20529115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google","mbtiles","open-building","vector-tiles"],"created_at":"2024-11-29T15:49:30.509Z","updated_at":"2025-03-22T23:42:35.190Z","avatar_url":"https://github.com/watergis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# open-building-vt-generator\n\nThis module is to convert csv files of [Google's building data in Africa](https://sites.research.google/open-buildings/) to GeoJSON files.\n\n## Download\n\nFirst of all, download all of building data by commandline.\n\n```bash\ngsutil cp -R gs://open-buildings-data/v1/polygons_s2_level_4_gzip .\n```\n\nThe total size of files is 46GB for 135 files.\n\n## Extract .csv.gz to .csv\n\n```bash\nfind ./polygons_s2_level_4_gzip -type f -name \"*.gz\" -exec gunzip {} \\;\n```\n\nThe total size of files after extracting is 129.5GB\n\n## Convert .csv to GeoJSON\n\n- Installation\n\n```bash\ngit clone git@github.com:watergis/google-building-csv2geojson.git\ncd google-building-csv2geojson\nnpm i\n```\n\n- Convert\n\nModify `building-csv2geojson.test.js`\n\n```js\nconst { BuidlingCsv2GeoJSON} = require('../src/index');\nconst path = require('path');\n\n(() =\u003e {\n    // specify the directory where stored csv files\n    const inputDir = path.resolve(__dirname, './data')\n    // specify the directory where export to\n    const outputDir = path.resolve(__dirname, './output')\n    const csv2geojson = new BuidlingCsv2GeoJSON(inputDir, outputDir);\n    csv2geojson.convert();\n})();\n```\n\n```bash\nnpm run convert\n```\n\n### generate vector tiles by tippecanoe\n\n- if you just want to convert few GeoJSON files...\n\n```bash\ntippecanoe -P --no-feature-limit --no-tile-size-limit --force --minimum-zoom=15 --maximum-zoom=15 --base-zoom=15 --hilbert -l \"open-buildings\" -o open-buildings.mbtiles $(find ./tests/output/*.geojson)\n```\n\nThis might take very long time to generate mbtiles if the number of GeoJSON is too much.\n\n- if you want to convert in the entire Africa...\n\nModify `geojson2mbtiles.test.js`\n\n```js\nconst { GeoJSON2mbtiles}  = require('../src/index');\nconst path = require('path');\n\n(async () =\u003e {\n    const parentDir = __dirname;\n    // specify the GeoJSON directory path.\n    const inputDir = path.resolve(parentDir, './output')\n    // specify the mbtiles directory path to export\n    const outputDir = path.resolve(parentDir, './mbtiles')\n    const geojson2mbtiles = new GeoJSON2mbtiles(inputDir, outputDir);\n    await geojson2mbtiles.convert();\n})();\n```\n\n```bash\nnpm run generate\n```\n\nFinally, you can merge all of mbtiles into one.\n\n```bash\ntile-join --force -o open-buildings.mbtiles --maximum-zoom=15 --minimum-zoom=15 --no-tile-size-limit $(find ./tests/mbtiles/*.mbtiles)\n```\n\n## License\n\nThis source code's license is MIT, however the license of data is belong to Google. It is CC By 4.0 license. Please check their [website](https://sites.research.google/open-buildings/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatergis%2Fopen-building-vt-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatergis%2Fopen-building-vt-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatergis%2Fopen-building-vt-generator/lists"}