<commit_before>var ogr2ogr = require('ogr2ogr');


function downloadDataset(req, res) {
    var layerName = req.ogr2ogr.layerName;
    var options = layerName ? [layerName] : [];

    var ogr2ogrTask = ogr2ogr(req.ogr2ogr.src)
        .timeout(60000);

    // Projection
    if (req.query.projection === 'WGS84') {
        ogr2ogrTask.project('EPSG:4326');
    } else if (req.query.projection === 'Lambert93') {
        ogr2ogrTask.project('EPSG:2154');
    } else {
        return res.status(400).send({
            code: 400,
            message: 'No valid projection given'
        });
    }

    var fileName = req.ogr2ogr.fileName || layerName || 'dataset';

    // Format
    if (req.query.format === 'GeoJSON') {
        res.type('json');
        res.attachment(fileName + '.json');
        options.push('-explodecollections');
    } else if (req.query.format === 'KML') {
        res.type('application/vnd.google-earth.kml+xml');
        res.attachment(fileName + '.kml');
        ogr2ogrTask.format('KML');
        options.push('-explodecollections');
    } else if (req.query.format === 'SHP') {
        res.type('application/x-shapefile');<commit_msg>Decrease timeout<commit_after>var ogr2ogr = require('ogr2ogr');


function downloadDataset(req, res) {
    var layerName = req.ogr2ogr.layerName;
    var options = layerName ? [layerName] : [];

    var ogr2ogrTask = ogr2ogr(req.ogr2ogr.src)
        .timeout(20000);

    // Projection
    if (req.query.projection === 'WGS84') {
        ogr2ogrTask.project('EPSG:4326');
    } else if (req.query.projection === 'Lambert93') {
        ogr2ogrTask.project('EPSG:2154');
    } else {
        return res.status(400).send({
            code: 400,
            message: 'No valid projection given'
        });
    }

    var fileName = req.ogr2ogr.fileName || layerName || 'dataset';

    // Format
    if (req.query.format === 'GeoJSON') {
        res.type('json');
        res.attachment(fileName + '.json');
        options.push('-explodecollections');
    } else if (req.query.format === 'KML') {
        res.type('application/vnd.google-earth.kml+xml');
        res.attachment(fileName + '.kml');
        ogr2ogrTask.format('KML');
        options.push('-explodecollections');
    } else if (req.query.format === 'SHP') {
        res.type('application/x-shapefile');
{'fraction_non_alphanumeric': 0.16587881392350667, 'fraction_numerical': 0.028362698753760206, 'mean_word_length': 2.5815384615384613, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1422031', 'n_tokens_mistral': 832, 'n_tokens_neox': 759, 'n_words': 128}