コード例 #1
0
ファイル: ExtractROIData.php プロジェクト: alonso/fusion
function SaveROI(&$aROI, $szFileName)
{
    $aPuntos = ProcesaROI(&$aROI);
    $nPoints = count($aPuntos);
    if ($nPoints > 0) {
        if ($aROI['type'] == 'rectangle') {
            updatePolDBFRecord($szFileName, array(-1, $aROI['type'], -1, -1, $aROI['label']), -1, $aPuntos);
        } elseif ($aROI['type'] == 'polygon') {
            updatePolDBFRecord($szFileName, array(-1, $aROI['type'], -1, -1, $aROI['label']), -1, $aPuntos);
        } elseif ($aROI['type'] == 'line') {
            updateLinDBFRecord($szFileName, array(-1, -1, $aROI['label']), -1, $aPuntos);
        } elseif ($aROI['type'] == 'point') {
            updatePtoDBFRecord($szFileName, array(-1, $aPuntos[0], $aPuntos[1], $aROI['label']), -1, $aPuntos);
        }
    }
    return true;
}
コード例 #2
0
ファイル: Save.php プロジェクト: alonso/fusion
function SaveROI(&$aROI, $szFileName, $sZFileNameGeo, $formats, $mapProj, $geoProj, $debug)
{
    $aPuntos = ProcesaROI(&$aROI);
    fwrite($debug, "\$aPuntos = " . print_r($aPuntos, true) . "\n");
    $nPoints = count($aPuntos);
    if ($nPoints > 0) {
        switch ($aROI['type']) {
            case 'rectangle':
                updatePolDBFRecord($szFileName, array(-1, $aROI['type'], -1, -1, $aROI['label']), -1, $aPuntos);
                break;
            case 'polygon':
                fwrite($debug, "Updating shapefile {$szFileName}\n");
                updatePolDBFRecord($szFileName, $sZFileNameGeo, $formats, $mapProj, $geoProj, array(-1, $aROI['type'], -1, -1, $aROI['label']), -1, $aPuntos, $debug);
                fwrite($debug, "Shapefile {$szFileName} updated\n");
                break;
            case 'line':
                updateLinDBFRecord($szFileName, array(-1, -1, $aROI['label']), -1, $aPuntos);
                break;
            case 'point':
                updatePtoDBFRecord($szFileName, array(-1, $aPuntos[0], $aPuntos[1], $aROI['label']), -1, $aPuntos);
                break;
            default:
                break;
        }
    }
    return true;
}