Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RaczeQ authored Sep 25, 2024
2 parents 4d5a3b3 + 3689a4d commit 9d3fed6
Show file tree
Hide file tree
Showing 17 changed files with 280 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
key: mkdocs-osm-dev-cache-${{ runner.os }}
- name: Prepare DuckDB dependency
run: |
wget https://github.com/duckdb/duckdb/releases/download/v0.10.2/duckdb_cli-linux-amd64.zip
wget https://github.com/duckdb/duckdb/releases/download/v1.1.0/duckdb_cli-linux-amd64.zip
unzip duckdb_cli-linux-amd64.zip
chmod a+x ./duckdb
- name: Test required commands
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
key: mkdocs-osm-dev-cache-${{ runner.os }}
- name: Prepare DuckDB dependency
run: |
wget https://github.com/duckdb/duckdb/releases/download/v0.10.2/duckdb_cli-linux-amd64.zip
wget https://github.com/duckdb/duckdb/releases/download/v1.1.0/duckdb_cli-linux-amd64.zip
unzip duckdb_cli-linux-amd64.zip
chmod a+x ./duckdb
- name: Test required commands
Expand Down
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Option to export to DuckDB database [#94](https://github.com/kraina-ai/quackosm/issues/119)

## [0.11.0] - 2024-09-24

### Changed

- Bumped minimal DuckDB version to `1.1.0`
- Refactored geoparquet operations for compatibility with new DuckDB version
- Excluded `conftest.py` file from the final library build
- Replaced `unary_union` calls with `union_all()` on all GeoDataFrames
- Silenced `pooch` library warnings regarding empty SHA hash

## [0.10.0] - 2024-09-23

### Changed

- **BREAKING** Changed required minimal number of points in polygon from 3 to 4
- Added removal of repeated points in linestrings

### Fixed

- Removed support for yanked polars version `1.7.0`

## [0.9.4] - 2024-09-11

### Changed
Expand Down Expand Up @@ -366,7 +387,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Created QuackOSM repository
- Implemented PbfFileReader

[Unreleased]: https://github.com/kraina-ai/quackosm/compare/0.9.4...HEAD
[Unreleased]: https://github.com/kraina-ai/quackosm/compare/0.11.0...HEAD

[0.11.0]: https://github.com/kraina-ai/quackosm/compare/0.10.0...0.11.0

[0.10.0]: https://github.com/kraina-ai/quackosm/compare/0.9.4...0.10.0

[0.9.4]: https://github.com/kraina-ai/quackosm/compare/0.9.3...0.9.4

Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ QuackOSM supports **Python >= 3.9**

Required:

- `duckdb (>=0.10.2, <1.1.0)`: For all DuckDB operations on PBF files
- `duckdb (>=1.1.0)`: For all DuckDB operations on PBF files

- `pyarrow (>=16.0.0)`: For parquet files wrangling

Expand Down Expand Up @@ -148,9 +148,7 @@ way/993121275 {'building': 'yes', 'name': ... POLYGON ((7.43214 43.7481...
```python
>>> import duckdb
>>> duckdb.load_extension('spatial')
>>> duckdb.read_parquet(str(gpq_path)).project(
... "* REPLACE (ST_GeomFromWKB(geometry) AS geometry)"
... ).order("feature_id")
>>> duckdb.read_parquet(str(gpq_path)).order("feature_id")
┌──────────────────┬──────────────────────┬──────────────────────────────────────────────┐
│ feature_id │ tags │ geometry │
│ varchar │ map(varchar, varch… │ geometry │
Expand Down Expand Up @@ -270,9 +268,7 @@ way/998561139 {'barrier': 'bollard', 'bicyc... LINESTRING (12.45828 41.9...
```python
>>> import duckdb
>>> duckdb.load_extension('spatial')
>>> duckdb.read_parquet(str(gpq_path)).project(
... "* REPLACE (ST_GeomFromWKB(geometry) AS geometry)"
... ).order("feature_id")
>>> duckdb.read_parquet(str(gpq_path)).order("feature_id")
┌──────────────────┬──────────────────────┬──────────────────────────────────────────────┐
│ feature_id │ tags │ geometry │
│ varchar │ map(varchar, varch… │ geometry │
Expand Down Expand Up @@ -388,9 +384,7 @@ relation/3256168 {'building': 'yes', 'type': ... POLYGON ((12.46061 41.907...
```python
>>> import duckdb
>>> duckdb.load_extension('spatial')
>>> duckdb.read_parquet(str(gpq_path)).project(
... "* REPLACE (ST_GeomFromWKB(geometry) AS geometry)"
... ).order("feature_id")
>>> duckdb.read_parquet(str(gpq_path)).order("feature_id")
┌──────────────────┬────────────────────────────┬──────────────────────────────┐
│ feature_id │ tags │ geometry │
│ varchar │ map(varchar, varchar) │ geometry │
Expand Down
12 changes: 3 additions & 9 deletions examples/pbf_file_reader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@
"connection.load_extension(\"parquet\")\n",
"connection.load_extension(\"spatial\")\n",
"\n",
"features_relation = connection.read_parquet(str(reykjavik_buildings_gpq)).project(\n",
" \"* REPLACE (ST_GeomFromWKB(geometry) AS geometry)\"\n",
")\n",
"features_relation = connection.read_parquet(str(reykjavik_buildings_gpq))\n",
"features_relation"
]
},
Expand Down Expand Up @@ -190,9 +188,7 @@
"metadata": {},
"outputs": [],
"source": [
"features_relation = connection.read_parquet(str(estonia_features_gpq)).project(\n",
" \"* REPLACE (ST_GeomFromWKB(geometry) AS geometry)\"\n",
")\n",
"features_relation = connection.read_parquet(str(estonia_features_gpq))\n",
"features_relation"
]
},
Expand Down Expand Up @@ -294,9 +290,7 @@
"metadata": {},
"outputs": [],
"source": [
"features_relation = connection.read_parquet(str(liechtenstein_features_gpq)).project(\n",
" \"* REPLACE (ST_GeomFromWKB(geometry) AS geometry)\"\n",
")\n",
"features_relation = connection.read_parquet(str(liechtenstein_features_gpq))\n",
"features_relation"
]
},
Expand Down
70 changes: 35 additions & 35 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "QuackOSM"
version = "0.9.4"
version = "0.11.0"
description = "An open-source tool for reading OpenStreetMap PBF files using DuckDB"
authors = [{ name = "Kamil Raczycki", email = "[email protected]" }]
dependencies = [
"geopandas>=0.6",
"shapely>=2",
"pyarrow>=16.0.0",
"duckdb>=0.10.2,<1.1.0",
"duckdb>=1.1.0",
"geoarrow-pyarrow>=0.1.2",
"geoarrow-pandas>=0.1.1",
"typeguard>=3.0.0",
Expand All @@ -16,7 +16,7 @@ dependencies = [
"tqdm>=4.42.0",
"beautifulsoup4",
"requests",
"polars>=0.19.4",
"polars>=0.19.4,!=1.7.0",
"rich>=12.0.0",
"geopy>=2.0.0",
"numpy>=1.26.0",
Expand Down Expand Up @@ -109,6 +109,9 @@ cli-dev = ["ipywidgets", "folium", "matplotlib>=3.2.0", "mapclassify"]
[tool.pdm.scripts]
post_install = "pre-commit install"

[tool.pdm.build]
excludes = ["quackosm/conftest.py"]

[tool.black]
line-length = 100
target-version = ["py39", "py310", "py311", "py312"]
Expand Down Expand Up @@ -170,7 +173,7 @@ close-quotes-on-newline = true
wrap-one-line = true

[tool.bumpver]
current_version = "0.9.4"
current_version = "0.11.0"
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
commit_message = "chore(CI/CD): bump version {old_version} -> {new_version}"
commit = true
Expand Down
2 changes: 1 addition & 1 deletion quackosm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from quackosm.pbf_file_reader import PbfFileReader

__app_name__ = "QuackOSM"
__version__ = "0.9.4"
__version__ = "0.11.0"

__all__ = [
"PbfFileReader",
Expand Down
4 changes: 4 additions & 0 deletions quackosm/_geopandas_api_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import geopandas as gpd
from packaging import version

GEOPANDAS_NEW_API = version.parse(gpd.__version__) >= version.parse("1.0.0")
Loading

0 comments on commit 9d3fed6

Please sign in to comment.