Skip to content

Commit 3abc3aa

Browse files
index geobuf (#26)
* add geobuf plus * not ready * it should work * export * good * not ready * export geobuf plus * export geobuf + index * good * not ready * not ready * add header * not ready * not ready * notready * invalid tag exception? * not ready * not ready * not ready * not good * good * this is better * extract geometry/properties * not ready * good * not ready * good * rename * fix * update * good * good * not ready * fix * fix lint * supports int/string get/set * add test * fix for windows --------- Co-authored-by: TANG ZHIXIONG <zhixiong.tang@momenta.ai>
1 parent 8e34a97 commit 3abc3aa

File tree

12 files changed

+984
-77
lines changed

12 files changed

+984
-77
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ benchmarks/*.pbf*
99
# https://github.com/cubao/nano-fmm/blob/master/data/Makefile
1010
data/suzhoubeizhan.json
1111
tests/*.json
12+
data/suzhoubeizhan.idx

docs/about/release-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ To upgrade `pybind11-geobuf` to the latest version, use pip:
1010
pip install -U pybind11-geobuf
1111
```
1212

13+
## Version 0.1.9 (2023-11-15)
14+
15+
* Indexing geobuf (like flatgeobuf, but more general), making it random accessible
16+
1317
## Version 0.1.8 (2023-11-11)
1418

1519
* Fix readthedocs

pybind11_geobuf/__main__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from loguru import logger
55

66
from pybind11_geobuf import rapidjson # noqa
7-
from pybind11_geobuf import Decoder, Encoder # noqa
7+
from pybind11_geobuf import Decoder, Encoder, GeobufIndex # noqa
88
from pybind11_geobuf import is_subset_of as is_subset_of_impl # noqa
99
from pybind11_geobuf import normalize_json as normalize_json_impl # noqa
1010
from pybind11_geobuf import pbf_decode as pbf_decode_impl # noqa
@@ -210,13 +210,22 @@ def is_subset_of(path1: str, path2: str):
210210
assert is_subset_of_impl(path1, path2)
211211

212212

213+
def index_geobuf(input_geobuf_path: str, output_index_path: str):
214+
os.makedirs(
215+
os.path.dirname(os.path.abspath(output_index_path)),
216+
exist_ok=True,
217+
)
218+
return GeobufIndex.indexing(input_geobuf_path, output_index_path)
219+
220+
213221
if __name__ == "__main__":
214222
import fire
215223

216224
fire.core.Display = lambda lines, out: print(*lines, file=out)
217225
fire.Fire(
218226
{
219227
"geobuf2json": geobuf2json,
228+
"index_geobuf": index_geobuf,
220229
"is_subset_of": is_subset_of,
221230
"json2geobuf": json2geobuf,
222231
"normalize_geobuf": normalize_geobuf,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def build_extension(self, ext):
127127
# logic and declaration, and simpler if you include description/version in a file.
128128
setup(
129129
name="pybind11_geobuf",
130-
version="0.1.8",
130+
version="0.1.9",
131131
author="tzx",
132132
author_email="dvorak4tzx@gmail.com",
133133
url="https://geobuf-cpp.readthedocs.io",

0 commit comments

Comments
 (0)