geoarrow / geoarrow-python

Python implementation of the GeoArrow specification
http://geoarrow.org/geoarrow-python/
Apache License 2.0
59 stars 3 forks source link

feat(geoarrow-pyarrow): Add `make_point()` helper #40

Closed paleolimbot closed 9 months ago

paleolimbot commented 9 months ago

Closes #33.

import geoarrow.pyarrow as ga
import numpy as np

# Basic
ga.make_point([1, 2, 3], [4, 5, 6])
#> PointArray:PointType(geoarrow.point)[3]
#> <POINT (1 4)>
#> <POINT (2 5)>
#> <POINT (3 6)>

# Zero copy for input arrays
xs = np.random.random(int(1e8))
ys = np.random.random(int(1e8))
%timeit ga.make_point(xs, ys)
#> 20.7 µs ± 57 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (53b05c5) 95.56% compared to head (0d77c9c) 95.62%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #40 +/- ## ========================================== + Coverage 95.56% 95.62% +0.05% ========================================== Files 10 10 Lines 1444 1462 +18 ========================================== + Hits 1380 1398 +18 Misses 64 64 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.