diff --git a/CHANGELOG.md b/CHANGELOG.md index f57e0ed..1a2338a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1] - 2020-11-19 +### Changed +- Better dissolve with polygon-clipping library +### Fixed +- Support for multi agency import + ## [2.0.0] - 2020-11-19 ### Added - New export types: envelope, convex, lines, lines-buffer, lines-dissolve, stops, stops-buffer, stops-dissolve, lines-and-stops. diff --git a/lib/formats/lines-dissolved.js b/lib/formats/lines-dissolved.js index 69e09eb..0cf2b23 100644 --- a/lib/formats/lines-dissolved.js +++ b/lib/formats/lines-dissolved.js @@ -18,10 +18,11 @@ module.exports = async (config, routeId, directionId) => { const bufferedLines = buffer(lines, config.bufferSizeMeters, { units: 'meters' }); const geometries = []; - geomEach(bufferedLines, (geometry) => { + geomEach(bufferedLines, geometry => { if (geometry.type === 'MultiPolygon') { geometries.push(geometry.coordinates); } + if (geometry.type === 'Polygon') { geometries.push([geometry.coordinates]); } diff --git a/lib/formats/stops-dissolved.js b/lib/formats/stops-dissolved.js index 156c9e6..f1cff85 100644 --- a/lib/formats/stops-dissolved.js +++ b/lib/formats/stops-dissolved.js @@ -19,10 +19,11 @@ module.exports = async (config, routeId, directionId) => { const bufferedStops = buffer(stops, config.bufferSizeMeters, { units: 'meters' }); const geometries = []; - geomEach(bufferedStops, (geometry) => { + geomEach(bufferedStops, geometry => { if (geometry.type === 'MultiPolygon') { geometries.push(geometry.coordinates); } + if (geometry.type === 'Polygon') { geometries.push([geometry.coordinates]); } diff --git a/lib/gtfs-to-geojson.js b/lib/gtfs-to-geojson.js index 4fbe425..d66152f 100644 --- a/lib/gtfs-to-geojson.js +++ b/lib/gtfs-to-geojson.js @@ -111,7 +111,10 @@ module.exports = async initialConfig => { await gtfs.openDb(config); - await Promise.all(config.agencies.map(async agency => { + config.log(`Started GeoJSON creation for ${config.agencies.length} agencies.`); + + /* eslint-disable no-await-in-loop */ + for (const agency of config.agencies) { const timer = new Timer(); timer.start(); @@ -128,7 +131,7 @@ module.exports = async initialConfig => { const agencyConfig = clone(omit(config, 'agencies')); agencyConfig.agencies = [agency]; - await gtfs.import(config); + await gtfs.import(agencyConfig); } await fs.remove(exportPath); @@ -157,5 +160,6 @@ module.exports = async initialConfig => { timer.stop(); config.log(`GeoJSON generation required ${msToSeconds(timer.time())} seconds`); - })); + } + /* eslint-enable no-await-in-loop */ }; diff --git a/package-lock.json b/package-lock.json index 5c9973d..0609446 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gtfs-to-geojson", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b3c3099..7bae3ff 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gtfs-to-geojson", "description": "Generate geoJSON of transit route data from a GTFS file", - "version": "2.0.0", + "version": "2.0.1", "keywords": [ "transit", "gtfs",