Gracefully fail on bad shapefile loads - this should return an error eventually, but after inspection works.
This commit is contained in:
parent
2de9117134
commit
4db08c47ec
@ -175,11 +175,15 @@ var External = function External(env) {
|
||||
unzip: function(filename, resource_url, callback, that) {
|
||||
// regrettably complex because zip library isn't written for
|
||||
// node yet.
|
||||
console.log('unzipping download from ' + filename);
|
||||
spawn('unzip', [filename, '-d', that.pos(resource_url)])
|
||||
.on('exit', function(code) {
|
||||
if (code > 0) {
|
||||
console.log('Unzip returned a code of %d', code);
|
||||
console.log('unzip failed');
|
||||
callback('Unzip returned a code of ' + code, [
|
||||
resource_url, false]);
|
||||
} else {
|
||||
console.log('unzip succeeded');
|
||||
// TODO; eliminate locality of reference
|
||||
callback(null, [
|
||||
resource_url,
|
||||
|
@ -63,11 +63,17 @@ mess.Renderer = function Renderer(env) {
|
||||
},
|
||||
function(err, results) {
|
||||
var result_map = to(results);
|
||||
m.Layer.forEach(function(l) {
|
||||
if (l.Datasource.file) {
|
||||
l.Datasource.file = result_map[l.Datasource.file];
|
||||
}
|
||||
});
|
||||
console.log(result_map);
|
||||
m.Layer = _.map(_.filter(m.Layer,
|
||||
function(l) {
|
||||
return l.Datasource.file &&
|
||||
result_map[l.Datasource.file];
|
||||
}),
|
||||
function(l) {
|
||||
l.Datasource.file = result_map[l.Datasource.file];
|
||||
return l;
|
||||
}
|
||||
);
|
||||
callback(err, m);
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user