Load Census shapefiles into PostGIS
Project description

# census_pgeoloader
Command line utility to download Census TIGER/Line shapefiles by state from the U.S. Census Bureau and aggregate them into a single table in a PostGIS-enabled database.
# Requirements
Uses [shp2pgsql](http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg). Assumes PostgreSQL + PostGIS.
# To install
```bash
$ pip install census_pgeoloader
```
# To use
Pass a connection URI to your PostgreSQL database as well as the states you'd like to aggregate. This will dowload tract-level shapefiles by default.
```bash
$ pgeoloader postgres://postgres@localhost:5432/database KS MO TX VA ...
```
Valid values for states are FIPS codes, postal abbreviations or names. Pass `+` to collect all states.
# Options
```bash
Options:
-t, --table TEXT Name of table to create in DB. Default is
"census_shapes".
-p, --temp TEXT Directory to download files to. Default is
"./shapefiles"
-y, --year TEXT Year. Default is "2016".
-g, --geo [tract|group|block] Geographic unit. Default is "tract".
-s, --srid TEXT Specify an SRID transform, e.g., "4269:4326".
Default is "4269".
--help Show this message and exit.
```
#### Notes:
- `--table` Drops any existing table by that name in the database.
- `--geo` Can pull tracts, block groups or blocks.
- `--srid` Default SRID should be 4269, but you can specify a transform with this option as available in [shp2pgsql](http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg).
©2017 POLITICO
# census_pgeoloader
Command line utility to download Census TIGER/Line shapefiles by state from the U.S. Census Bureau and aggregate them into a single table in a PostGIS-enabled database.
# Requirements
Uses [shp2pgsql](http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg). Assumes PostgreSQL + PostGIS.
# To install
```bash
$ pip install census_pgeoloader
```
# To use
Pass a connection URI to your PostgreSQL database as well as the states you'd like to aggregate. This will dowload tract-level shapefiles by default.
```bash
$ pgeoloader postgres://postgres@localhost:5432/database KS MO TX VA ...
```
Valid values for states are FIPS codes, postal abbreviations or names. Pass `+` to collect all states.
# Options
```bash
Options:
-t, --table TEXT Name of table to create in DB. Default is
"census_shapes".
-p, --temp TEXT Directory to download files to. Default is
"./shapefiles"
-y, --year TEXT Year. Default is "2016".
-g, --geo [tract|group|block] Geographic unit. Default is "tract".
-s, --srid TEXT Specify an SRID transform, e.g., "4269:4326".
Default is "4269".
--help Show this message and exit.
```
#### Notes:
- `--table` Drops any existing table by that name in the database.
- `--geo` Can pull tracts, block groups or blocks.
- `--srid` Default SRID should be 4269, but you can specify a transform with this option as available in [shp2pgsql](http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg).
©2017 POLITICO
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size census_pgeoloader-0.2.0-py2.py3-none-any.whl (6.0 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size census_pgeoloader-0.2.0.tar.gz (3.6 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for census_pgeoloader-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 325c748212ec62a6e01d46475b714a75f7b11817de884bec574cef2a697703e7 |
|
MD5 | e1ad9ddc4c9c2e55559acb66304c8d6f |
|
BLAKE2-256 | ca0ca12501cdfff0fca1c950bc289e95aa79f2e7f8af5d640976513e7158f08f |