コード例 #1
0
def process_options(arg_list=None):
    """"""

    parser = utils.add_census_options(ArgumentParser(), ACS_MOD)
    parser.add_argument(
        '-l', '--span', '--length',
        default=5,
        choices=ACS_SPANS,
        help='number of years that ACS data product covers'
    )
    parser = utils.add_postgres_options(parser)

    options = parser.parse_args(arg_list)
    return options
コード例 #2
0
def process_options(arglist=None):
    """Define options that users can pass through the command line, in this
    case these are all postgres database parameters"""

    parser = utils.add_census_options(ArgumentParser(), TIGER_MOD)
    parser.add_argument(
        '-dp', '--data_product',
        nargs='+',
        default=['b', 'bg', 't'],
        choices=['b', 'bg', 't'],
        dest='product',
        help='desired TIGER data product, choices are: '
             '"b": blocks, "bg": block groups, "t": tracts'
    )
    parser.add_argument(
        '-t', '--transform',
        default=None,
        type=int,
        dest='epsg',
        help='TIGER data comes from the census bureau in the projection '
             '4269, pass an EPSG code to this parameter to transform '
             'the geometry to another spatial reference system'
    )
    parser.add_argument(
        '-nfk', '--no_foreign_key',
        default=True,
        dest='foreign_key',
        action='store_false',
        help='by default a foreign key to the ACS data is created if that '
             'data exists, use this flag to disable that constraint'
    )
    parser = utils.add_postgres_options(parser)

    parser.set_defaults(shp=None)
    options = parser.parse_args(arglist)
    return options
コード例 #3
0
def process_options(arglist=None):
    """Define options that users can pass through the command line, in this
    case these are all postgres database parameters"""

    parser = utils.add_census_options(ArgumentParser(), TIGER_MOD)
    parser.add_argument(
        '-dp', '--data_product',
        nargs='+',
        default=['b', 'bg', 't'],
        choices=['b', 'bg', 't'],
        dest='product',
        help='desired TIGER data product, choices are: '
             '"b": blocks, "bg": block groups, "t": tracts'
    )
    parser.add_argument(
        '-t', '--transform',
        default=None,
        type=int,
        dest='epsg',
        help='TIGER data comes from the census bureau in the projection'
             '4269, pass an EPSG code to this parameter to transform'
             'the geometry to another spatial reference system'
    )
    parser.add_argument(
        '-nfk', '--no_foreign_key',
        default=True,
        dest='foreign_key',
        action='store_false',
        help='by default a foreign key to the ACS data is created if that'
             'data exists, use this flag to disable that constraint'
    )
    parser = utils.add_postgres_options(parser)

    parser.set_defaults(shp=None)
    options = parser.parse_args(arglist)
    return options