Skip to content

Commit 980430d

Browse files
committed
not ready
1 parent 6d3d435 commit 980430d

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project(geobuf)
33

44
set(CUBAO_INCLUDE ${PROJECT_SOURCE_DIR}/headers/include)
55
include(${CUBAO_INCLUDE}/utils.cmake)
6-
# set(CMAKE_BUILD_TYPE Debug)
6+
set(CMAKE_BUILD_TYPE Debug)
77

88
activate_common_configuration()
99
auto_build_type_and_compile_flags()

src/geobuf/geobuf.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,15 @@ void Decoder::decode_header(const uint8_t *data, std::size_t size)
677677
mapbox::geojson::feature Decoder::decode_feature(const uint8_t *data,
678678
std::size_t size)
679679
{
680+
dbg("here");
681+
std::cout << std::endl;
680682
auto pbf =
681683
protozero::pbf_reader{reinterpret_cast<const char *>(data), size};
682-
if (!pbf.next() || pbf.tag() != 1) {
684+
dbg("not ready");
685+
if (dbg(pbf.tag()) != 1) {
683686
return {};
684687
}
688+
dbg("??");
685689
protozero::pbf_reader pbf_f = pbf.get_message();
686690
return readFeature(pbf_f);
687691
}

src/geobuf/geobuf_plus.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct GeobufPlus
8787
sizeof(offsets[0]) * num_offsets);
8888
cursor += sizeof(offsets[0]) * num_offsets;
8989
spdlog::info("offsets: [{}, ..., {}]", offsets.front(), offsets.back());
90+
dbg(offsets);
9091

9192
padding = *reinterpret_cast<const int *>(data + cursor);
9293
cursor += sizeof(padding);
@@ -114,12 +115,13 @@ struct GeobufPlus
114115

115116
mapbox::geojson::feature decode_feature(int index)
116117
{
117-
return decode_feature(mmap.data() + offsets[index],
118-
offsets[index + 1] - offsets[index]);
118+
return decode_feature(mmap.data() + dbg(offsets[index]),
119+
dbg(offsets[index + 1] - offsets[index]));
119120
}
120121

121122
mapbox::geojson::feature decode_feature(const uint8_t *data, size_t size)
122123
{
124+
dbg(size);
123125
return decoder.decode_feature(data, size);
124126
}
125127

tests/test_geobuf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,7 @@ def test_query():
18981898
print(GeobufPlus.encode(ipath, opath_idx, opath_pbf))
18991899
gbp = GeobufPlus()
19001900
print(gbp.mmap_init(opath_idx, opath_pbf))
1901+
f = gbp.decode_feature(0)
19011902

19021903
np.set_printoptions(suppress=True)
19031904
pwd = os.path.abspath(os.path.dirname(__file__))

0 commit comments

Comments
 (0)