Skip to content

Commit

Permalink
Boom
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Nov 28, 2022
1 parent c77de2e commit 119518a
Show file tree
Hide file tree
Showing 13 changed files with 514 additions and 838 deletions.
52 changes: 33 additions & 19 deletions .github/workflows/continuous-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install pipenv
run: pipx install pipenv

- uses: actions/setup-python@v3
- id: setup-python
name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pipenv'

- id: pipenv-install
- id: install-pipenv
name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
shell: bash

- id: install-python-dependencies
name: Install Python dependencies
run: pipenv install --dev --python `which python`
run: pipenv install --dev --python=`which python`
shell: bash

- id: run
name: Run
Expand All @@ -37,17 +42,21 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install pipenv
run: pipx install pipenv

- uses: actions/setup-python@v3
- id: setup-python
name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: '3.9'
cache: 'pipenv'

- id: pipenv-install
- id: install-pipenv
name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
shell: bash

- id: install-python-dependencies
name: Install Python dependencies
run: pipenv install --skip-lock --python `which python`
run: pipenv install --dev --python=`which python`
shell: bash

- id: run
Expand All @@ -63,17 +72,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install pipenv
run: pipx install pipenv

- uses: actions/setup-python@v3
- id: setup-python
name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pipenv'

- id: pipenv-install
- id: install-pipenv
name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
shell: bash

- id: install-python-dependencies
name: Install Python dependencies
run: pipenv install --dev --python `which python`
run: pipenv install --dev --python=`which python`
shell: bash

- id: build
name: Build release
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/docs.yaml

This file was deleted.

742 changes: 417 additions & 325 deletions Pipfile.lock

Large diffs are not rendered by default.

66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
### Links
# census-map-consolidator

Combine Census blocks into new shapes.

### Installation

```bash
pipenv install census-map-consolidator
```

### Usage

Create a list of Census block GEOIDs. That can be simple like this:

```python
your_block_list = ["060371976001008", "060371976001009"]
```

Or read in from a file like this:

```python
with open("test_data/dtla.csv", "r") as f:
your_block_list = f.read().splitlines()
```

Import our class.

```python
from census_map_consolidator import BlockConsolidator
```

Pass in the block list as arguments.

```python
c = BlockConsolidator(*your_block_list)
```

Consolidate the blocks into a single shape. This can take a minute. Big shapefiles have to be downloaded.

```python
c.consolidate()
```

Write out the new shape. You can do GeoJSON.

```python
c.write("./your-new-shape.geojson")
```

Or shapefiles.

```python
c.write("./your-new-shape.shp")
```

That's it. You can inspect your work however you like. But [geojsonio](https://github.com/mapbox/geojsonio-cli) is handy.

```bash
geojsonio < your-new-shape.geojson
```

![dtla](_static/dtla.png)

## Links

* Docs: [palewi.re/docs/census-map-consolidator/](https://palewi.re/docs/census-map-consolidator/)
* Issues: [github.com/datadesk/census-map-consolidator/issues](https://github.com/datadesk/census-map-consolidator/issues)
* Packaging: [pypi.python.org/pypi/census-map-consolidator](https://pypi.python.org/pypi/census-map-consolidator)
* Testing: [github.com/datadesk/census-map-consolidator/actions](https://github.com/datadesk/census-map-consolidator/actions)
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

Loading

0 comments on commit 119518a

Please sign in to comment.