-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
494 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: "Build documentation" | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docs: | ||
name: "Build and deploy" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ammaraskar/sphinx-action@master | ||
with: | ||
docs-folder: "docs/" | ||
|
||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: documentation-html | ||
path: docs/_build/html/ | ||
|
||
- uses: shallwefootball/s3-upload-action@master | ||
with: | ||
aws_key_id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }} | ||
aws_bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }} | ||
source_dir: docs/_build/html/ | ||
destination_dir: census-map-consolidator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,6 @@ | ||
# census-map-consolidator | ||
### Links | ||
|
||
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](test_data/dtla.png) | ||
* 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,400;0,700;0,800;1,400;1,800&display=swap'); | ||
|
||
div.document { | ||
margin-top: 0; | ||
} | ||
|
||
div.body { | ||
min-width: 0 !important; | ||
} | ||
|
||
div.body p, div.body li { | ||
line-height: 1.45; | ||
} | ||
|
||
div.body li { | ||
margin-bottom: 4px; | ||
} | ||
|
||
div.topic { | ||
margin: 0; | ||
padding: 8px 12px; | ||
} | ||
|
||
p.topic-title { | ||
margin: 0; | ||
} | ||
|
||
div.topic ul { | ||
margin-top: 6px; | ||
} | ||
@media screen and (max-width: 870px) { | ||
ul { | ||
margin: 10px 0 10px 20px; | ||
} | ||
} | ||
|
||
div.sphinxsidebar h1.logo, | ||
div.sphinxsidebar h3 { | ||
font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; | ||
} | ||
|
||
div.sphinxsidebarwrapper h1.logo { | ||
font-size: 1.85em; | ||
font-weight: 800; | ||
} | ||
|
||
@media (min-width: 875px) { | ||
div.sphinxsidebar { | ||
margin-top: 85px; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 875px) { | ||
div.sphinxsidebar { | ||
width: auto; | ||
padding: 10px 20px; | ||
margin: 50px 0 0 0; | ||
} | ||
} | ||
|
||
div.admonition { | ||
padding: 15px; | ||
} | ||
|
||
div.warning { | ||
background-color: #EEE; | ||
border: 1px solid #CCC; | ||
} | ||
|
||
div.admonition p.admonition-title { | ||
font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; | ||
margin: 0; | ||
} | ||
|
||
div.related nav { | ||
padding-right: 10px; | ||
} | ||
|
||
body { | ||
font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; | ||
font-size: 20px; | ||
line-height: 1.45; | ||
text-align: left; | ||
} | ||
@media screen and (max-width: 875px) { | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
div.body > .section, | ||
div.body > section { | ||
padding: 0 20px; | ||
} | ||
} | ||
|
||
@media (max-width: 550px) { | ||
body { | ||
font-size: 0.85em; | ||
} | ||
} | ||
|
||
div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 { | ||
font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; | ||
font-weight: 700; | ||
} | ||
|
||
div.body h1 { | ||
font-weight: 800; | ||
font-size: 220%; | ||
} | ||
|
||
pre { | ||
padding: 7px; | ||
} | ||
|
||
.cell_output { | ||
overflow: auto; | ||
} | ||
|
||
.toctree-wrapper p.caption { | ||
font-weight: 700; | ||
} | ||
|
||
.toggle-details { | ||
display: none; | ||
} | ||
|
||
.row { | ||
width: 100%; | ||
max-width: 660px; | ||
margin: 0 auto; | ||
overflow: hidden; | ||
} | ||
.row .fivecol { | ||
width: 43%; | ||
float: right; | ||
min-height: 1px; | ||
} | ||
.row .sevencol { | ||
width: 37%; | ||
float: left; | ||
min-height: 1px; | ||
} | ||
@media (max-width: 550px) { | ||
.row .fivecol, .row .sevencol { | ||
padding: 0 20px; | ||
} | ||
} | ||
|
||
/* The header */ | ||
nav { | ||
display: block; | ||
margin-top: 0.75em; | ||
margin-bottom: 0.5em; | ||
font-size: 1em; | ||
line-height: 1.7em; | ||
} | ||
nav .shingle { | ||
font-size: 1.7em; | ||
font-weight: bold; | ||
text-align: left; | ||
padding-left: 0.15em; | ||
} | ||
nav .shingle a { | ||
text-decoration: none; | ||
font-weight: bold; | ||
color: #000; | ||
} | ||
nav .shingle a:hover { | ||
color: #686868; | ||
} | ||
@media (max-width: 550px) { | ||
nav .shingle { | ||
float: left; | ||
margin-bottom: 5px; | ||
padding-left: 0; | ||
} | ||
} | ||
nav .links { | ||
text-align: right; | ||
} | ||
nav .links ul { | ||
float: right; | ||
list-style-type: none; | ||
margin: 4px 0 0 0; | ||
} | ||
nav .links li { | ||
float: left; | ||
list-style-position: inside; | ||
margin-left: 0.5em; | ||
font-size: 0.9em; | ||
font-weight: 300; | ||
margin-bottom: 0; | ||
} | ||
@media (max-width: 550px) { | ||
nav .links li { | ||
font-size: .825em; | ||
} | ||
} | ||
nav .links li a { | ||
text-decoration: none; | ||
} | ||
nav .links li a:hover { | ||
text-decoration: underline; | ||
} | ||
.last { | ||
margin-right: 0; | ||
} | ||
|
||
.topbar { | ||
border-bottom: solid 10px #e5e5e5; | ||
margin-bottom: 20px; | ||
width: 100%; | ||
} | ||
|
||
a:link { | ||
text-decoration: none; | ||
color: #686868; | ||
} | ||
a:visited { | ||
text-decoration: none; | ||
color: #686868; | ||
} | ||
a:hover { | ||
text-decoration: underline; | ||
} | ||
a:active { | ||
text-decoration: underline; | ||
color: #000; | ||
} | ||
|
||
.contents ul p { | ||
margin-bottom: 0; | ||
} |
File renamed without changes
Oops, something went wrong.