Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ repos:
- id: remove-tabs
exclude: ^(docs|Makefile)

- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
Expand Down
8 changes: 4 additions & 4 deletions data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# so these download links 100% guarantee exatly same files across time.

all:
@echo use "make pull" to pull data
@echo use "make clean" to clean data
@echo use "make pull" to pull data
@echo use "make clean" to clean data

.PHONY: all pull clean
clean:
@find . -maxdepth 1 ! -name Makefile ! -name . ! -name .. -exec rm -rf {} +
@find . -maxdepth 1 ! -name Makefile ! -name . ! -name .. -exec rm -rf {} +

pull: schema
schema:
wget https://json-schema.org/draft/2020-12/schema
wget https://json-schema.org/draft/2020-12/schema
28 changes: 28 additions & 0 deletions src/cpp_example/common.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef CUBAO_COMMON_HPP
#define CUBAO_COMMON_HPP

#include <Eigen/Core>
#include <mapbox/geojson.hpp>
#include <mapbox/geojson/rapidjson.hpp>
#include <nlohmann/json.hpp>

// should sync
// - https://github.com/cubao/cpp-example/blob/main/src/cpp_example/common.hpp
// - https://github.com/cubao/headers/tree/main/include/cubao/common.hpp

namespace cubao
{
using json = nlohmann::json;
using VariantValue = mapbox::feature::value;
using PropertyMap = mapbox::feature::property_map;

// https://github.com/mapbox/geojson-cpp/blob/master/include/mapbox/geojson/rapidjson.hpp
// Use the CrtAllocator, because the MemoryPoolAllocator is broken on ARM
// https://github.com/miloyip/rapidjson/issues/200, 301, 388
using RapidjsonValue = mapbox::geojson::rapidjson_value;
using RapidjsonAllocator = mapbox::geojson::rapidjson_allocator;
using RapidjsonDocument = mapbox::geojson::rapidjson_document;
using RowVectors = Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>;
} // namespace cubao

#endif
Loading