Skip to content

Commit

Permalink
not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixiong-tang committed Nov 12, 2023
1 parent 5df343c commit 579b109
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/geobuf/geobuf_plus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include "planet.hpp"
#include <spdlog/spdlog.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <mio/mio.hpp>
#include <sys/stat.h>
#include <sys/types.h>

namespace cubao
{
Expand All @@ -15,17 +15,26 @@ struct GeobufPlus
{
GeobufPlus() = default;
mio::shared_ummap_source mmap;
int num_features;
FlatGeobuf::PackedRTree rtree;

bool mmap_init(const std::string &path) {
bool mmap_init(const std::string &path)
{
mmap = std::make_shared<mio::ummap_source>(path);
int cursor = 10;
if (std::string((const char *)mmap.data(), cursor) != "GeobufPlus") {
spdlog::error("invalid geobuf plus file, wrong magic");
return false;
}
auto xx = mmap[cursor];
int num_features = *(const int*)(mmap.data() + cursor);
auto xx = mmap[cursor];
int num_features = *(const int *)(mmap.data() + cursor);
spdlog::info("#features: {}", num_features);

FlatGeobuf::NodeItem extent;
int num_items;
int num_nodes;
int node_size;

return true;
}

Expand Down

0 comments on commit 579b109

Please sign in to comment.