Skip to content

Commit

Permalink
Script to write nz-building-outlines to geoparquet 0.4.0 (#87)
Browse files Browse the repository at this point in the history
* Script to write nz-building-outlines to parquet

* Fix script, update dependencies

* Update readme

* Revert pyogrio

* Ignore "does not contain geometry" warnings

* changes from review + use projjson

* Save a few bytes by removing whitespace
  • Loading branch information
kylebarron committed May 26, 2022
1 parent 69eec8f commit 56ea704
Show file tree
Hide file tree
Showing 5 changed files with 1,456 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore GeoPackage file used in conversion to GeoParquet
*.gpkg*
31 changes: 30 additions & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ The scripts in this directory use [Poetry](https://github.com/python-poetry/poet

To install Poetry, follow the Poetry [installation guide](https://python-poetry.org/docs/#installation).

To install from the lockfile, run `poetry install`. To update the lockfile (such as when you add a new dependency) run `poetry update`.
To install from the lockfile:

```
poetry install
```

To update the lockfile (such as when you add a new dependency):

```
poetry update
```

To run a script, prefix it with `poetry run`. For example:

Expand All @@ -15,3 +25,22 @@ poetry run python update_example_schemas.py
```

Using `poetry run` ensures that you're running the python script using _this_ local environment, not your global environment.

### nz-building-outlines to Parquet

```bash
poetry run python write_nz_building_outline.py \
--input nz-building-outlines.gpkg \
--output nz-building-outlines.parquet \
--compression SNAPPY
```

#### Recompile pygeos

Poetry doesn't currently have a way to force installing a package from source.
To make the script run faster, you can reinstall pygeos manually in the
virtualenv:

```
poetry run pip install -U --force-reinstall pygeos --no-binary pygeos
```
Loading

0 comments on commit 56ea704

Please sign in to comment.