lib/millstone.js
function fixSRS(obj) {
    if (!obj.srs) return;

    var normalized = _(obj.srs.split(' ')).chain()
        .select(function(s) { return s.indexOf('=') > 0; })
        .sortBy(function(s) { return s; })
        .reduce(function(memo, s) {
            var key = s.split('=')[0];
            var val = s.split('=')[1];
            if (val === '0') val = '0.0';
            memo[key] = val;
            return memo;
        }, {})
        .value();
    var legacy = {
        '+a': '6378137',
        '+b': '6378137',
        '+lat_ts': '0.0',
        '+lon_0': '0.0',
        '+proj': 'merc',
        '+units': 'm',
        '+x_0': '0.0',
        '+y_0': '0.0'
    };
    if (!_(legacy).chain()
        .reject(function(v, k) { return normalized[k] === v; })
        .size()
        .value()) obj.srs = SRS['900913'];
}
function fixSRS(obj) {
    if (!obj.srs) return;

    var normalized = _(obj.srs.split(' ')).chain()
        .select(function(s) { return s.indexOf('=') > 0; })
        .sortBy(function(s) { return s; })
        .reduce(function(memo, s) {
            var key = s.split('=')[0];
            var val = s.split('=')[1];
            if (val === '0') val = '0.0';
            memo[key] = val;
            return memo;
        }, {})
        .value();
    var legacy = {
        '+a': '6378137',
        '+b': '6378137',
        '+lat_ts': '0.0',
        '+lon_0': '0.0',
        '+proj': 'merc',
        '+units': 'm',
        '+x_0': '0.0',
        '+y_0': '0.0'
    };
    if (!_(legacy).chain()
        .reject(function(v, k) { return normalized[k] === v; })
        .size()
        .value()) obj.srs = SRS['900913'];
}
function fixSRS ( obj ) { if ( ! obj . srs ) return ; var normalized = _ ( obj . srs . split ( ' ' ) ) . chain ( ) . select ( function ( s ) { return s . indexOf ( '=' ) > 0 ; } ) . sortBy ( function ( s ) { return s ; } ) . reduce ( function ( memo , s ) { var key = s . split ( '=' ) [ 0 ] ; var val = s . split ( '=' ) [ 1 ] ; if ( val === '0' ) val = '0.0' ; memo [ key ] = val ; return memo ; } , { } ) . value ( ) ; var legacy = { '+a' : '6378137' , '+b' : '6378137' , '+lat_ts' : '0.0' , '+lon_0' : '0.0' , '+proj' : 'merc' , '+units' : 'm' , '+x_0' : '0.0' , '+y_0' : '0.0' } ; if ( ! _ ( legacy ) . chain ( ) . reject ( function ( v , k ) { return normalized [ k ] === v ; } ) . size ( ) . value ( ) ) obj . srs = SRS [ '900913' ] ; }
Fix known bad SRS strings to good ones.
Fix known bad SRS strings to good ones .