I need the ability to write multiple shapefiles and compress them all in one zip and send them back to the client.
I.E. I would like to do:
[geojson.point(gj), geojson.line(gj), geojson.polygon(gj)]
.forEach(function(l) {
if (l.geometries.length) {
write(
// field definitions
l.properties,
// geometry type
l.type,
// geometries
l.geometries,
function(err, files) {
layers.file(l.type + '.shp', files.shp.buffer, { binary: true });
layers.file(l.type + '.shx', files.shx.buffer, { binary: true });
layers.file(l.type + '.dbf', files.dbf.buffer, { binary: true });
layers.file(l.type + '.prj', prj);
});
}
});
Over a few different layers and them zip them all up. The code you have will work perfectly if I could get at it, but from what I can see the only thing you are exposing is 'download'.
How do I get at the write method? Am I missing something.
I need the ability to write multiple shapefiles and compress them all in one zip and send them back to the client.
I.E. I would like to do: [geojson.point(gj), geojson.line(gj), geojson.polygon(gj)] .forEach(function(l) { if (l.geometries.length) { write( // field definitions l.properties, // geometry type l.type, // geometries l.geometries, function(err, files) { layers.file(l.type + '.shp', files.shp.buffer, { binary: true }); layers.file(l.type + '.shx', files.shx.buffer, { binary: true }); layers.file(l.type + '.dbf', files.dbf.buffer, { binary: true }); layers.file(l.type + '.prj', prj); }); } });
Over a few different layers and them zip them all up. The code you have will work perfectly if I could get at it, but from what I can see the only thing you are exposing is 'download'.
How do I get at the write method? Am I missing something.