Skip to content

Commit

Permalink
remove crs, geojson doesnt require it
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Jul 13, 2016
1 parent 3fe276c commit 4fb2cc5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
12 changes: 1 addition & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,6 @@ function processFilePath(context, file, cb) {
cb = (0, _once2.default)(cb);
var ftp = context.ftp;

var onBoundary = function onBoundary(doc, done) {
// workaround for missing crs info
doc.crs = {
type: 'name',
properties: {
name: 'EPSG:4326'
}
};
context.onBoundary(file.type, doc, done);
};
ftp.get(file.path, function (err, stream) {
if (err) return cb(err);

Expand All @@ -112,7 +102,7 @@ function processFilePath(context, file, cb) {
srcStream.once('end', function () {
var docs = JSON.parse(_buffer.Buffer.concat(chunks)).features;
debug(' -- ' + _chalk2.default.cyan('Parsed ' + file.path + ', inserting ' + docs.length + ' boundaries now...'));
_async2.default.forEach(docs, _async2.default.ensureAsync(onBoundary), cb);
_async2.default.forEach(docs, _async2.default.ensureAsync(context.onBoundary.bind(null, file.type)), cb);
});

stream.resume();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "census-boundaries",
"version": "1.0.5",
"version": "1.0.6",
"description": "Downloads and converts US Census TIGER data representing all boundaries in the United States",
"main": "dist/index.js",
"keywords": [
Expand Down
12 changes: 1 addition & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ function processObject(context, object, cb) {
function processFilePath(context, file, cb) {
cb = once(cb)
const { ftp } = context
const onBoundary = (doc, done) => {
// workaround for missing crs info
doc.crs = {
type: 'name',
properties: {
name: 'EPSG:4326'
}
}
context.onBoundary(file.type, doc, done)
}
ftp.get(file.path, (err, stream) => {
if (err) return cb(err)

Expand All @@ -71,7 +61,7 @@ function processFilePath(context, file, cb) {
srcStream.once('end', () => {
const docs = JSON.parse(Buffer.concat(chunks)).features
debug(` -- ${chalk.cyan(`Parsed ${file.path}, inserting ${docs.length} boundaries now...`)}`)
async.forEach(docs, async.ensureAsync(onBoundary), cb)
async.forEach(docs, async.ensureAsync(context.onBoundary.bind(null, file.type)), cb)
})

stream.resume()
Expand Down

0 comments on commit 4fb2cc5

Please sign in to comment.