Skip to content

Commit

Permalink
supports WGS84 (used by GPS) (#14)
Browse files Browse the repository at this point in the history
* update version

* update headers, pybind11

* add sample data

* add sample data

* handles wgs84

* add images

* add docs

* fix

* fix windows

* skip linux tests for arm

* fix CI

* fix windows, utf8
  • Loading branch information
district10 authored Mar 4, 2023
1 parent 54999de commit e88979b
Show file tree
Hide file tree
Showing 34 changed files with 10,862 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
run: pip install --verbose .[test]

- name: Test
if: ${{ !startsWith(matrix.platform, 'macos') }}
if: ${{ startsWith(matrix.platform, "ubuntu") }}
run: python -m pytest
17 changes: 13 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,29 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- uses: pypa/[email protected]
env:
CIBW_ARCHS: auto64
CIBW_BEFORE_BUILD: pip install numpy scipy --prefer-binary
# CIBW_ARCHS: auto64
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_WINDOWS: AMD64 # ARM64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD: pip install numpy scipy fire --prefer-binary
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
CIBW_SKIP: pp* *i686 *musllinux*
CIBW_TEST_SKIP: "*macosx*"
CIBW_TEST_SKIP: "*macosx* *win* *aarch64"

- name: Verify clean directory
run: git diff --exit-code
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ python_test:
docs_build:
mkdocs build
docs_serve:
mkdocs serve
mkdocs serve -a 0.0.0.0:8088

# conda create -y -n py36 python=3.6
# conda create -y -n py37 python=3.7
Expand Down
6 changes: 5 additions & 1 deletion concave_hull/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pybind11_concave_hull import ( # noqa
concave_hull_indexes as concave_hull_indexes_impl,
)
from pybind11_concave_hull import wgs84_to_east_north
from scipy.spatial import ConvexHull


Expand All @@ -14,6 +15,7 @@ def concave_hull_indexes(
concavity: float = 2.0,
length_threshold: float = 0.0,
convex_hull_indexes: np.ndarray = None,
is_wgs84: bool = False,
):
"""
Get concave hull indexes of points.
Expand All @@ -30,14 +32,16 @@ def concave_hull_indexes(
"""
points = np.asarray(points, dtype=np.float64)
points = points[:, :2]
if is_wgs84:
points = wgs84_to_east_north(points)
if convex_hull_indexes is None:
convex_hull = ConvexHull(points)
convex_hull_indexes = convex_hull.vertices.astype(np.int32)
return concave_hull_indexes_impl(
points,
convex_hull_indexes=convex_hull_indexes,
concavity=concavity,
length_threshold=length_threshold,
convex_hull_indexes=convex_hull_indexes,
)


Expand Down
Binary file removed data/enus.npy
Binary file not shown.
1 change: 1 addition & 0 deletions docs/about/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The legal stuff.

* [pybind/pybind11](https://github.com/pybind/pybind11/blob/master/LICENSE) (BSD)
* [mapbox/concaveman](https://github.com/mapbox/concaveman/blob/master/LICENSE) (ISC)
* [mapbox/cheap-ruler](https://github.com/mapbox/cheap-ruler/blob/master/LICENSE) (ISC)
* [sadaszewski/concaveman-cpp](https://github.com/sadaszewski/concaveman-cpp/blob/master/LICENSE) (BSD)

## License (MIT)
Expand Down
19 changes: 14 additions & 5 deletions docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,26 @@ To upgrade `concave_hull` to the latest version, use pip:
pip install -U concave_hull
```

## Version 0.0.2 (2023-03-03)
## Version 0.0.5 (2023-03-04)

* Release to pypi on GitHub workflow
* Add macOS, Linux arm64 release
* Supports WGS84 data, add `is_wgs84:bool=False` parameter

## Version 0.0.1 (2022-10-14)
## Version 0.0.4 (2023-03-03)

* Auto release to pypi

## Version 0.0.3 (2023-03-02)

* Integrate scipy ConvexHull, add API: `concave_hull(points, *args, **kwargs)`

## Version 0.0.2 (2023-10-05)

* First release to pypi

---

You can also checkout release on:
You can also checkout releases on:

- GitHub: <https://github.com/cubao/concave_hull/releases>
- pypi: <https://pypi.org/project/concave-hull>
- PyPi: <https://pypi.org/project/concave-hull>
Loading

0 comments on commit e88979b

Please sign in to comment.