geoarrow / geoarrow-python

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

feat: Add `read_pyogrio_table()` #22

Closed paleolimbot closed 1 year ago

paleolimbot commented 1 year ago

...lifted from https://github.com/geoarrow/geoarrow-data/blob/main/ogr_to_geoarrow.py that was used to make example data. This is useful because you can get pretty much any data as geoarrow with pretty minimal code. It can be faster than reading through GeoPandas (but that's not the primary motivation):

from geoarrow.pyarrow import io

tab = io.read_pyogrio_table("https://raw.githubusercontent.com/geoarrow/geoarrow-data/v0.1.0/example/example-linestring.gpkg")
tab.column("geom").chunk(0).geobuffers()
#> [None,
#>  array([0, 3, 3, 3], dtype=int32),
#>  array([30., 10., 40.]),
#>  array([10., 30., 40.])]
codecov[bot] commented 1 year ago

Codecov Report

Merging #22 (32e04c5) into main (5d2f08e) will increase coverage by 0.06%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   94.49%   94.56%   +0.06%     
==========================================
  Files           9       10       +1     
  Lines        1218     1233      +15     
==========================================
+ Hits         1151     1166      +15     
  Misses         67       67              
Files Coverage Δ
geoarrow-pyarrow/src/geoarrow/pyarrow/io.py 100.00% <100.00%> (ø)