Exemplo n.º 1
0
def task_download_place_boundaries():
    """
    Download place boundaries for each relevant state
    """
    tiger = TIGER()
    for state in list_states():
        yield {
            'name': state,
            'file_dep': [util.path.CONFIG_PATH],
            'actions': [(tiger.download_place_boundaries, (state, ))],
            'targets': [tiger.place_boundaries_path(state)],
            'uptodate': [doit.tools.run_once],
        }
Exemplo n.º 2
0
def task_create_tiger_directories():
    """
    Create TIGER's directories
    """
    tiger = TIGER()
    return {
        'file_dep': [util.path.CONFIG_PATH],
        'targets': tiger.directories,
        'actions': [tiger.create_directories],
        'uptodate': [True],
    }
Exemplo n.º 3
0
def task_download_county_boundaries():
    """
    Download county boundaries from the TIGER shapefiles
    """
    tiger = TIGER()
    file = tiger.county_boundaries_path
    return {
        'file_dep': [util.path.CONFIG_PATH],
        'targets': [file],
        'actions': [tiger.download_county_boundaries],
        'uptodate': [doit.tools.run_once],
    }
Exemplo n.º 4
0
def task_download_state_boundaries():
    """
    Download state boundaries from the ACS website
    """
    tiger = TIGER()
    file = tiger.state_boundaries_path
    return {
        'file_dep': [util.path.CONFIG_PATH],
        'targets': [file],
        'actions': [tiger.download_state_boundaries],
        'uptodate': [True],
    }
Exemplo n.º 5
0
def task_guess_states():
    """
    Guess the state for each department
    """
    tiger = TIGER()
    for dept in Department.list():
        yield {
            'name':
            dept.name,
            'file_dep': [
                tiger.state_boundaries_path,
                dept.preprocessed_shapefile_path,
            ],
            'targets': [dept.guessed_state_path],
            'actions': [dept.guess_state],
            'clean':
            True,
        }