Skip to content

Commit

Permalink
Add build_sindex arg to read_parquet_dask
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jan 22, 2021
1 parent d88a649 commit 5a702c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spatialpandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def to_parquet_dask(

def read_parquet_dask(
path, columns=None, filesystem=None, load_divisions=False,
geometry=None, bounds=None, categories=None,
geometry=None, bounds=None, categories=None, build_sindex=False
):
"""
Read spatialpandas parquet dataset(s) as DaskGeoDataFrame. Datasets are assumed to
Expand Down Expand Up @@ -207,6 +207,8 @@ def read_parquet_dask(
If a list, assumes up to 2**16-1 labels; if a dict, specify the number
of labels expected; if None, will load categories automatically for
data written by dask/fastparquet, not otherwise.
build_sindex : boolean
Whether to build partition level spatial indexes to speed up indexing.
Returns:
DaskGeoDataFrame
"""
Expand All @@ -233,6 +235,9 @@ def read_parquet_dask(
categories=categories
)

if build_sindex:
result = result.build_sindex()

return result


Expand Down

0 comments on commit 5a702c6

Please sign in to comment.