diff options
author | Evan Siroky <evan.siroky@yahoo.com> | 2017-05-29 14:53:52 -0700 |
---|---|---|
committer | Evan Siroky <evan.siroky@yahoo.com> | 2017-05-29 14:53:52 -0700 |
commit | 081c8e4bdb32132f37e09914d983ed651ade3c1c (patch) | |
tree | 5fc43cef23cb9cfe430a785539dbb210ba8d71cb /index.js | |
parent | de3fb2bf091c13a0dae3e0621276f29c6796bca1 (diff) | |
download | timezone-boundary-builder-081c8e4bdb32132f37e09914d983ed651ade3c1c.tar.gz |
Add some more debugging tools
- better naming of jsts exception output files
- linting of json files
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -174,7 +174,7 @@ var downloadOsmBoundary = function (boundaryId, boundaryCallback) { var curGeom = geoJsonToGeom(curOsmGeom) } catch (e) { console.error('error converting overpass result to geojson') - fs.writeFileSync(boundaryId + '_fixed.json', JSON.stringify(data)) + fs.writeFileSync(boundaryId + '_convert_to_geom_error.json', JSON.stringify(data)) throw e } if (!combined) { @@ -184,7 +184,13 @@ var downloadOsmBoundary = function (boundaryId, boundaryCallback) { } } } - fs.writeFile(boundaryFilename, geomToGeoJsonString(combined), cb) + try { + fs.writeFile(boundaryFilename, geomToGeoJsonString(combined), cb) + } catch (e) { + console.error('error writing combined border to geojson') + fs.writeFileSync(boundaryId + '_combined_border_convert_to_geom_error.json', JSON.stringify(data)) + throw e + } }] }, boundaryCallback) } |