function calcMatchTable() {
    // clear old table rows if exists
    var tbody = document.querySelector('#match-table tbody');
    tbody.innerHTML = "";
    
    // get features 
    var features = gbLayer.getSource().getFeatures();
    var comparisonFeatures = comparisonLayer.getSource().getFeatures();
    if (features.length == 0 | comparisonFeatures.length == 0) {
        return;
    };
    console.log('finding matches');

    // add in main names while calculating
    updateGbNames(features);

    // define on success
    function onSuccess(allMatches) {
        // determine only the best matches
        var bestMatches = calcBestMatches(allMatches);

        // calc total equality from the perspective of both sources
        console.log(allMatches)
        console.log(bestMatches)
        updateTotalEquality(allMatches, bestMatches, comparisonFeatures);

        // update tables
        updateMatchTable(bestMatches, comparisonFeatures);
    };

    // calculate relations
    function onProgress(i, total) {
        document.querySelector('#total-similarity p').innerText = 'Matching '+i+' of '+total;
    };
    calcAllSpatialRelations(features, comparisonFeatures, onSuccess=onSuccess, onProgress=onProgress);
}
// calc and update boundary unit relationships
calc and update boundary unit relationships
calc and update boundary unit relationships
function calcMatchTable() {
    var tbody = document.querySelector('#match-table tbody');
    tbody.innerHTML = "";
    var features = gbLayer.getSource().getFeatures();
    var comparisonFeatures = comparisonLayer.getSource().getFeatures();
    if (features.length == 0 | comparisonFeatures.length == 0) {
        return;
    };
    console.log('finding matches');
    updateGbNames(features);
    function onSuccess(allMatches) {
        var bestMatches = calcBestMatches(allMatches);
        console.log(allMatches)
        console.log(bestMatches)
        updateTotalEquality(allMatches, bestMatches, comparisonFeatures);
        updateMatchTable(bestMatches, comparisonFeatures);
    };
    function onProgress(i, total) {
        document.querySelector('#total-similarity p').innerText = 'Matching '+i+' of '+total;
    };
    calcAllSpatialRelations(features, comparisonFeatures, onSuccess=onSuccess, onProgress=onProgress);
}
function calcMatchTable ( ) { var tbody = document . querySelector ( '#match-table tbody' ) ; tbody . innerHTML = "" ; var features = gbLayer . getSource ( ) . getFeatures ( ) ; var comparisonFeatures = comparisonLayer . getSource ( ) . getFeatures ( ) ; if ( features . length == 0 | comparisonFeatures . length == 0 ) { return ; } ; console . log ( 'finding matches' ) ; updateGbNames ( features ) ; function onSuccess ( allMatches ) { var bestMatches = calcBestMatches ( allMatches ) ; console . log ( allMatches ) console . log ( bestMatches ) updateTotalEquality ( allMatches , bestMatches , comparisonFeatures ) ; updateMatchTable ( bestMatches , comparisonFeatures ) ; } ; function onProgress ( i , total ) { document . querySelector ( '#total-similarity p' ) . innerText = 'Matching ' + i + ' of ' + total ; } ; calcAllSpatialRelations ( features , comparisonFeatures , onSuccess = onSuccess , onProgress = onProgress ) ; }
calc and update boundary unit relationships
calc and update boundary unit relationships
// clear old table rows if exists // get features  // add in main names while calculating // define on success // determine only the best matches // calc total equality from the perspective of both sources // update tables // calculate relations