Compare commits
18 Commits
master
...
sf-one-to-
Author | SHA1 | Date | |
---|---|---|---|
|
a8e52b6af9 | ||
|
edd9dcca47 | ||
|
ecbaabc15f | ||
|
f909d89381 | ||
|
36d91d61d7 | ||
|
5769d0d46e | ||
|
da6d08e759 | ||
|
44056eda0b | ||
|
d76d5e7d5f | ||
|
ed49564e27 | ||
|
fe339b385c | ||
|
5fc269c50a | ||
|
6f2b8f44d0 | ||
|
2e2ce1d421 | ||
|
4a34c86544 | ||
|
2b38c936d5 | ||
|
b577558980 | ||
|
f1ce2e6384 |
@ -1,65 +0,0 @@
|
|||||||
name: Build and Publish Docker Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published, prereleased]
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: openharbor/osrm-backend
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
docker-base-image: ["debian", "alpine"]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out the repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ${{ env.IMAGE_NAME }}
|
|
||||||
|
|
||||||
- name: Docker meta - debug
|
|
||||||
id: metadebug
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ${{ env.IMAGE_NAME }}
|
|
||||||
flavor: |
|
|
||||||
latest=true
|
|
||||||
suffix=-debug,onlatest=true
|
|
||||||
|
|
||||||
- name: Log in to DockerHub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push debug image
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64
|
|
||||||
file: ./docker/Dockerfile-${{ matrix.docker-base-image }}
|
|
||||||
tags: ${{ steps.metadebug.outputs.tags }}
|
|
||||||
build-args: |
|
|
||||||
DOCKER_TAG=${{ join(steps.metadebug.outputs.tags) }}-${{ matrix.docker-base-image }}
|
|
||||||
|
|
||||||
- name: Build and push normal image
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64
|
|
||||||
file: ./docker/Dockerfile-${{ matrix.docker-base-image }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
build-args: |
|
|
||||||
DOCKER_TAG=${{ join(steps.meta.outputs.tags) }}-${{ matrix.docker-base-image }}
|
|
1282
.github/workflows/osrm-backend.yml
vendored
1282
.github/workflows/osrm-backend.yml
vendored
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,6 @@
|
|||||||
- NodeJS:
|
- NodeJS:
|
||||||
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
|
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
|
||||||
- Misc:
|
- Misc:
|
||||||
- CHANGED: Use std::string_view for key type in json::Object. [#7062](https://github.com/Project-OSRM/osrm-backend/pull/7062)
|
|
||||||
- CHANGED: Use thread_local instead of boost::thread_specific_ptr. [#6991](https://github.com/Project-OSRM/osrm-backend/pull/6991)
|
- CHANGED: Use thread_local instead of boost::thread_specific_ptr. [#6991](https://github.com/Project-OSRM/osrm-backend/pull/6991)
|
||||||
- CHANGED: Bump flatbuffers to v24.3.25 version. [#6988](https://github.com/Project-OSRM/osrm-backend/pull/6988)
|
- CHANGED: Bump flatbuffers to v24.3.25 version. [#6988](https://github.com/Project-OSRM/osrm-backend/pull/6988)
|
||||||
- CHANGED: Add .reserve(...) to assembleGeometry function. [#6983](https://github.com/Project-OSRM/osrm-backend/pull/6983)
|
- CHANGED: Add .reserve(...) to assembleGeometry function. [#6983](https://github.com/Project-OSRM/osrm-backend/pull/6983)
|
||||||
@ -80,7 +79,6 @@
|
|||||||
- ADDED: Extract prerelease/build information from package semver [#6839](https://github.com/Project-OSRM/osrm-backend/pull/6839)
|
- ADDED: Extract prerelease/build information from package semver [#6839](https://github.com/Project-OSRM/osrm-backend/pull/6839)
|
||||||
- Profiles:
|
- Profiles:
|
||||||
- FIXED: Bicycle and foot profiles now don't route on proposed ways [#6615](https://github.com/Project-OSRM/osrm-backend/pull/6615)
|
- FIXED: Bicycle and foot profiles now don't route on proposed ways [#6615](https://github.com/Project-OSRM/osrm-backend/pull/6615)
|
||||||
- ADDED: Add optional support of cargo bike exclusion and width to bicyle profile [#7044](https://github.com/Project-OSRM/osrm-backend/pull/7044)
|
|
||||||
- Routing:
|
- Routing:
|
||||||
- FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419)
|
- FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419)
|
||||||
- FIXED: Correctly handle compressed traffic signals. [#6724](https://github.com/Project-OSRM/osrm-backend/pull/6724)
|
- FIXED: Correctly handle compressed traffic signals. [#6724](https://github.com/Project-OSRM/osrm-backend/pull/6724)
|
||||||
|
@ -56,9 +56,6 @@ endif()
|
|||||||
if (POLICY CMP0074)
|
if (POLICY CMP0074)
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
endif()
|
endif()
|
||||||
if (POLICY CMP0167)
|
|
||||||
cmake_policy(SET CMP0167 NEW)
|
|
||||||
endif()
|
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,34 +1,20 @@
|
|||||||
FROM alpine:3.21.2 AS alpine-mimalloc
|
FROM alpine:3.20.0 as alpine-mimalloc
|
||||||
|
|
||||||
RUN apk update && \
|
RUN apk add --no-cache mimalloc
|
||||||
apk upgrade && \
|
|
||||||
apk add --no-cache \
|
|
||||||
boost-iostreams \
|
|
||||||
boost-program_options \
|
|
||||||
boost-thread \
|
|
||||||
mimalloc
|
|
||||||
|
|
||||||
ENV LD_PRELOAD=/usr/lib/libmimalloc.so.2
|
ENV LD_PRELOAD=/usr/lib/libmimalloc.so.2
|
||||||
ENV MIMALLOC_LARGE_OS_PAGES=1
|
ENV MIMALLOC_LARGE_OS_PAGES=1
|
||||||
|
|
||||||
|
|
||||||
FROM alpine-mimalloc AS builder
|
FROM alpine-mimalloc as builder
|
||||||
ARG DOCKER_TAG
|
ARG DOCKER_TAG
|
||||||
ARG BUILD_CONCURRENCY
|
ARG BUILD_CONCURRENCY
|
||||||
|
RUN mkdir -p /src && mkdir -p /opt
|
||||||
|
|
||||||
RUN mkdir -p /src /opt && \
|
RUN apk add --no-cache \
|
||||||
apk add --no-cache \
|
cmake make git clang libbz2 libxml2 \
|
||||||
boost-dev \
|
boost-dev boost-program_options boost-filesystem boost-iostreams boost-thread \
|
||||||
boost-filesystem \
|
lua5.4-dev onetbb-dev expat-dev
|
||||||
clang \
|
|
||||||
cmake \
|
|
||||||
expat-dev \
|
|
||||||
git \
|
|
||||||
libbz2 \
|
|
||||||
libxml2 \
|
|
||||||
lua5.4-dev \
|
|
||||||
make \
|
|
||||||
onetbb-dev
|
|
||||||
|
|
||||||
COPY . /src
|
COPY . /src
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@ -53,18 +39,16 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
|
|||||||
rm -rf /src
|
rm -rf /src
|
||||||
|
|
||||||
|
|
||||||
# Multistage build to reduce image size - https://docs.docker.com/build/building/multi-stage/#use-multi-stage-builds
|
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
|
||||||
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
|
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
|
||||||
FROM alpine-mimalloc AS runstage
|
FROM alpine-mimalloc as runstage
|
||||||
|
|
||||||
COPY --from=builder /usr/local /usr/local
|
COPY --from=builder /usr/local /usr/local
|
||||||
COPY --from=builder /opt /opt
|
COPY --from=builder /opt /opt
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
boost-date_time \
|
boost-program_options boost-date_time boost-iostreams boost-thread \
|
||||||
expat \
|
expat lua5.4 onetbb && \
|
||||||
lua5.4 \
|
|
||||||
onetbb && \
|
|
||||||
ldconfig /usr/local/lib
|
ldconfig /usr/local/lib
|
||||||
|
|
||||||
RUN /usr/local/bin/osrm-extract --help && \
|
RUN /usr/local/bin/osrm-extract --help && \
|
||||||
@ -76,4 +60,3 @@ RUN /usr/local/bin/osrm-extract --help && \
|
|||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
|
@ -1,24 +1,21 @@
|
|||||||
FROM debian:bookworm-slim AS builder
|
FROM debian:bookworm-slim as builder
|
||||||
ARG DOCKER_TAG
|
ARG DOCKER_TAG
|
||||||
ARG BUILD_CONCURRENCY
|
ARG BUILD_CONCURRENCY
|
||||||
|
RUN mkdir -p /src && mkdir -p /opt
|
||||||
|
|
||||||
RUN mkdir -p /src /opt && \
|
RUN apt-get update && \
|
||||||
apt-get update && \
|
apt-get -y --no-install-recommends install ca-certificates cmake make git gcc g++ libbz2-dev libxml2-dev wget \
|
||||||
apt-get -y --no-install-recommends --no-install-suggests install \
|
libzip-dev libboost1.81-all-dev lua5.4 liblua5.4-dev pkg-config -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
|
||||||
ca-certificates \
|
|
||||||
cmake \
|
RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
|
||||||
g++ \
|
ldconfig /usr/local/lib && \
|
||||||
gcc \
|
git clone --branch v2021.12.0 --single-branch https://github.com/oneapi-src/oneTBB.git && \
|
||||||
git \
|
cd oneTBB && \
|
||||||
libboost1.81-all-dev \
|
mkdir build && \
|
||||||
libbz2-dev \
|
cd build && \
|
||||||
liblua5.4-dev \
|
cmake -DTBB_TEST=OFF -DCMAKE_BUILD_TYPE=Release .. && \
|
||||||
libtbb-dev \
|
cmake --build . && \
|
||||||
libxml2-dev \
|
cmake --install .
|
||||||
libzip-dev \
|
|
||||||
lua5.4 \
|
|
||||||
make \
|
|
||||||
pkg-config
|
|
||||||
|
|
||||||
COPY . /src
|
COPY . /src
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@ -44,24 +41,19 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
|
|||||||
rm -rf /src
|
rm -rf /src
|
||||||
|
|
||||||
|
|
||||||
# Multistage build to reduce image size - https://docs.docker.com/build/building/multi-stage/#use-multi-stage-builds
|
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
|
||||||
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
|
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
|
||||||
FROM debian:bookworm-slim AS runstage
|
FROM debian:bookworm-slim as runstage
|
||||||
|
|
||||||
COPY --from=builder /usr/local /usr/local
|
COPY --from=builder /usr/local /usr/local
|
||||||
COPY --from=builder /opt /opt
|
COPY --from=builder /opt /opt
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends --no-install-suggests \
|
apt-get install -y --no-install-recommends \
|
||||||
expat \
|
libboost-program-options1.81.0 libboost-date-time1.81.0 libboost-iostreams1.81.0 libboost-thread1.81.0 \
|
||||||
libboost-date-time1.81.0 \
|
expat liblua5.4-0 && \
|
||||||
libboost-iostreams1.81.0 \
|
|
||||||
libboost-program-options1.81.0 \
|
|
||||||
libboost-thread1.81.0 \
|
|
||||||
liblua5.4-0 \
|
|
||||||
libtbb12 && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
# Add /usr/local/lib to ldconfig to allow loading libraries from there
|
# add /usr/local/lib to ldconfig to allow loading libraries from there
|
||||||
ldconfig /usr/local/lib
|
ldconfig /usr/local/lib
|
||||||
|
|
||||||
RUN /usr/local/bin/osrm-extract --help && \
|
RUN /usr/local/bin/osrm-extract --help && \
|
||||||
@ -73,4 +65,3 @@ RUN /usr/local/bin/osrm-extract --help && \
|
|||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
|
@ -603,8 +603,6 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
auto found_range = std::equal_range(
|
auto found_range = std::equal_range(
|
||||||
m_maneuver_overrides.begin(), m_maneuver_overrides.end(), edge_based_node_id, Comp{});
|
m_maneuver_overrides.begin(), m_maneuver_overrides.end(), edge_based_node_id, Comp{});
|
||||||
|
|
||||||
results.reserve(std::distance(found_range.first, found_range.second));
|
|
||||||
|
|
||||||
std::for_each(found_range.first,
|
std::for_each(found_range.first,
|
||||||
found_range.second,
|
found_range.second,
|
||||||
[&](const auto &override)
|
[&](const auto &override)
|
||||||
|
@ -460,6 +460,19 @@ void search(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
duration_upper_bound);
|
duration_upper_bound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::vector<double> getNetworkDistances(
|
||||||
|
SearchEngineData<Algorithm> &,
|
||||||
|
const DataFacade<ch::Algorithm> &,
|
||||||
|
SearchEngineData<Algorithm>::QueryHeap &,
|
||||||
|
const std::vector<std::unique_ptr<typename SearchEngineData<Algorithm>::QueryHeap>> &,
|
||||||
|
const PhantomNode &,
|
||||||
|
const std::vector<PhantomNode> &,
|
||||||
|
EdgeWeight /*duration_upper_bound*/ = INVALID_EDGE_WEIGHT)
|
||||||
|
{
|
||||||
|
std::vector<double> distances;
|
||||||
|
return distances;
|
||||||
|
}
|
||||||
|
|
||||||
// Requires the heaps for be empty
|
// Requires the heaps for be empty
|
||||||
// If heaps should be adjusted to be initialized outside of this function,
|
// If heaps should be adjusted to be initialized outside of this function,
|
||||||
// the addition of force_step parameters might be required
|
// the addition of force_step parameters might be required
|
||||||
|
@ -38,10 +38,13 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
|
|||||||
return INVALID_LEVEL_ID;
|
return INVALID_LEVEL_ID;
|
||||||
};
|
};
|
||||||
|
|
||||||
return std::min(std::min(level(source.forward_segment_id, target.forward_segment_id),
|
auto res = std::min(std::min(level(source.forward_segment_id, target.forward_segment_id),
|
||||||
level(source.forward_segment_id, target.reverse_segment_id)),
|
level(source.forward_segment_id, target.reverse_segment_id)),
|
||||||
std::min(level(source.reverse_segment_id, target.forward_segment_id),
|
std::min(level(source.reverse_segment_id, target.forward_segment_id),
|
||||||
level(source.reverse_segment_id, target.reverse_segment_id)));
|
level(source.reverse_segment_id, target.reverse_segment_id)));
|
||||||
|
|
||||||
|
// std::cerr << "OLD!!! " << (int)res << std::endl;
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename MultiLevelPartition>
|
template <typename MultiLevelPartition>
|
||||||
@ -92,6 +95,7 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
|
|||||||
getNodeQueryLevel(partition, node, source, target));
|
getNodeQueryLevel(partition, node, source, target));
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
// std::cerr << "NEW " << (int)min_level << std::endl;
|
||||||
return min_level;
|
return min_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,6 +144,8 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
|
|||||||
highest_different_level(phantom_node.reverse_segment_id));
|
highest_different_level(phantom_node.reverse_segment_id));
|
||||||
return std::min(current_level, highest_level);
|
return std::min(current_level, highest_level);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// std::cerr << "NEW!!! " << (int)node_level << std::endl;
|
||||||
return node_level;
|
return node_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,7 +306,6 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
|
|||||||
const auto &metric = facade.GetCellMetric();
|
const auto &metric = facade.GetCellMetric();
|
||||||
|
|
||||||
const auto level = getNodeQueryLevel(partition, heapNode.node, args...);
|
const auto level = getNodeQueryLevel(partition, heapNode.node, args...);
|
||||||
|
|
||||||
static constexpr auto IS_MAP_MATCHING =
|
static constexpr auto IS_MAP_MATCHING =
|
||||||
std::is_same_v<typename SearchEngineData<mld::Algorithm>::MapMatchingQueryHeap, Heap>;
|
std::is_same_v<typename SearchEngineData<mld::Algorithm>::MapMatchingQueryHeap, Heap>;
|
||||||
|
|
||||||
@ -457,6 +462,15 @@ void routingStep(const DataFacade<Algorithm> &facade,
|
|||||||
|
|
||||||
BOOST_ASSERT(!facade.ExcludeNode(heapNode.node));
|
BOOST_ASSERT(!facade.ExcludeNode(heapNode.node));
|
||||||
|
|
||||||
|
if (DIRECTION == FORWARD_DIRECTION)
|
||||||
|
{
|
||||||
|
// std::cerr << "FORWARDO " << heapNode.node << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// std::cerr << "REVERSEO " << heapNode.node << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Upper bound for the path source -> target with
|
// Upper bound for the path source -> target with
|
||||||
// weight(source -> node) = weight weight(to -> target) ≤ reverse_weight
|
// weight(source -> node) = weight weight(to -> target) ≤ reverse_weight
|
||||||
// is weight + reverse_weight
|
// is weight + reverse_weight
|
||||||
@ -644,6 +658,7 @@ searchDistance(SearchEngineData<Algorithm> &,
|
|||||||
|
|
||||||
auto [middle, _] = *searchResult;
|
auto [middle, _] = *searchResult;
|
||||||
|
|
||||||
|
// std::cerr << "old " << middle << std::endl;
|
||||||
auto distance = forward_heap.GetData(middle).distance + reverse_heap.GetData(middle).distance;
|
auto distance = forward_heap.GetData(middle).distance + reverse_heap.GetData(middle).distance;
|
||||||
|
|
||||||
return distance;
|
return distance;
|
||||||
@ -763,6 +778,307 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
return from_alias<double>(distance);
|
return from_alias<double>(distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <typename Algorithm, typename Heap>
|
||||||
|
std::vector<NodeID>
|
||||||
|
runSearch2(const DataFacade<Algorithm> &facade,
|
||||||
|
Heap &forward_heap,
|
||||||
|
const std::vector<std::unique_ptr<Heap>> &reverse_heap,
|
||||||
|
size_t candidatesCount,
|
||||||
|
const std::vector<NodeID> &force_step_nodes,
|
||||||
|
EdgeWeight weight_upper_bound,
|
||||||
|
const PhantomEndpointCandidates &candidates)
|
||||||
|
{
|
||||||
|
// if (forward_heap.Empty() || reverse_heap.Empty())
|
||||||
|
// {
|
||||||
|
// return {};
|
||||||
|
// }
|
||||||
|
|
||||||
|
// BOOST_ASSERT(!forward_heap.Empty() && forward_heap.MinKey() < INVALID_EDGE_WEIGHT);
|
||||||
|
// BOOST_ASSERT(!reverse_heap.Empty() && reverse_heap.MinKey() < INVALID_EDGE_WEIGHT);
|
||||||
|
|
||||||
|
std::vector<NodeID> middles;
|
||||||
|
std::vector<EdgeWeight> weights;
|
||||||
|
|
||||||
|
middles.resize(candidatesCount, SPECIAL_NODEID);
|
||||||
|
weights.resize(candidatesCount, weight_upper_bound);
|
||||||
|
|
||||||
|
// run two-Target Dijkstra routing step.
|
||||||
|
EdgeWeight forward_heap_min = forward_heap.MinKey();
|
||||||
|
std::vector<EdgeWeight> reverse_heap_mins;
|
||||||
|
for (size_t i = 0; i < candidatesCount; ++i)
|
||||||
|
{
|
||||||
|
reverse_heap_mins.push_back(reverse_heap[i]->MinKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto shouldContinue = [&]()
|
||||||
|
{
|
||||||
|
bool cont = false;
|
||||||
|
for (size_t i = 0; i < candidatesCount; ++i)
|
||||||
|
{
|
||||||
|
if ((forward_heap.Size() + reverse_heap[i]->Size() > 0) &&
|
||||||
|
(forward_heap_min + reverse_heap_mins[i]) < weights[i])
|
||||||
|
{
|
||||||
|
cont = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cont;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool cont = shouldContinue();
|
||||||
|
while (cont)
|
||||||
|
{
|
||||||
|
if (!forward_heap.Empty())
|
||||||
|
{
|
||||||
|
const auto heapNode = forward_heap.DeleteMinGetHeapNode();
|
||||||
|
// std::cerr << "FORWARDN " << heapNode.node << std::endl;
|
||||||
|
// auto heapNode = routingStep2<FORWARD_DIRECTION>(facade, forward_heap, args...);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < candidatesCount; ++i)
|
||||||
|
{
|
||||||
|
auto &rh = reverse_heap[i];
|
||||||
|
const auto reverseHeapNode = rh->GetHeapNodeIfWasInserted(heapNode.node);
|
||||||
|
if (reverseHeapNode)
|
||||||
|
{
|
||||||
|
auto reverse_weight = reverseHeapNode->weight;
|
||||||
|
auto path_weight = heapNode.weight + reverse_weight;
|
||||||
|
|
||||||
|
if (!shouldForceStep(force_step_nodes, heapNode, *reverseHeapNode) &&
|
||||||
|
(path_weight >= EdgeWeight{0}) && (path_weight < weights[i]))
|
||||||
|
{
|
||||||
|
middles[i] = heapNode.node;
|
||||||
|
weights[i] = path_weight;
|
||||||
|
|
||||||
|
// auto distance =
|
||||||
|
// forward_heap.GetData(middles[i]).distance +
|
||||||
|
// reverse_heap[i]->GetData(middles[i]).distance;
|
||||||
|
// std::cerr << "RFOUNDN " << i <<" " << distance << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
relaxOutgoingEdges<FORWARD_DIRECTION>(facade, forward_heap, heapNode, candidates);
|
||||||
|
|
||||||
|
if (!forward_heap.Empty())
|
||||||
|
forward_heap_min = forward_heap.MinKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
cont = false;
|
||||||
|
for (size_t i = 0; i < candidatesCount; ++i)
|
||||||
|
{
|
||||||
|
if ((forward_heap.Size() + reverse_heap[i]->Size() > 0) &&
|
||||||
|
(forward_heap_min + reverse_heap_mins[i]) < weights[i])
|
||||||
|
{
|
||||||
|
cont = true;
|
||||||
|
}
|
||||||
|
if (!reverse_heap[i]->Empty() && (forward_heap_min + reverse_heap_mins[i]) < weights[i])
|
||||||
|
{
|
||||||
|
const auto heapNode = reverse_heap[i]->DeleteMinGetHeapNode();
|
||||||
|
// std::cerr << "REVERSEN " << i << " " << heapNode.node << std::endl;
|
||||||
|
|
||||||
|
const auto reverseHeapNode = forward_heap.GetHeapNodeIfWasInserted(heapNode.node);
|
||||||
|
if (reverseHeapNode)
|
||||||
|
{
|
||||||
|
auto reverse_weight = reverseHeapNode->weight;
|
||||||
|
auto path_weight = heapNode.weight + reverse_weight;
|
||||||
|
|
||||||
|
if (!shouldForceStep(force_step_nodes, heapNode, *reverseHeapNode) &&
|
||||||
|
(path_weight >= EdgeWeight{0}) && (path_weight < weights[i]))
|
||||||
|
{
|
||||||
|
|
||||||
|
middles[i] = heapNode.node;
|
||||||
|
weights[i] = path_weight;
|
||||||
|
|
||||||
|
// auto distance =
|
||||||
|
// forward_heap.GetData(middles[i]).distance +
|
||||||
|
// reverse_heap[i]->GetData(middles[i]).distance;
|
||||||
|
// std::cerr << "FFOUNDN " << i << " " << distance << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
relaxOutgoingEdges<REVERSE_DIRECTION>(
|
||||||
|
facade, *reverse_heap[i], heapNode, candidates);
|
||||||
|
|
||||||
|
if (!reverse_heap[i]->Empty())
|
||||||
|
reverse_heap_mins[i] = reverse_heap[i]->MinKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return middles;
|
||||||
|
// std::vector<std::optional<std::pair<NodeID, EdgeWeight>>> results;
|
||||||
|
// results.reserve(candidatesCount);
|
||||||
|
// for (size_t i = 0; i < candidatesCount; ++i)
|
||||||
|
// {
|
||||||
|
// if (weights[i] >= weight_upper_bound || SPECIAL_NODEID == middles[i])
|
||||||
|
// {
|
||||||
|
// results.push_back({});
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// results.push_back({{middles[i], weights[i]}});
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return results;
|
||||||
|
|
||||||
|
// // run two-Target Dijkstra routing step.
|
||||||
|
// NodeID middle = SPECIAL_NODEID;
|
||||||
|
// EdgeWeight weight = weight_upper_bound;
|
||||||
|
// EdgeWeight forward_heap_min = forward_heap.MinKey();
|
||||||
|
// EdgeWeight reverse_heap_min = reverse_heap.MinKey();
|
||||||
|
// while (forward_heap.Size() + reverse_heap.Size() > 0 &&
|
||||||
|
// forward_heap_min + reverse_heap_min < weight)
|
||||||
|
// {
|
||||||
|
// if (!forward_heap.Empty())
|
||||||
|
// {
|
||||||
|
// routingStep<FORWARD_DIRECTION>(
|
||||||
|
// facade, forward_heap, reverse_heap, middle, weight, force_step_nodes, args...);
|
||||||
|
// if (!forward_heap.Empty())
|
||||||
|
// forward_heap_min = forward_heap.MinKey();
|
||||||
|
// }
|
||||||
|
// if (!reverse_heap.Empty())
|
||||||
|
// {
|
||||||
|
// routingStep<REVERSE_DIRECTION>(
|
||||||
|
// facade, reverse_heap, forward_heap, middle, weight, force_step_nodes, args...);
|
||||||
|
// if (!reverse_heap.Empty())
|
||||||
|
// reverse_heap_min = reverse_heap.MinKey();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
|
// // No path found for both target nodes?
|
||||||
|
// if (weight >= weight_upper_bound || SPECIAL_NODEID == middle)
|
||||||
|
// {
|
||||||
|
// return {};
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return {{middle, weight}};
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Algorithm>
|
||||||
|
std::vector<double> searchDistance2(
|
||||||
|
SearchEngineData<Algorithm> &,
|
||||||
|
const DataFacade<Algorithm> &facade,
|
||||||
|
typename SearchEngineData<Algorithm>::MapMatchingQueryHeap &forward_heap,
|
||||||
|
const std::vector<std::unique_ptr<typename SearchEngineData<Algorithm>::MapMatchingQueryHeap>>
|
||||||
|
&reverse_heaps,
|
||||||
|
size_t candidatesCount,
|
||||||
|
const std::vector<NodeID> &force_step_nodes,
|
||||||
|
EdgeWeight weight_upper_bound,
|
||||||
|
const PhantomEndpointCandidates &candidates)
|
||||||
|
{
|
||||||
|
auto searchResults = runSearch2(facade,
|
||||||
|
forward_heap,
|
||||||
|
reverse_heaps,
|
||||||
|
candidatesCount,
|
||||||
|
force_step_nodes,
|
||||||
|
weight_upper_bound,
|
||||||
|
candidates);
|
||||||
|
std::vector<double> res;
|
||||||
|
res.reserve(candidatesCount);
|
||||||
|
for (size_t i = 0; i < searchResults.size(); ++i)
|
||||||
|
{
|
||||||
|
if (searchResults[i] == SPECIAL_NODEID)
|
||||||
|
{
|
||||||
|
res.push_back(std::numeric_limits<double>::max());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto middle = searchResults[i];
|
||||||
|
|
||||||
|
// std::cerr << "new " << i << " " << middle << std::endl;
|
||||||
|
|
||||||
|
auto distance =
|
||||||
|
forward_heap.GetData(middle).distance + reverse_heaps[i]->GetData(middle).distance;
|
||||||
|
res.push_back(from_alias<double>(distance));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
template <typename Algorithm>
|
||||||
|
std::vector<double> getNetworkDistances(
|
||||||
|
SearchEngineData<Algorithm> &engine_working_data,
|
||||||
|
const DataFacade<Algorithm> &facade,
|
||||||
|
typename SearchEngineData<Algorithm>::MapMatchingQueryHeap &forward_heap,
|
||||||
|
const std::vector<std::unique_ptr<typename SearchEngineData<Algorithm>::MapMatchingQueryHeap>>
|
||||||
|
&reverse_heaps,
|
||||||
|
const PhantomNode &source_phantom,
|
||||||
|
const std::vector<PhantomNode> &target_phantoms,
|
||||||
|
EdgeWeight weight_upper_bound = INVALID_EDGE_WEIGHT)
|
||||||
|
{
|
||||||
|
forward_heap.Clear();
|
||||||
|
for (const auto &heap : reverse_heaps)
|
||||||
|
{
|
||||||
|
heap->Clear();
|
||||||
|
}
|
||||||
|
// std::vector<std::unique_ptr<Heap>> reverse_heaps;
|
||||||
|
// const auto nodes_number = facade.GetNumberOfNodes();
|
||||||
|
// const auto border_nodes_number = facade.GetMaxBorderNodeID() + 1;
|
||||||
|
// for (const auto &target_phantom : target_phantoms)
|
||||||
|
// {
|
||||||
|
// (void)target_phantom;
|
||||||
|
// reverse_heaps.emplace_back(std::make_unique<Heap>(nodes_number, border_nodes_number));
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (source_phantom.IsValidForwardSource())
|
||||||
|
{
|
||||||
|
forward_heap.Insert(source_phantom.forward_segment_id.id,
|
||||||
|
EdgeWeight{0} - source_phantom.GetForwardWeightPlusOffset(),
|
||||||
|
{source_phantom.forward_segment_id.id,
|
||||||
|
false,
|
||||||
|
EdgeDistance{0} - source_phantom.GetForwardDistance()});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source_phantom.IsValidReverseSource())
|
||||||
|
{
|
||||||
|
forward_heap.Insert(source_phantom.reverse_segment_id.id,
|
||||||
|
EdgeWeight{0} - source_phantom.GetReverseWeightPlusOffset(),
|
||||||
|
{source_phantom.reverse_segment_id.id,
|
||||||
|
false,
|
||||||
|
EdgeDistance{0} - source_phantom.GetReverseDistance()});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < target_phantoms.size(); ++i)
|
||||||
|
{
|
||||||
|
auto &reverse_heap = *reverse_heaps[i];
|
||||||
|
const auto &target_phantom = target_phantoms[i];
|
||||||
|
if (target_phantom.IsValidForwardTarget())
|
||||||
|
{
|
||||||
|
reverse_heap.Insert(
|
||||||
|
target_phantom.forward_segment_id.id,
|
||||||
|
target_phantom.GetForwardWeightPlusOffset(),
|
||||||
|
{target_phantom.forward_segment_id.id, false, target_phantom.GetForwardDistance()});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target_phantom.IsValidReverseTarget())
|
||||||
|
{
|
||||||
|
reverse_heap.Insert(
|
||||||
|
target_phantom.reverse_segment_id.id,
|
||||||
|
target_phantom.GetReverseWeightPlusOffset(),
|
||||||
|
{target_phantom.reverse_segment_id.id, false, target_phantom.GetReverseDistance()});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PhantomEndpoints endpoints{};
|
||||||
|
// endpoints.push_back(source_phantom);
|
||||||
|
// for (const auto &target_phantom : target_phantoms)
|
||||||
|
// {
|
||||||
|
// endpoints.push_back(target_phantom);
|
||||||
|
// }
|
||||||
|
std::vector<PhantomNode> source_phantomes;
|
||||||
|
source_phantomes.push_back(source_phantom);
|
||||||
|
PhantomEndpointCandidates phantom_candidates{source_phantomes, target_phantoms};
|
||||||
|
|
||||||
|
auto distances = searchDistance2(engine_working_data,
|
||||||
|
facade,
|
||||||
|
forward_heap,
|
||||||
|
reverse_heaps,
|
||||||
|
target_phantoms.size(),
|
||||||
|
{},
|
||||||
|
weight_upper_bound,
|
||||||
|
phantom_candidates);
|
||||||
|
return distances;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace osrm::engine::routing_algorithms::mld
|
} // namespace osrm::engine::routing_algorithms::mld
|
||||||
|
|
||||||
#endif // OSRM_ENGINE_ROUTING_BASE_MLD_HPP
|
#endif // OSRM_ENGINE_ROUTING_BASE_MLD_HPP
|
||||||
|
@ -56,6 +56,7 @@ template <> struct SearchEngineData<routing_algorithms::ch::Algorithm>
|
|||||||
static thread_local ManyToManyHeapPtr many_to_many_heap;
|
static thread_local ManyToManyHeapPtr many_to_many_heap;
|
||||||
static thread_local SearchEngineHeapPtr map_matching_forward_heap_1;
|
static thread_local SearchEngineHeapPtr map_matching_forward_heap_1;
|
||||||
static thread_local SearchEngineHeapPtr map_matching_reverse_heap_1;
|
static thread_local SearchEngineHeapPtr map_matching_reverse_heap_1;
|
||||||
|
static thread_local std::vector<SearchEngineHeapPtr> map_matching_reverse_heaps;
|
||||||
|
|
||||||
void InitializeOrClearMapMatchingThreadLocalStorage(unsigned number_of_nodes);
|
void InitializeOrClearMapMatchingThreadLocalStorage(unsigned number_of_nodes);
|
||||||
|
|
||||||
@ -133,13 +134,15 @@ template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
|
|||||||
static thread_local SearchEngineHeapPtr reverse_heap_1;
|
static thread_local SearchEngineHeapPtr reverse_heap_1;
|
||||||
static thread_local MapMatchingHeapPtr map_matching_forward_heap_1;
|
static thread_local MapMatchingHeapPtr map_matching_forward_heap_1;
|
||||||
static thread_local MapMatchingHeapPtr map_matching_reverse_heap_1;
|
static thread_local MapMatchingHeapPtr map_matching_reverse_heap_1;
|
||||||
|
static thread_local std::vector<MapMatchingHeapPtr> map_matching_reverse_heaps;
|
||||||
|
|
||||||
static thread_local ManyToManyHeapPtr many_to_many_heap;
|
static thread_local ManyToManyHeapPtr many_to_many_heap;
|
||||||
|
|
||||||
void InitializeOrClearFirstThreadLocalStorage(unsigned number_of_nodes,
|
void InitializeOrClearFirstThreadLocalStorage(unsigned number_of_nodes,
|
||||||
unsigned number_of_boundary_nodes);
|
unsigned number_of_boundary_nodes);
|
||||||
void InitializeOrClearMapMatchingThreadLocalStorage(unsigned number_of_nodes,
|
void InitializeOrClearMapMatchingThreadLocalStorage(unsigned number_of_nodes,
|
||||||
unsigned number_of_boundary_nodes);
|
unsigned number_of_boundary_nodes,
|
||||||
|
size_t max_candidates);
|
||||||
|
|
||||||
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes,
|
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes,
|
||||||
unsigned number_of_boundary_nodes);
|
unsigned number_of_boundary_nodes);
|
||||||
|
@ -30,7 +30,7 @@ struct V8Renderer
|
|||||||
{
|
{
|
||||||
Napi::Value child;
|
Napi::Value child;
|
||||||
std::visit(V8Renderer(env, child), keyValue.second);
|
std::visit(V8Renderer(env, child), keyValue.second);
|
||||||
obj.Set(keyValue.first.data(), child);
|
obj.Set(keyValue.first, child);
|
||||||
}
|
}
|
||||||
out = obj;
|
out = obj;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,46 @@ namespace osrm::util
|
|||||||
namespace bearing
|
namespace bearing
|
||||||
{
|
{
|
||||||
|
|
||||||
|
inline std::string get(const double heading)
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(heading >= 0);
|
||||||
|
BOOST_ASSERT(heading <= 360);
|
||||||
|
|
||||||
|
if (heading <= 22.5)
|
||||||
|
{
|
||||||
|
return "N";
|
||||||
|
}
|
||||||
|
if (heading <= 67.5)
|
||||||
|
{
|
||||||
|
return "NE";
|
||||||
|
}
|
||||||
|
if (heading <= 112.5)
|
||||||
|
{
|
||||||
|
return "E";
|
||||||
|
}
|
||||||
|
if (heading <= 157.5)
|
||||||
|
{
|
||||||
|
return "SE";
|
||||||
|
}
|
||||||
|
if (heading <= 202.5)
|
||||||
|
{
|
||||||
|
return "S";
|
||||||
|
}
|
||||||
|
if (heading <= 247.5)
|
||||||
|
{
|
||||||
|
return "SW";
|
||||||
|
}
|
||||||
|
if (heading <= 292.5)
|
||||||
|
{
|
||||||
|
return "W";
|
||||||
|
}
|
||||||
|
if (heading <= 337.5)
|
||||||
|
{
|
||||||
|
return "NW";
|
||||||
|
}
|
||||||
|
return "N";
|
||||||
|
}
|
||||||
|
|
||||||
// Checks whether A is between B-range and B+range, all modulo 360
|
// Checks whether A is between B-range and B+range, all modulo 360
|
||||||
// e.g. A = 5, B = 5, range = 10 == true
|
// e.g. A = 5, B = 5, range = 10 == true
|
||||||
// A = -6, B = 5, range = 10 == false
|
// A = -6, B = 5, range = 10 == false
|
||||||
|
@ -2,13 +2,43 @@
|
|||||||
#define OSRM_UTIL_BIT_RANGE_HPP
|
#define OSRM_UTIL_BIT_RANGE_HPP
|
||||||
|
|
||||||
#include "util/msb.hpp"
|
#include "util/msb.hpp"
|
||||||
#include <bit>
|
|
||||||
#include <boost/iterator/iterator_facade.hpp>
|
#include <boost/iterator/iterator_facade.hpp>
|
||||||
#include <boost/range/iterator_range.hpp>
|
#include <boost/range/iterator_range.hpp>
|
||||||
|
|
||||||
namespace osrm::util
|
namespace osrm::util
|
||||||
{
|
{
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
template <typename T> std::size_t countOnes(T value)
|
||||||
|
{
|
||||||
|
static_assert(std::is_unsigned<T>::value, "Only unsigned types allowed");
|
||||||
|
std::size_t number_of_ones = 0;
|
||||||
|
while (value > 0)
|
||||||
|
{
|
||||||
|
auto index = msb(value);
|
||||||
|
value = value & ~(T{1} << index);
|
||||||
|
number_of_ones++;
|
||||||
|
}
|
||||||
|
return number_of_ones;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__))
|
||||||
|
inline std::size_t countOnes(std::uint8_t value)
|
||||||
|
{
|
||||||
|
return __builtin_popcount(std::uint32_t{value});
|
||||||
|
}
|
||||||
|
inline std::size_t countOnes(std::uint16_t value)
|
||||||
|
{
|
||||||
|
return __builtin_popcount(std::uint32_t{value});
|
||||||
|
}
|
||||||
|
inline std::size_t countOnes(unsigned int value) { return __builtin_popcount(value); }
|
||||||
|
inline std::size_t countOnes(unsigned long value) { return __builtin_popcountl(value); }
|
||||||
|
inline std::size_t countOnes(unsigned long long value) { return __builtin_popcountll(value); }
|
||||||
|
#endif
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
// Investigate if we can replace this with
|
// Investigate if we can replace this with
|
||||||
// http://www.boost.org/doc/libs/1_64_0/libs/dynamic_bitset/dynamic_bitset.html
|
// http://www.boost.org/doc/libs/1_64_0/libs/dynamic_bitset/dynamic_bitset.html
|
||||||
template <typename DataT>
|
template <typename DataT>
|
||||||
@ -40,7 +70,7 @@ class BitIterator : public boost::iterator_facade<BitIterator<DataT>,
|
|||||||
|
|
||||||
difference_type distance_to(const BitIterator &other) const
|
difference_type distance_to(const BitIterator &other) const
|
||||||
{
|
{
|
||||||
return std::popcount(m_value) - std::popcount(other.m_value);
|
return detail::countOnes(m_value) - detail::countOnes(other.m_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool equal(const BitIterator &other) const { return m_value == other.m_value; }
|
bool equal(const BitIterator &other) const { return m_value == other.m_value; }
|
||||||
|
@ -104,7 +104,7 @@ using Value = std::variant<String, Number, Object, Array, True, False, Null>;
|
|||||||
*/
|
*/
|
||||||
struct Object
|
struct Object
|
||||||
{
|
{
|
||||||
std::unordered_map<std::string_view, Value> values;
|
std::unordered_map<std::string, Value> values;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,13 +44,13 @@ struct Comparator
|
|||||||
|
|
||||||
bool operator()(const Object &lhs, const Object &rhs) const
|
bool operator()(const Object &lhs, const Object &rhs) const
|
||||||
{
|
{
|
||||||
std::set<std::string_view> lhs_keys;
|
std::set<std::string> lhs_keys;
|
||||||
for (const auto &key_value : lhs.values)
|
for (const auto &key_value : lhs.values)
|
||||||
{
|
{
|
||||||
lhs_keys.insert(key_value.first);
|
lhs_keys.insert(key_value.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<std::string_view> rhs_keys;
|
std::set<std::string> rhs_keys;
|
||||||
for (const auto &key_value : rhs.values)
|
for (const auto &key_value : rhs.values)
|
||||||
{
|
{
|
||||||
rhs_keys.insert(key_value.first);
|
rhs_keys.insert(key_value.first);
|
||||||
@ -60,7 +60,7 @@ struct Comparator
|
|||||||
{
|
{
|
||||||
if (rhs_keys.find(key) == rhs_keys.end())
|
if (rhs_keys.find(key) == rhs_keys.end())
|
||||||
{
|
{
|
||||||
reason = rhs_path + " doesn't have key \"" + std::string(key) + "\"";
|
reason = rhs_path + " doesn't have key \"" + key + "\"";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ struct Comparator
|
|||||||
{
|
{
|
||||||
if (lhs_keys.find(key) == lhs_keys.end())
|
if (lhs_keys.find(key) == lhs_keys.end())
|
||||||
{
|
{
|
||||||
reason = lhs_path + " doesn't have key \"" + std::string(key) + "\"";
|
reason = lhs_path + " doesn't have key \"" + key + "\"";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,9 +81,8 @@ struct Comparator
|
|||||||
|
|
||||||
const auto &rhs_child = rhs.values.find(key)->second;
|
const auto &rhs_child = rhs.values.find(key)->second;
|
||||||
const auto &lhs_child = lhs.values.find(key)->second;
|
const auto &lhs_child = lhs.values.find(key)->second;
|
||||||
auto is_same = std::visit(Comparator(reason,
|
auto is_same =
|
||||||
lhs_path + "." + std::string(key),
|
std::visit(Comparator(reason, lhs_path + "." + key, rhs_path + "." + key),
|
||||||
rhs_path + "." + std::string(key)),
|
|
||||||
lhs_child,
|
lhs_child,
|
||||||
rhs_child);
|
rhs_child);
|
||||||
if (!is_same)
|
if (!is_same)
|
||||||
|
@ -97,7 +97,7 @@ template <typename Out> struct Renderer
|
|||||||
void operator()(const Null &) { write<>("null"); }
|
void operator()(const Null &) { write<>("null"); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void write(std::string_view str);
|
void write(const std::string &str);
|
||||||
void write(const char *str, size_t size);
|
void write(const char *str, size_t size);
|
||||||
void write(char ch);
|
void write(char ch);
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ template <typename Out> struct Renderer
|
|||||||
Out &out;
|
Out &out;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> void Renderer<std::vector<char>>::write(std::string_view str)
|
template <> void Renderer<std::vector<char>>::write(const std::string &str)
|
||||||
{
|
{
|
||||||
out.insert(out.end(), str.begin(), str.end());
|
out.insert(out.end(), str.begin(), str.end());
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ template <> void Renderer<std::vector<char>>::write(const char *str, size_t size
|
|||||||
|
|
||||||
template <> void Renderer<std::vector<char>>::write(char ch) { out.push_back(ch); }
|
template <> void Renderer<std::vector<char>>::write(char ch) { out.push_back(ch); }
|
||||||
|
|
||||||
template <> void Renderer<std::ostream>::write(std::string_view str) { out << str; }
|
template <> void Renderer<std::ostream>::write(const std::string &str) { out << str; }
|
||||||
|
|
||||||
template <> void Renderer<std::ostream>::write(const char *str, size_t size)
|
template <> void Renderer<std::ostream>::write(const char *str, size_t size)
|
||||||
{
|
{
|
||||||
@ -131,7 +131,7 @@ template <> void Renderer<std::ostream>::write(const char *str, size_t size)
|
|||||||
|
|
||||||
template <> void Renderer<std::ostream>::write(char ch) { out << ch; }
|
template <> void Renderer<std::ostream>::write(char ch) { out << ch; }
|
||||||
|
|
||||||
template <> void Renderer<std::string>::write(std::string_view str) { out += str; }
|
template <> void Renderer<std::string>::write(const std::string &str) { out += str; }
|
||||||
|
|
||||||
template <> void Renderer<std::string>::write(const char *str, size_t size)
|
template <> void Renderer<std::string>::write(const char *str, size_t size)
|
||||||
{
|
{
|
||||||
|
@ -1,24 +1,50 @@
|
|||||||
#ifndef OSRM_UTIL_MSB_HPP
|
#ifndef OSRM_UTIL_MSB_HPP
|
||||||
#define OSRM_UTIL_MSB_HPP
|
#define OSRM_UTIL_MSB_HPP
|
||||||
|
|
||||||
#include <bit>
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
|
#include <climits>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <utility>
|
||||||
|
|
||||||
namespace osrm::util
|
namespace osrm::util
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// get the msb of an integer
|
||||||
|
// return 0 for integers without msb
|
||||||
template <typename T> std::size_t msb(T value)
|
template <typename T> std::size_t msb(T value)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(value > 0);
|
|
||||||
|
|
||||||
static_assert(std::is_integral<T>::value && !std::is_signed<T>::value, "Integer required.");
|
static_assert(std::is_integral<T>::value && !std::is_signed<T>::value, "Integer required.");
|
||||||
constexpr auto MSB_INDEX = std::numeric_limits<unsigned char>::digits * sizeof(T) - 1;
|
std::size_t msb = 0;
|
||||||
|
while (value > 0)
|
||||||
return MSB_INDEX - std::countl_zero(value);
|
{
|
||||||
|
value >>= 1u;
|
||||||
|
msb++;
|
||||||
|
}
|
||||||
|
BOOST_ASSERT(msb > 0);
|
||||||
|
return msb - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__))
|
||||||
|
inline std::size_t msb(unsigned long long v)
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(v > 0);
|
||||||
|
constexpr auto MSB_INDEX = CHAR_BIT * sizeof(unsigned long long) - 1;
|
||||||
|
return MSB_INDEX - __builtin_clzll(v);
|
||||||
|
}
|
||||||
|
inline std::size_t msb(unsigned long v)
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(v > 0);
|
||||||
|
constexpr auto MSB_INDEX = CHAR_BIT * sizeof(unsigned long) - 1;
|
||||||
|
return MSB_INDEX - __builtin_clzl(v);
|
||||||
|
}
|
||||||
|
inline std::size_t msb(unsigned int v)
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(v > 0);
|
||||||
|
constexpr auto MSB_INDEX = CHAR_BIT * sizeof(unsigned int) - 1;
|
||||||
|
return MSB_INDEX - __builtin_clz(v);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} // namespace osrm::util
|
} // namespace osrm::util
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,10 +35,6 @@ function setup()
|
|||||||
turn_bias = 1.4,
|
turn_bias = 1.4,
|
||||||
use_public_transport = true,
|
use_public_transport = true,
|
||||||
|
|
||||||
-- Exclude narrow ways, in particular to route with cargo bike
|
|
||||||
width = nil, -- Cargo bike could 0.5 width, in meters
|
|
||||||
exclude_cargo_bike = false,
|
|
||||||
|
|
||||||
allowed_start_modes = Set {
|
allowed_start_modes = Set {
|
||||||
mode.cycling,
|
mode.cycling,
|
||||||
mode.pushing_bike
|
mode.pushing_bike
|
||||||
@ -247,27 +243,6 @@ function process_node(profile, node, result)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if profile.exclude_cargo_bike then
|
|
||||||
local cargo_bike = node:get_value_by_key("cargo_bike")
|
|
||||||
if cargo_bike and cargo_bike == "no" then
|
|
||||||
result.barrier = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- width
|
|
||||||
if profile.width then
|
|
||||||
-- From barrier=cycle_barrier or other barriers
|
|
||||||
local maxwidth_physical = node:get_value_by_key("maxwidth:physical")
|
|
||||||
local maxwidth_physical_meter = maxwidth_physical and Measure.parse_value_meters(maxwidth_physical) or 99
|
|
||||||
local opening = node:get_value_by_key("opening")
|
|
||||||
local opening_meter = opening and Measure.parse_value_meters(opening) or 99
|
|
||||||
local width_meter = math.min(maxwidth_physical_meter, opening_meter)
|
|
||||||
|
|
||||||
if width_meter and width_meter < profile.width then
|
|
||||||
result.barrier = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- check if node is a traffic light
|
-- check if node is a traffic light
|
||||||
result.traffic_lights = TrafficSignal.get_value(node)
|
result.traffic_lights = TrafficSignal.get_value(node)
|
||||||
end
|
end
|
||||||
@ -324,8 +299,6 @@ function handle_bicycle_tags(profile,way,result,data)
|
|||||||
|
|
||||||
bike_push_handler(profile,way,result,data)
|
bike_push_handler(profile,way,result,data)
|
||||||
|
|
||||||
-- width should be after bike_push
|
|
||||||
width_handler(profile,way,result,data)
|
|
||||||
|
|
||||||
-- maxspeed
|
-- maxspeed
|
||||||
limit( result, data.maxspeed, data.maxspeed_forward, data.maxspeed_backward )
|
limit( result, data.maxspeed, data.maxspeed_forward, data.maxspeed_backward )
|
||||||
@ -480,27 +453,6 @@ function cycleway_handler(profile,way,result,data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function width_handler(profile,way,result,data)
|
|
||||||
if profile.exclude_cargo_bike then
|
|
||||||
local cargo_bike = way:get_value_by_key("cargo_bike")
|
|
||||||
if cargo_bike and cargo_bike == "no" then
|
|
||||||
result.forward_mode = mode.inaccessible
|
|
||||||
result.backward_mode = mode.inaccessible
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if profile.width then
|
|
||||||
local width = way:get_value_by_key("width")
|
|
||||||
if width then
|
|
||||||
local width_meter = Measure.parse_value_meters(width)
|
|
||||||
if width_meter and width_meter < profile.width then
|
|
||||||
result.forward_mode = mode.inaccessible
|
|
||||||
result.backward_mode = mode.inaccessible
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function bike_push_handler(profile,way,result,data)
|
function bike_push_handler(profile,way,result,data)
|
||||||
-- pushing bikes - if no other mode found
|
-- pushing bikes - if no other mode found
|
||||||
if result.forward_mode == mode.inaccessible or result.backward_mode == mode.inaccessible or
|
if result.forward_mode == mode.inaccessible or result.backward_mode == mode.inaccessible or
|
||||||
|
@ -50,26 +50,27 @@ function measure_peak_ram_and_time {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function run_benchmarks_for_folder {
|
function run_benchmarks_for_folder {
|
||||||
|
rm -rf $RESULTS_FOLDER
|
||||||
mkdir -p $RESULTS_FOLDER
|
mkdir -p $RESULTS_FOLDER
|
||||||
|
|
||||||
BENCHMARKS_FOLDER="$BINARIES_FOLDER/src/benchmarks"
|
BENCHMARKS_FOLDER="$BINARIES_FOLDER/src/benchmarks"
|
||||||
|
|
||||||
echo "Running match-bench MLD"
|
# echo "Running match-bench MLD"
|
||||||
$BENCHMARKS_FOLDER/match-bench "$FOLDER/test/data/mld/monaco.osrm" mld > "$RESULTS_FOLDER/match_mld.bench"
|
# $BENCHMARKS_FOLDER/match-bench "$FOLDER/test/data/mld/monaco.osrm" mld > "$RESULTS_FOLDER/match_mld.bench"
|
||||||
echo "Running match-bench CH"
|
# echo "Running match-bench CH"
|
||||||
$BENCHMARKS_FOLDER/match-bench "$FOLDER/test/data/ch/monaco.osrm" ch > "$RESULTS_FOLDER/match_ch.bench"
|
# $BENCHMARKS_FOLDER/match-bench "$FOLDER/test/data/ch/monaco.osrm" ch > "$RESULTS_FOLDER/match_ch.bench"
|
||||||
echo "Running route-bench MLD"
|
# echo "Running route-bench MLD"
|
||||||
$BENCHMARKS_FOLDER/route-bench "$FOLDER/test/data/mld/monaco.osrm" mld > "$RESULTS_FOLDER/route_mld.bench"
|
# $BENCHMARKS_FOLDER/route-bench "$FOLDER/test/data/mld/monaco.osrm" mld > "$RESULTS_FOLDER/route_mld.bench"
|
||||||
echo "Running route-bench CH"
|
# echo "Running route-bench CH"
|
||||||
$BENCHMARKS_FOLDER/route-bench "$FOLDER/test/data/ch/monaco.osrm" ch > "$RESULTS_FOLDER/route_ch.bench"
|
# $BENCHMARKS_FOLDER/route-bench "$FOLDER/test/data/ch/monaco.osrm" ch > "$RESULTS_FOLDER/route_ch.bench"
|
||||||
echo "Running alias"
|
# echo "Running alias"
|
||||||
$BENCHMARKS_FOLDER/alias-bench > "$RESULTS_FOLDER/alias.bench"
|
# $BENCHMARKS_FOLDER/alias-bench > "$RESULTS_FOLDER/alias.bench"
|
||||||
echo "Running json-render-bench"
|
# echo "Running json-render-bench"
|
||||||
$BENCHMARKS_FOLDER/json-render-bench "$FOLDER/test/data/portugal_to_korea.json" > "$RESULTS_FOLDER/json-render.bench"
|
# $BENCHMARKS_FOLDER/json-render-bench "$FOLDER/test/data/portugal_to_korea.json" > "$RESULTS_FOLDER/json-render.bench"
|
||||||
echo "Running packedvector-bench"
|
# echo "Running packedvector-bench"
|
||||||
$BENCHMARKS_FOLDER/packedvector-bench > "$RESULTS_FOLDER/packedvector.bench"
|
# $BENCHMARKS_FOLDER/packedvector-bench > "$RESULTS_FOLDER/packedvector.bench"
|
||||||
echo "Running rtree-bench"
|
# echo "Running rtree-bench"
|
||||||
$BENCHMARKS_FOLDER/rtree-bench "$FOLDER/test/data/monaco.osrm.ramIndex" "$FOLDER/test/data/monaco.osrm.fileIndex" "$FOLDER/test/data/monaco.osrm.nbg_nodes" > "$RESULTS_FOLDER/rtree.bench"
|
# $BENCHMARKS_FOLDER/rtree-bench "$FOLDER/test/data/monaco.osrm.ramIndex" "$FOLDER/test/data/monaco.osrm.fileIndex" "$FOLDER/test/data/monaco.osrm.nbg_nodes" > "$RESULTS_FOLDER/rtree.bench"
|
||||||
|
|
||||||
cp -rf $OSM_PBF $FOLDER/data.osm.pbf
|
cp -rf $OSM_PBF $FOLDER/data.osm.pbf
|
||||||
|
|
||||||
@ -83,19 +84,19 @@ function run_benchmarks_for_folder {
|
|||||||
measure_peak_ram_and_time "$BINARIES_FOLDER/osrm-contract $FOLDER/data.osrm" "$RESULTS_FOLDER/osrm_contract.bench"
|
measure_peak_ram_and_time "$BINARIES_FOLDER/osrm-contract $FOLDER/data.osrm" "$RESULTS_FOLDER/osrm_contract.bench"
|
||||||
|
|
||||||
|
|
||||||
for ALGORITHM in ch mld; do
|
# for ALGORITHM in ch mld; do
|
||||||
for BENCH in nearest table trip route match; do
|
# for BENCH in nearest table trip route match; do
|
||||||
echo "Running node $BENCH $ALGORITHM"
|
# echo "Running node $BENCH $ALGORITHM"
|
||||||
START=$(date +%s.%N)
|
# START=$(date +%s.%N)
|
||||||
node $SCRIPTS_FOLDER/scripts/ci/bench.js $FOLDER/lib/binding/node_osrm.node $FOLDER/data.osrm $ALGORITHM $BENCH $GPS_TRACES > "$RESULTS_FOLDER/node_${BENCH}_${ALGORITHM}.bench" 5
|
# node $SCRIPTS_FOLDER/scripts/ci/bench.js $FOLDER/lib/binding/node_osrm.node $FOLDER/data.osrm $ALGORITHM $BENCH $GPS_TRACES > "$RESULTS_FOLDER/node_${BENCH}_${ALGORITHM}.bench" 5
|
||||||
END=$(date +%s.%N)
|
# END=$(date +%s.%N)
|
||||||
DIFF=$(echo "$END - $START" | bc)
|
# DIFF=$(echo "$END - $START" | bc)
|
||||||
echo "Took: ${DIFF}s"
|
# echo "Took: ${DIFF}s"
|
||||||
done
|
# done
|
||||||
done
|
# done
|
||||||
|
|
||||||
for ALGORITHM in ch mld; do
|
for ALGORITHM in mld; do
|
||||||
for BENCH in nearest table trip route match; do
|
for BENCH in match; do
|
||||||
echo "Running random $BENCH $ALGORITHM"
|
echo "Running random $BENCH $ALGORITHM"
|
||||||
START=$(date +%s.%N)
|
START=$(date +%s.%N)
|
||||||
$BENCHMARKS_FOLDER/bench "$FOLDER/data.osrm" $ALGORITHM $GPS_TRACES ${BENCH} > "$RESULTS_FOLDER/random_${BENCH}_${ALGORITHM}.bench" 5 || true
|
$BENCHMARKS_FOLDER/bench "$FOLDER/data.osrm" $ALGORITHM $GPS_TRACES ${BENCH} > "$RESULTS_FOLDER/random_${BENCH}_${ALGORITHM}.bench" 5 || true
|
||||||
@ -106,28 +107,28 @@ function run_benchmarks_for_folder {
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
for ALGORITHM in ch mld; do
|
# for ALGORITHM in ch mld; do
|
||||||
$BINARIES_FOLDER/osrm-routed --algorithm $ALGORITHM $FOLDER/data.osrm > /dev/null 2>&1 &
|
# $BINARIES_FOLDER/osrm-routed --algorithm $ALGORITHM $FOLDER/data.osrm > /dev/null 2>&1 &
|
||||||
OSRM_ROUTED_PID=$!
|
# OSRM_ROUTED_PID=$!
|
||||||
|
|
||||||
# wait for osrm-routed to start
|
# # wait for osrm-routed to start
|
||||||
if ! curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" > /dev/null 2>&1; then
|
# if ! curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" > /dev/null 2>&1; then
|
||||||
echo "osrm-routed failed to start for algorithm $ALGORITHM"
|
# echo "osrm-routed failed to start for algorithm $ALGORITHM"
|
||||||
kill -9 $OSRM_ROUTED_PID
|
# kill -9 $OSRM_ROUTED_PID
|
||||||
continue
|
# continue
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
for METHOD in route nearest trip table match; do
|
# for METHOD in route nearest trip table match; do
|
||||||
echo "Running e2e benchmark for $METHOD $ALGORITHM"
|
# echo "Running e2e benchmark for $METHOD $ALGORITHM"
|
||||||
START=$(date +%s.%N)
|
# START=$(date +%s.%N)
|
||||||
python3 $SCRIPTS_FOLDER/scripts/ci/e2e_benchmark.py --host http://localhost:5000 --method $METHOD --iterations 5 --num_requests 1000 --gps_traces_file_path $GPS_TRACES > $RESULTS_FOLDER/e2e_${METHOD}_${ALGORITHM}.bench
|
# python3 $SCRIPTS_FOLDER/scripts/ci/e2e_benchmark.py --host http://localhost:5000 --method $METHOD --iterations 5 --num_requests 1000 --gps_traces_file_path $GPS_TRACES > $RESULTS_FOLDER/e2e_${METHOD}_${ALGORITHM}.bench
|
||||||
END=$(date +%s.%N)
|
# END=$(date +%s.%N)
|
||||||
DIFF=$(echo "$END - $START" | bc)
|
# DIFF=$(echo "$END - $START" | bc)
|
||||||
echo "Took: ${DIFF}s"
|
# echo "Took: ${DIFF}s"
|
||||||
done
|
# done
|
||||||
|
|
||||||
kill -9 $OSRM_ROUTED_PID
|
# kill -9 $OSRM_ROUTED_PID
|
||||||
done
|
# done
|
||||||
}
|
}
|
||||||
|
|
||||||
run_benchmarks_for_folder
|
run_benchmarks_for_folder
|
||||||
|
@ -10,7 +10,7 @@ set -o nounset
|
|||||||
# http://git.661346.n2.nabble.com/subtree-merges-lose-prefix-after-rebase-td7332850.html
|
# http://git.661346.n2.nabble.com/subtree-merges-lose-prefix-after-rebase-td7332850.html
|
||||||
|
|
||||||
OSMIUM_PATH="osmcode/libosmium"
|
OSMIUM_PATH="osmcode/libosmium"
|
||||||
OSMIUM_TAG=v2.20.0
|
OSMIUM_TAG=v2.14.0
|
||||||
|
|
||||||
SOL_PATH="ThePhD/sol2"
|
SOL_PATH="ThePhD/sol2"
|
||||||
SOL_TAG=v3.3.0
|
SOL_TAG=v3.3.0
|
||||||
@ -22,7 +22,7 @@ MICROTAR_PATH="rxi/microtar"
|
|||||||
MICROTAR_TAG=v0.1.0
|
MICROTAR_TAG=v0.1.0
|
||||||
|
|
||||||
PROTOZERO_PATH="mapbox/protozero"
|
PROTOZERO_PATH="mapbox/protozero"
|
||||||
PROTOZERO_TAG=v1.7.1
|
PROTOZERO_TAG=v1.6.2
|
||||||
|
|
||||||
VTZERO_PATH="mapbox/vtzero"
|
VTZERO_PATH="mapbox/vtzero"
|
||||||
VTZERO_TAG=v1.1.0
|
VTZERO_TAG=v1.1.0
|
||||||
|
@ -9,17 +9,12 @@
|
|||||||
#include <rapidjson/document.h>
|
#include <rapidjson/document.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <unordered_set>
|
|
||||||
|
|
||||||
using namespace osrm;
|
using namespace osrm;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
// we use std::string_view as a key in the object, so since here we have dynamic keys we have to
|
|
||||||
// "hold" them somewhere okay for tests...
|
|
||||||
static std::unordered_set<std::string> gKeysHolder;
|
|
||||||
|
|
||||||
void convert(const rapidjson::Value &value, json::Value &result)
|
void convert(const rapidjson::Value &value, json::Value &result)
|
||||||
{
|
{
|
||||||
if (value.IsString())
|
if (value.IsString())
|
||||||
@ -37,8 +32,7 @@ void convert(const rapidjson::Value &value, json::Value &result)
|
|||||||
{
|
{
|
||||||
json::Value member;
|
json::Value member;
|
||||||
convert(itr->value, member);
|
convert(itr->value, member);
|
||||||
auto keyItr = gKeysHolder.emplace(itr->name.GetString()).first;
|
object.values.emplace(itr->name.GetString(), std::move(member));
|
||||||
object.values.emplace(*keyItr, std::move(member));
|
|
||||||
}
|
}
|
||||||
result = std::move(object);
|
result = std::move(object);
|
||||||
}
|
}
|
||||||
@ -128,7 +122,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (std::string{out_vec.begin(), out_vec.end()} != out_str || out_str != out_ss_str)
|
if (std::string{out_vec.begin(), out_vec.end()} != out_str || out_str != out_ss_str)
|
||||||
{
|
{
|
||||||
std::cerr << "Vector/string results are not equal\n";
|
|
||||||
throw std::logic_error("Vector/stringstream/string results are not equal");
|
throw std::logic_error("Vector/stringstream/string results are not equal");
|
||||||
}
|
}
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
@ -222,6 +222,7 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
std::vector<EdgeDuration> durations_table(target_indices.size(), MAXIMAL_EDGE_DURATION);
|
std::vector<EdgeDuration> durations_table(target_indices.size(), MAXIMAL_EDGE_DURATION);
|
||||||
std::vector<EdgeDistance> distances_table(calculate_distance ? target_indices.size() : 0,
|
std::vector<EdgeDistance> distances_table(calculate_distance ? target_indices.size() : 0,
|
||||||
MAXIMAL_EDGE_DISTANCE);
|
MAXIMAL_EDGE_DISTANCE);
|
||||||
|
std::vector<NodeID> middle_nodes_table(target_indices.size(), SPECIAL_NODEID);
|
||||||
|
|
||||||
// Collect destination (source) nodes into a map
|
// Collect destination (source) nodes into a map
|
||||||
std::unordered_multimap<NodeID, std::tuple<std::size_t, EdgeWeight, EdgeDuration, EdgeDistance>>
|
std::unordered_multimap<NodeID, std::tuple<std::size_t, EdgeWeight, EdgeDuration, EdgeDistance>>
|
||||||
@ -306,6 +307,7 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
weights_table[index] = path_weight;
|
weights_table[index] = path_weight;
|
||||||
durations_table[index] = path_duration;
|
durations_table[index] = path_duration;
|
||||||
current_distance = path_distance;
|
current_distance = path_distance;
|
||||||
|
middle_nodes_table[index] = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove node from destinations list
|
// Remove node from destinations list
|
||||||
|
@ -45,7 +45,8 @@ unsigned getMedianSampleTime(const std::vector<unsigned> ×tamps)
|
|||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
inline void initializeHeap(SearchEngineData<Algorithm> &engine_working_data,
|
inline void initializeHeap(SearchEngineData<Algorithm> &engine_working_data,
|
||||||
const DataFacade<Algorithm> &facade)
|
const DataFacade<Algorithm> &facade,
|
||||||
|
size_t)
|
||||||
{
|
{
|
||||||
|
|
||||||
const auto nodes_number = facade.GetNumberOfNodes();
|
const auto nodes_number = facade.GetNumberOfNodes();
|
||||||
@ -54,14 +55,92 @@ inline void initializeHeap(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline void initializeHeap<mld::Algorithm>(SearchEngineData<mld::Algorithm> &engine_working_data,
|
inline void initializeHeap<mld::Algorithm>(SearchEngineData<mld::Algorithm> &engine_working_data,
|
||||||
const DataFacade<mld::Algorithm> &facade)
|
const DataFacade<mld::Algorithm> &facade,
|
||||||
|
size_t max_candidates)
|
||||||
{
|
{
|
||||||
|
|
||||||
const auto nodes_number = facade.GetNumberOfNodes();
|
const auto nodes_number = facade.GetNumberOfNodes();
|
||||||
const auto border_nodes_number = facade.GetMaxBorderNodeID() + 1;
|
const auto border_nodes_number = facade.GetMaxBorderNodeID() + 1;
|
||||||
engine_working_data.InitializeOrClearMapMatchingThreadLocalStorage(nodes_number,
|
engine_working_data.InitializeOrClearMapMatchingThreadLocalStorage(
|
||||||
border_nodes_number);
|
nodes_number, border_nodes_number, max_candidates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
template <typename T> void saveVectorToFile(const std::vector<T> &data, const std::string &filename)
|
||||||
|
{
|
||||||
|
std::ofstream outFile(filename, std::ios::binary);
|
||||||
|
if (!outFile)
|
||||||
|
{
|
||||||
|
std::cerr << "Error opening file for writing: " << filename << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
size_t size = data.size();
|
||||||
|
outFile.write(reinterpret_cast<const char *>(&size), sizeof(size));
|
||||||
|
outFile.write(reinterpret_cast<const char *>(data.data()), size * sizeof(T));
|
||||||
|
outFile.close();
|
||||||
|
if (!outFile.good())
|
||||||
|
{
|
||||||
|
std::cerr << "Error occurred at writing time!" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T> bool loadVectorFromFile(std::vector<T> &data, const std::string &filename)
|
||||||
|
{
|
||||||
|
std::ifstream inFile(filename, std::ios::binary);
|
||||||
|
if (!inFile)
|
||||||
|
{
|
||||||
|
std::cerr << "Error opening file for reading: " << filename << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
size_t size;
|
||||||
|
inFile.read(reinterpret_cast<char *>(&size), sizeof(size));
|
||||||
|
data.resize(size);
|
||||||
|
inFile.read(reinterpret_cast<char *>(data.data()), size * sizeof(T));
|
||||||
|
inFile.close();
|
||||||
|
if (!inFile.good())
|
||||||
|
{
|
||||||
|
std::cerr << "Error occurred at reading time!" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T> void saveStructToFile(const T &data, const std::string &filename)
|
||||||
|
{
|
||||||
|
std::ofstream outFile(filename, std::ios::binary);
|
||||||
|
if (!outFile)
|
||||||
|
{
|
||||||
|
std::cerr << "Error opening file for writing: " << filename << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
outFile.write(reinterpret_cast<const char *>(&data), sizeof(T));
|
||||||
|
outFile.close();
|
||||||
|
if (!outFile.good())
|
||||||
|
{
|
||||||
|
std::cerr << "Error occurred at writing time!" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T> bool loadStructFromFile(T &data, const std::string &filename)
|
||||||
|
{
|
||||||
|
std::ifstream inFile(filename, std::ios::binary);
|
||||||
|
if (!inFile)
|
||||||
|
{
|
||||||
|
std::cerr << "Error opening file for reading: " << filename << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
inFile.read(reinterpret_cast<char *>(&data), sizeof(T));
|
||||||
|
inFile.close();
|
||||||
|
if (!inFile.good())
|
||||||
|
{
|
||||||
|
std::cerr << "Error occurred at reading time!" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
template <typename Algorithm>
|
template <typename Algorithm>
|
||||||
@ -144,9 +223,16 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
return sub_matchings;
|
return sub_matchings;
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeHeap(engine_working_data, facade);
|
size_t max_candidates = 0;
|
||||||
|
for (const auto &candidates : candidates_list)
|
||||||
|
{
|
||||||
|
max_candidates = std::max(max_candidates, candidates.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
initializeHeap(engine_working_data, facade, max_candidates);
|
||||||
auto &forward_heap = *engine_working_data.map_matching_forward_heap_1;
|
auto &forward_heap = *engine_working_data.map_matching_forward_heap_1;
|
||||||
auto &reverse_heap = *engine_working_data.map_matching_reverse_heap_1;
|
auto &reverse_heap = *engine_working_data.map_matching_reverse_heap_1;
|
||||||
|
const auto &reverse_heaps = engine_working_data.map_matching_reverse_heaps;
|
||||||
|
|
||||||
std::size_t breakage_begin = map_matching::INVALID_STATE;
|
std::size_t breakage_begin = map_matching::INVALID_STATE;
|
||||||
std::vector<std::size_t> split_points;
|
std::vector<std::size_t> split_points;
|
||||||
@ -225,6 +311,108 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PhantomNode source;
|
||||||
|
// loadStructFromFile<PhantomNode>(source, "source.bin");
|
||||||
|
std::vector<PhantomNode> target_phantom_nodes;
|
||||||
|
// loadVectorFromFile(target_phantom_nodes, "target.bin");
|
||||||
|
// target_phantom_nodes.erase(target_phantom_nodes.begin());
|
||||||
|
// target_phantom_nodes.erase(target_phantom_nodes.begin());
|
||||||
|
// target_phantom_nodes.erase(target_phantom_nodes.begin());
|
||||||
|
// target_phantom_nodes.erase(target_phantom_nodes.begin());
|
||||||
|
// target_phantom_nodes.pop_back();
|
||||||
|
// target_phantom_nodes.pop_back();
|
||||||
|
// target_phantom_nodes.erase(target_phantom_nodes.begin() + 1);
|
||||||
|
|
||||||
|
// target_phantom_nodes.push_back(target);
|
||||||
|
for (const auto s_prime : util::irange<std::size_t>(0UL, current_viterbi.size()))
|
||||||
|
{
|
||||||
|
const double emission_pr = emission_log_probabilities[t][s_prime];
|
||||||
|
double new_value = prev_viterbi[s] + emission_pr;
|
||||||
|
if (current_viterbi[s_prime] > new_value)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
target_phantom_nodes.push_back(current_timestamps_list[s_prime].phantom_node);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TIMER_START(NEW_DIST);
|
||||||
|
|
||||||
|
#define MODE 1
|
||||||
|
|
||||||
|
#if MODE == 0
|
||||||
|
auto new_distances =
|
||||||
|
getNetworkDistances(engine_working_data,
|
||||||
|
facade,
|
||||||
|
forward_heap,
|
||||||
|
reverse_heaps,
|
||||||
|
prev_unbroken_timestamps_list[s].phantom_node,
|
||||||
|
target_phantom_nodes,
|
||||||
|
weight_upper_bound);
|
||||||
|
std::vector<double> old_distances;
|
||||||
|
|
||||||
|
for (const auto &pn : target_phantom_nodes)
|
||||||
|
{
|
||||||
|
double network_distance =
|
||||||
|
getNetworkDistance(engine_working_data,
|
||||||
|
facade,
|
||||||
|
forward_heap,
|
||||||
|
reverse_heap,
|
||||||
|
prev_unbroken_timestamps_list[s].phantom_node,
|
||||||
|
pn,
|
||||||
|
weight_upper_bound);
|
||||||
|
old_distances.push_back(network_distance);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < old_distances.size(); ++i)
|
||||||
|
{
|
||||||
|
if (std::abs(old_distances[i] - new_distances[i]) > 0.01)
|
||||||
|
{
|
||||||
|
// saveStructToFile(prev_unbroken_timestamps_list[s].phantom_node,
|
||||||
|
// "source.bin");
|
||||||
|
// saveVectorToFile(target_phantom_nodes, "target.bin");
|
||||||
|
std::cerr << "OOPS " << old_distances[i] << " " << new_distances[i]
|
||||||
|
<< std::endl;
|
||||||
|
// std::exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto distances = old_distances;
|
||||||
|
#elif MODE == 1
|
||||||
|
(void)reverse_heap;
|
||||||
|
auto distances =
|
||||||
|
getNetworkDistances(engine_working_data,
|
||||||
|
facade,
|
||||||
|
forward_heap,
|
||||||
|
reverse_heaps,
|
||||||
|
prev_unbroken_timestamps_list[s].phantom_node,
|
||||||
|
target_phantom_nodes,
|
||||||
|
weight_upper_bound);
|
||||||
|
// TIMER_STOP(NEW_DIST);
|
||||||
|
#else
|
||||||
|
// TIMER_START(OLD_DIST);
|
||||||
|
(void)reverse_heaps;
|
||||||
|
std::vector<double> distances;
|
||||||
|
|
||||||
|
for (const auto &pn : target_phantom_nodes)
|
||||||
|
{
|
||||||
|
double network_distance =
|
||||||
|
getNetworkDistance(engine_working_data,
|
||||||
|
facade,
|
||||||
|
forward_heap,
|
||||||
|
reverse_heap,
|
||||||
|
prev_unbroken_timestamps_list[s].phantom_node,
|
||||||
|
pn,
|
||||||
|
weight_upper_bound);
|
||||||
|
distances.push_back(network_distance);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
// TIMER_STOP(OLD_DIST);
|
||||||
|
|
||||||
|
// std::cerr << "Old: " << TIMER_MSEC(OLD_DIST) << " New: " << TIMER_MSEC(NEW_DIST)
|
||||||
|
// << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
size_t distance_index = 0;
|
||||||
for (const auto s_prime : util::irange<std::size_t>(0UL, current_viterbi.size()))
|
for (const auto s_prime : util::irange<std::size_t>(0UL, current_viterbi.size()))
|
||||||
{
|
{
|
||||||
const double emission_pr = emission_log_probabilities[t][s_prime];
|
const double emission_pr = emission_log_probabilities[t][s_prime];
|
||||||
@ -234,14 +422,16 @@ SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
double network_distance =
|
double network_distance = distances[distance_index];
|
||||||
getNetworkDistance(engine_working_data,
|
++distance_index;
|
||||||
facade,
|
// double network_distance =
|
||||||
forward_heap,
|
// getNetworkDistance(engine_working_data,
|
||||||
reverse_heap,
|
// facade,
|
||||||
prev_unbroken_timestamps_list[s].phantom_node,
|
// forward_heap,
|
||||||
current_timestamps_list[s_prime].phantom_node,
|
// reverse_heap,
|
||||||
weight_upper_bound);
|
// prev_unbroken_timestamps_list[s].phantom_node,
|
||||||
|
// current_timestamps_list[s_prime].phantom_node,
|
||||||
|
// weight_upper_bound);
|
||||||
|
|
||||||
// get distance diff between loc1/2 and locs/s_prime
|
// get distance diff between loc1/2 and locs/s_prime
|
||||||
const auto d_t = std::abs(network_distance - haversine_distance);
|
const auto d_t = std::abs(network_distance - haversine_distance);
|
||||||
|
@ -15,6 +15,8 @@ thread_local SearchEngineData<CH>::SearchEngineHeapPtr
|
|||||||
SearchEngineData<CH>::map_matching_forward_heap_1;
|
SearchEngineData<CH>::map_matching_forward_heap_1;
|
||||||
thread_local SearchEngineData<CH>::SearchEngineHeapPtr
|
thread_local SearchEngineData<CH>::SearchEngineHeapPtr
|
||||||
SearchEngineData<CH>::map_matching_reverse_heap_1;
|
SearchEngineData<CH>::map_matching_reverse_heap_1;
|
||||||
|
thread_local std::vector<typename SearchEngineData<CH>::SearchEngineHeapPtr>
|
||||||
|
SearchEngineData<CH>::map_matching_reverse_heaps;
|
||||||
|
|
||||||
thread_local SearchEngineData<CH>::ManyToManyHeapPtr SearchEngineData<CH>::many_to_many_heap;
|
thread_local SearchEngineData<CH>::ManyToManyHeapPtr SearchEngineData<CH>::many_to_many_heap;
|
||||||
|
|
||||||
@ -123,9 +125,11 @@ thread_local SearchEngineData<MLD>::MapMatchingHeapPtr
|
|||||||
thread_local SearchEngineData<MLD>::MapMatchingHeapPtr
|
thread_local SearchEngineData<MLD>::MapMatchingHeapPtr
|
||||||
SearchEngineData<MLD>::map_matching_reverse_heap_1;
|
SearchEngineData<MLD>::map_matching_reverse_heap_1;
|
||||||
thread_local SearchEngineData<MLD>::ManyToManyHeapPtr SearchEngineData<MLD>::many_to_many_heap;
|
thread_local SearchEngineData<MLD>::ManyToManyHeapPtr SearchEngineData<MLD>::many_to_many_heap;
|
||||||
|
thread_local std::vector<typename SearchEngineData<MLD>::MapMatchingHeapPtr>
|
||||||
|
SearchEngineData<MLD>::map_matching_reverse_heaps;
|
||||||
|
|
||||||
void SearchEngineData<MLD>::InitializeOrClearMapMatchingThreadLocalStorage(
|
void SearchEngineData<MLD>::InitializeOrClearMapMatchingThreadLocalStorage(
|
||||||
unsigned number_of_nodes, unsigned number_of_boundary_nodes)
|
unsigned number_of_nodes, unsigned number_of_boundary_nodes, size_t max_candidates)
|
||||||
{
|
{
|
||||||
if (map_matching_forward_heap_1.get())
|
if (map_matching_forward_heap_1.get())
|
||||||
{
|
{
|
||||||
@ -146,6 +150,16 @@ void SearchEngineData<MLD>::InitializeOrClearMapMatchingThreadLocalStorage(
|
|||||||
map_matching_reverse_heap_1.reset(
|
map_matching_reverse_heap_1.reset(
|
||||||
new MapMatchingQueryHeap(number_of_nodes, number_of_boundary_nodes));
|
new MapMatchingQueryHeap(number_of_nodes, number_of_boundary_nodes));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (max_candidates > map_matching_reverse_heaps.size())
|
||||||
|
{
|
||||||
|
size_t to_add = max_candidates - map_matching_reverse_heaps.size();
|
||||||
|
for (unsigned i = 0; i < to_add; ++i)
|
||||||
|
{
|
||||||
|
map_matching_reverse_heaps.emplace_back(
|
||||||
|
new MapMatchingQueryHeap(number_of_nodes, number_of_boundary_nodes));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchEngineData<MLD>::InitializeOrClearFirstThreadLocalStorage(
|
void SearchEngineData<MLD>::InitializeOrClearFirstThreadLocalStorage(
|
||||||
|
5
third_party/libosmium/.clang-tidy
vendored
5
third_party/libosmium/.clang-tidy
vendored
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
Checks: '*,-abseil-string-find-str-contains,-altera-*,-android-cloexec-*,-bugprone-branch-clone,-bugprone-easily-swappable-parameters,-bugprone-macro-parentheses,-cert-dcl21-cpp,-cert-err58-cpp,-clang-analyzer-optin.cplusplus.VirtualCall,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-macro-usage,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-invalid-access-moved,-hicpp-no-array-decay,-hicpp-no-assembler,-hicpp-vararg,-llvmlibc-*,-llvm-qualified-auto,-misc-macro-parentheses,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-unused-parameters,-modernize-avoid-c-arrays,-modernize-make-unique,-modernize-raw-string-literal,-modernize-use-trailing-return-type,-readability-avoid-const-params-in-decls,-readability-convert-member-functions-to-static,-readability-function-cognitive-complexity,-readability-identifier-length,-readability-implicit-bool-cast,-readability-implicit-bool-conversion,-readability-magic-numbers,-readability-qualified-auto'
|
Checks: '*,-abseil-string-find-str-contains,-altera-*,-android-cloexec-*,-bugprone-branch-clone,-bugprone-easily-swappable-parameters,-bugprone-macro-parentheses,-cert-dcl21-cpp,-cert-err58-cpp,-clang-analyzer-optin.cplusplus.VirtualCall,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-macro-usage,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-invalid-access-moved,-hicpp-no-array-decay,-hicpp-no-assembler,-hicpp-vararg,-llvmlibc-*,-llvm-qualified-auto,-misc-macro-parentheses,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-unused-parameters,-modernize-avoid-c-arrays,-modernize-make-unique,-modernize-raw-string-literal,-modernize-use-trailing-return-type,-readability-avoid-const-params-in-decls,-readability-function-cognitive-complexity,-readability-identifier-length,-readability-implicit-bool-cast,-readability-implicit-bool-conversion,-readability-magic-numbers,-readability-qualified-auto'
|
||||||
#
|
#
|
||||||
# For a list of check options, see:
|
# For a list of check options, see:
|
||||||
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
|
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||||
@ -137,9 +137,6 @@ Checks: '*,-abseil-string-find-str-contains,-altera-*,-android-cloexec-*,-bugpro
|
|||||||
# This is header only library, so the declaration and implementation are
|
# This is header only library, so the declaration and implementation are
|
||||||
# often the same and we want to have the const in implementations.
|
# often the same and we want to have the const in implementations.
|
||||||
#
|
#
|
||||||
# readability-convert-member-functions-to-static
|
|
||||||
# Reports too many false positives
|
|
||||||
#
|
|
||||||
# readability-function-cognitive-complexity
|
# readability-function-cognitive-complexity
|
||||||
# Sometimes the large functions are needed.
|
# Sometimes the large functions are needed.
|
||||||
#
|
#
|
||||||
|
@ -7,13 +7,7 @@ runs:
|
|||||||
run: mkdir build
|
run: mkdir build
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: cmake -LA .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_HEADERS=OFF -DBUILD_BENCHMARKS=ON -DOsmium_DEBUG=TRUE -DPROTOZERO_INCLUDE_DIR=${GITHUB_WORKSPACE}/../protozero/include
|
||||||
cmake -LA .. \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
|
||||||
-DBUILD_HEADERS=OFF \
|
|
||||||
-DBUILD_BENCHMARKS=ON \
|
|
||||||
-DOsmium_DEBUG=TRUE \
|
|
||||||
-DPROTOZERO_INCLUDE_DIR=${GITHUB_WORKSPACE}/../protozero/include
|
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: build
|
working-directory: build
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -q
|
||||||
sudo apt-get install -yq \
|
sudo apt-get install -yq \
|
||||||
doxygen \
|
doxygen \
|
||||||
libboost-dev \
|
libboost-dev \
|
||||||
@ -16,5 +16,8 @@ runs:
|
|||||||
libsparsehash-dev \
|
libsparsehash-dev \
|
||||||
ruby-json \
|
ruby-json \
|
||||||
spatialite-bin
|
spatialite-bin
|
||||||
|
test "$CC" = clang-6.0 && sudo apt-get install -yq --no-install-suggests --no-install-recommends clang-6.0
|
||||||
|
test "$CC" = clang-8 && sudo apt-get install -yq --no-install-suggests --no-install-recommends clang-8
|
||||||
|
test "$CC" = clang-13 && sudo apt-get install -yq --no-install-suggests --no-install-recommends clang-13
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
236
third_party/libosmium/.github/workflows/ci.yml
vendored
236
third_party/libosmium/.github/workflows/ci.yml
vendored
@ -3,13 +3,14 @@ name: CI
|
|||||||
on: [ push, pull_request ]
|
on: [ push, pull_request ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
name: [Ubuntu-18, Ubuntu-20, Ubuntu-22, Debian-10, Debian-11, Debian-12, Debian-Testing, Debian-Experimental, Fedora-35, Fedora-36, Fedora-37, Fedora-38]
|
name: [Ubuntu-18, Ubuntu-20, Ubuntu-21, Debian-9, Debian-10, Debian-11, Debian-Testing, Debian-Experimental, Fedora-34]
|
||||||
build_type: [Dev]
|
build_type: [Dev]
|
||||||
cpp_compiler: [g++]
|
cpp_compiler: [g++]
|
||||||
cpp_version: [c++11]
|
cpp_version: [c++11]
|
||||||
@ -18,136 +19,122 @@ jobs:
|
|||||||
# Uses gcc 7.5.0, clang 6.0.0, cmake 3.10.2
|
# Uses gcc 7.5.0, clang 6.0.0, cmake 3.10.2
|
||||||
image: "ubuntu:18.04"
|
image: "ubuntu:18.04"
|
||||||
ubuntu: 18
|
ubuntu: 18
|
||||||
|
installer: apt
|
||||||
- name: Ubuntu-20
|
- name: Ubuntu-20
|
||||||
# Uses gcc 9.3.0, clang 10.0.0, cmake 3.16.3
|
# Uses gcc 9.3.0, clang 10.0.0, cmake 3.16.3
|
||||||
image: "ubuntu:20.04"
|
image: "ubuntu:20.04"
|
||||||
ubuntu: 20
|
ubuntu: 20
|
||||||
- name: Ubuntu-22
|
installer: apt
|
||||||
# Uses gcc 12.2.0, clang 15.0.7, cmake 3.24.2
|
- name: Ubuntu-21
|
||||||
image: "ubuntu:22.04"
|
# Uses gcc 10.3.0, clang, 12.0.0, cmake 3.18.4
|
||||||
ubuntu: 22
|
image: "ubuntu:21.04"
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
ubuntu: 21
|
||||||
|
installer: apt
|
||||||
|
- name: Debian-9
|
||||||
|
# Uses gcc 6.3.0, clang 3.8.1, cmake 3.7.2
|
||||||
|
image: "debian:stretch"
|
||||||
|
installer: apt
|
||||||
- name: Debian-10
|
- name: Debian-10
|
||||||
# Uses gcc 8.3.0, clang 7.0.1, cmake 3.13.4
|
# Uses gcc 8.3.0, clang 7.0.1, cmake 3.13.4
|
||||||
image: "debian:buster"
|
image: "debian:buster"
|
||||||
|
installer: apt
|
||||||
- name: Debian-11
|
- name: Debian-11
|
||||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
image: "debian:bullseye"
|
image: "debian:bullseye"
|
||||||
|
installer: apt
|
||||||
- name: Debian-11
|
- name: Debian-11
|
||||||
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
image: "debian:bullseye"
|
image: "debian:bullseye"
|
||||||
|
installer: apt
|
||||||
cpp_version: c++17
|
cpp_version: c++17
|
||||||
- name: Debian-11
|
- name: Debian-11
|
||||||
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
image: "debian:bullseye"
|
image: "debian:bullseye"
|
||||||
|
installer: apt
|
||||||
cpp_version: c++20
|
cpp_version: c++20
|
||||||
- name: Debian-11
|
- name: Debian-11
|
||||||
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
image: "debian:bullseye"
|
image: "debian:bullseye"
|
||||||
c_compiler: clang
|
installer: apt
|
||||||
cpp_compiler: clang++
|
|
||||||
- name: Debian-11
|
|
||||||
image: "debian:bullseye"
|
|
||||||
c_compiler: clang
|
c_compiler: clang
|
||||||
cpp_compiler: clang++
|
cpp_compiler: clang++
|
||||||
cpp_version: c++17
|
cpp_version: c++17
|
||||||
- name: Debian-11
|
- name: Debian-11
|
||||||
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
image: "debian:bullseye"
|
image: "debian:bullseye"
|
||||||
|
installer: apt
|
||||||
c_compiler: clang
|
c_compiler: clang
|
||||||
cpp_compiler: clang++
|
cpp_compiler: clang++
|
||||||
cpp_version: c++20
|
cpp_version: c++20
|
||||||
- name: Debian-11
|
- name: Debian-11
|
||||||
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
image: "debian:bullseye"
|
image: "debian:bullseye"
|
||||||
|
installer: apt
|
||||||
build_type: RelWithDebInfo
|
build_type: RelWithDebInfo
|
||||||
- name: Debian-11
|
- name: Debian-11
|
||||||
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
image: "debian:bullseye"
|
image: "debian:bullseye"
|
||||||
|
installer: apt
|
||||||
c_compiler: clang
|
c_compiler: clang
|
||||||
cpp_compiler: clang++
|
cpp_compiler: clang++
|
||||||
CXXFLAGS: -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer
|
- name: Debian-11
|
||||||
LDFLAGS: -fsanitize=address,undefined
|
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||||
- name: Debian-12
|
image: "debian:bullseye"
|
||||||
# Uses gcc 12.2.0, clang 15.0.6, cmake 3.25.1
|
installer: apt
|
||||||
image: "debian:bookworm"
|
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
|
||||||
- name: Debian-12
|
|
||||||
image: "debian:bookworm"
|
|
||||||
cpp_version: c++17
|
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
|
||||||
- name: Debian-12
|
|
||||||
image: "debian:bookworm"
|
|
||||||
cpp_version: c++20
|
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
|
||||||
- name: Debian-12
|
|
||||||
image: "debian:bookworm"
|
|
||||||
c_compiler: clang
|
c_compiler: clang
|
||||||
cpp_compiler: clang++
|
cpp_compiler: clang++
|
||||||
- name: Debian-12
|
CXXFLAGS: -fsanitize=address,undefined,integer -fno-sanitize-recover=all -fno-omit-frame-pointer
|
||||||
image: "debian:bookworm"
|
LDFLAGS: -fsanitize=address,undefined,integer
|
||||||
c_compiler: clang
|
|
||||||
cpp_compiler: clang++
|
|
||||||
cpp_version: c++17
|
|
||||||
- name: Debian-12
|
|
||||||
image: "debian:bookworm"
|
|
||||||
c_compiler: clang
|
|
||||||
cpp_compiler: clang++
|
|
||||||
cpp_version: c++20
|
|
||||||
- name: Debian-12
|
|
||||||
image: "debian:bookworm"
|
|
||||||
build_type: RelWithDebInfo
|
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
|
||||||
- name: Debian-12
|
|
||||||
image: "debian:bookworm"
|
|
||||||
c_compiler: clang
|
|
||||||
cpp_compiler: clang++
|
|
||||||
CXXFLAGS: -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer
|
|
||||||
LDFLAGS: -fsanitize=address,undefined
|
|
||||||
- name: Debian-Testing
|
- name: Debian-Testing
|
||||||
|
# Uses gcc 10.3.0, clang 11.1.0, cmake 3.21.3
|
||||||
image: "debian:testing"
|
image: "debian:testing"
|
||||||
CXXFLAGS: -Wno-stringop-overread -Wno-dangling-reference
|
installer: apt
|
||||||
|
CXXFLAGS: -Wno-stringop-overread
|
||||||
- name: Debian-Testing
|
- name: Debian-Testing
|
||||||
|
# Uses gcc 10.3.0, clang 11.1.0, cmake 3.21.3
|
||||||
image: "debian:testing"
|
image: "debian:testing"
|
||||||
|
installer: apt
|
||||||
c_compiler: clang
|
c_compiler: clang
|
||||||
cpp_compiler: clang++
|
cpp_compiler: clang++
|
||||||
- name: Debian-Experimental
|
- name: Debian-Experimental
|
||||||
|
# Uses gcc 11, clang 14, cmake 3.21.3
|
||||||
image: "debian:experimental"
|
image: "debian:experimental"
|
||||||
CXXFLAGS: -Wno-stringop-overread -Wno-dangling-reference
|
installer: apt
|
||||||
|
CXXFLAGS: -Wno-stringop-overread
|
||||||
- name: Debian-Experimental
|
- name: Debian-Experimental
|
||||||
|
# Uses gcc 11, clang 14, cmake 3.21.3
|
||||||
image: "debian:experimental"
|
image: "debian:experimental"
|
||||||
c_compiler: clang
|
installer: apt
|
||||||
cpp_compiler: clang++
|
c_compiler: clang-14
|
||||||
|
cpp_compiler: clang++-14
|
||||||
|
- name: Fedora-34
|
||||||
|
# Uses gcc 11.2.1, clang 12.0.1, cmake 3.20.5
|
||||||
|
image: "fedora:34"
|
||||||
|
installer: dnf
|
||||||
|
CXXFLAGS: -Wno-stringop-overread
|
||||||
- name: Fedora-35
|
- name: Fedora-35
|
||||||
# Uses gcc 11.2.1, clang 12.0.1, cmake 3.20.5
|
# Uses gcc 11.2.1, clang 12.0.1, cmake 3.20.5
|
||||||
image: "fedora:35"
|
image: "fedora:35"
|
||||||
|
installer: dnf
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
CXXFLAGS: -Wno-stringop-overread
|
||||||
- name: Fedora-36
|
|
||||||
# Uses gcc 12.2.0, clang 14.0.5, cmake 3.24.2
|
|
||||||
image: "fedora:36"
|
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
|
||||||
- name: Fedora-37
|
|
||||||
# Uses gcc 12.3.1, clang 15.0.7, cmake 3.26.4
|
|
||||||
image: "fedora:37"
|
|
||||||
CXXFLAGS: -Wno-stringop-overread
|
|
||||||
- name: Fedora-38
|
|
||||||
# Uses gcc 13.0.1, clang 16.0.5, cmake 3.26.4
|
|
||||||
image: "fedora:38"
|
|
||||||
CXXFLAGS: -Wno-stringop-overread -Wno-dangling-reference
|
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.image }}
|
image: ${{ matrix.image }}
|
||||||
env:
|
env:
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
BUILD_TYPE: ${{ matrix.build_type }}
|
BUILD_TYPE: ${{ matrix.build_type }}
|
||||||
CC: ${{ matrix.c_compiler }}
|
|
||||||
CXX: ${{ matrix.cpp_compiler }}
|
|
||||||
CXXFLAGS: ${{ matrix.CXXFLAGS }}
|
CXXFLAGS: ${{ matrix.CXXFLAGS }}
|
||||||
LDFLAGS: ${{ matrix.LDFLAGS }}
|
LDFLAGS: ${{ matrix.LDFLAGS }}
|
||||||
|
CC: ${{ matrix.c_compiler }}
|
||||||
|
CXX: ${{ matrix.cpp_compiler }}
|
||||||
CPP_VERSION: ${{ matrix.cpp_version }}
|
CPP_VERSION: ${{ matrix.cpp_version }}
|
||||||
WITH_PROJ: ON
|
WITH_PROJ: ON
|
||||||
APT_LISTCHANGES_FRONTEND: none
|
|
||||||
DEBIAN_FRONTEND: noninteractive
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare container (apt)
|
- name: Prepare container (apt)
|
||||||
shell: bash
|
|
||||||
if: startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:')
|
|
||||||
run: |
|
run: |
|
||||||
|
export APT_LISTCHANGES_FRONTEND=none
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -yq \
|
apt-get install -y \
|
||||||
clang \
|
clang \
|
||||||
cmake \
|
cmake \
|
||||||
doxygen \
|
doxygen \
|
||||||
@ -167,13 +154,16 @@ jobs:
|
|||||||
ruby-json \
|
ruby-json \
|
||||||
spatialite-bin \
|
spatialite-bin \
|
||||||
zlib1g-dev
|
zlib1g-dev
|
||||||
|
shell: bash
|
||||||
|
if: matrix.installer == 'apt'
|
||||||
- name: Install compiler
|
- name: Install compiler
|
||||||
shell: bash
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export APT_LISTCHANGES_FRONTEND=none
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y clang-14
|
||||||
if: matrix.cpp_compiler == 'clang++-14'
|
if: matrix.cpp_compiler == 'clang++-14'
|
||||||
run: apt-get install -yq clang-14
|
|
||||||
- name: Prepare container (dnf)
|
- name: Prepare container (dnf)
|
||||||
shell: bash
|
|
||||||
if: startsWith(matrix.image, 'fedora:')
|
|
||||||
run: |
|
run: |
|
||||||
dnf install --quiet --assumeyes \
|
dnf install --quiet --assumeyes \
|
||||||
boost-devel \
|
boost-devel \
|
||||||
@ -195,7 +185,9 @@ jobs:
|
|||||||
sparsehash-devel \
|
sparsehash-devel \
|
||||||
spatialite-tools \
|
spatialite-tools \
|
||||||
zlib-devel
|
zlib-devel
|
||||||
# Use v1 of checkout because v3 doesn't work with submodules
|
shell: bash
|
||||||
|
if: matrix.installer == 'dnf'
|
||||||
|
# Use v1 of checkout because v2 doesn't work with submodules
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
@ -205,23 +197,21 @@ jobs:
|
|||||||
- uses: ./.github/actions/ctest
|
- uses: ./.github/actions/ctest
|
||||||
|
|
||||||
ubuntu-latest:
|
ubuntu-latest:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
env:
|
env:
|
||||||
CC: clang-15
|
CC: clang-13
|
||||||
CXX: clang++-15
|
CXX: clang++-13
|
||||||
BUILD_TYPE: Dev
|
BUILD_TYPE: Dev
|
||||||
WITH_PROJ: ON
|
WITH_PROJ: ON
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Install new clang
|
- name: Install new clang
|
||||||
run: |
|
run: |
|
||||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.asc
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main'
|
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
|
||||||
sudo apt-get update -qq
|
|
||||||
sudo apt-get install -yq clang-15
|
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: ./.github/actions/install-ubuntu
|
- uses: ./.github/actions/install-ubuntu
|
||||||
- uses: ./.github/actions/install-protozero
|
- uses: ./.github/actions/install-protozero
|
||||||
@ -229,27 +219,16 @@ jobs:
|
|||||||
- uses: ./.github/actions/build
|
- uses: ./.github/actions/build
|
||||||
- uses: ./.github/actions/ctest
|
- uses: ./.github/actions/ctest
|
||||||
|
|
||||||
macos:
|
macos10-dev:
|
||||||
|
runs-on: macos-10.15
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- "macos-11"
|
|
||||||
- "macos-12"
|
|
||||||
- "macos-13"
|
|
||||||
build_type: [Dev]
|
|
||||||
include:
|
|
||||||
- os: "macos-12"
|
|
||||||
build_type: Release
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
env:
|
||||||
CC: clang
|
CC: clang
|
||||||
CXX: clang++
|
CXX: clang++
|
||||||
BUILD_TYPE: ${{ matrix.build_type }}
|
BUILD_TYPE: Dev
|
||||||
WITH_PROJ: OFF
|
WITH_PROJ: OFF
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: ./.github/actions/install-macos
|
- uses: ./.github/actions/install-macos
|
||||||
@ -258,17 +237,47 @@ jobs:
|
|||||||
- uses: ./.github/actions/build
|
- uses: ./.github/actions/build
|
||||||
- uses: ./.github/actions/ctest
|
- uses: ./.github/actions/ctest
|
||||||
|
|
||||||
windows-minimal:
|
macos11-dev:
|
||||||
timeout-minutes: 40
|
runs-on: macos-11
|
||||||
strategy:
|
timeout-minutes: 60
|
||||||
fail-fast: false
|
env:
|
||||||
matrix:
|
CC: clang
|
||||||
os:
|
CXX: clang++
|
||||||
- windows-2019
|
BUILD_TYPE: Dev
|
||||||
- windows-2022
|
WITH_PROJ: OFF
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- uses: ./.github/actions/install-macos
|
||||||
|
- uses: ./.github/actions/install-protozero
|
||||||
|
- uses: ./.github/actions/cmake
|
||||||
|
- uses: ./.github/actions/build
|
||||||
|
- uses: ./.github/actions/ctest
|
||||||
|
|
||||||
|
macos11-release:
|
||||||
|
runs-on: macos-11
|
||||||
|
timeout-minutes: 60
|
||||||
|
env:
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
|
BUILD_TYPE: Release
|
||||||
|
WITH_PROJ: OFF
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- uses: ./.github/actions/install-macos
|
||||||
|
- uses: ./.github/actions/install-protozero
|
||||||
|
- uses: ./.github/actions/cmake
|
||||||
|
- uses: ./.github/actions/build
|
||||||
|
- uses: ./.github/actions/ctest
|
||||||
|
|
||||||
|
windows-2019-minimal:
|
||||||
|
runs-on: windows-2019
|
||||||
|
timeout-minutes: 40
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: ./.github/actions/install-windows
|
- uses: ./.github/actions/install-windows
|
||||||
@ -280,7 +289,7 @@ jobs:
|
|||||||
windows-2019-full:
|
windows-2019-full:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: ./.github/actions/install-windows
|
- uses: ./.github/actions/install-windows
|
||||||
@ -292,3 +301,16 @@ jobs:
|
|||||||
- uses: ./.github/actions/build-windows
|
- uses: ./.github/actions/build-windows
|
||||||
- uses: ./.github/actions/ctest-windows
|
- uses: ./.github/actions/ctest-windows
|
||||||
|
|
||||||
|
windows-2022-minimal:
|
||||||
|
runs-on: windows-2022
|
||||||
|
timeout-minutes: 40
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- uses: ./.github/actions/install-windows
|
||||||
|
- uses: ./.github/actions/install-protozero
|
||||||
|
- uses: ./.github/actions/cmake-windows
|
||||||
|
- uses: ./.github/actions/build-windows
|
||||||
|
- uses: ./.github/actions/ctest-windows
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ name: clang-tidy
|
|||||||
on: workflow_dispatch
|
on: workflow_dispatch
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
clang-tidy:
|
clang-tidy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@ -13,9 +14,9 @@ jobs:
|
|||||||
- image: "debian:bullseye"
|
- image: "debian:bullseye"
|
||||||
clang: 11
|
clang: 11
|
||||||
- image: "debian:testing"
|
- image: "debian:testing"
|
||||||
clang: 15
|
clang: 12
|
||||||
- image: "debian:experimental"
|
- image: "debian:experimental"
|
||||||
clang: 15
|
clang: 14
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.image }}
|
image: ${{ matrix.image }}
|
||||||
env:
|
env:
|
||||||
@ -24,13 +25,13 @@ jobs:
|
|||||||
CXX: clang++-${{ matrix.clang }}
|
CXX: clang++-${{ matrix.clang }}
|
||||||
CPP_VERSION: c++11
|
CPP_VERSION: c++11
|
||||||
WITH_PROJ: ON
|
WITH_PROJ: ON
|
||||||
APT_LISTCHANGES_FRONTEND: none
|
|
||||||
DEBIAN_FRONTEND: noninteractive
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare container (apt)
|
- name: Prepare container (apt)
|
||||||
run: |
|
run: |
|
||||||
|
export APT_LISTCHANGES_FRONTEND=none
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -yq \
|
apt-get install -y \
|
||||||
clang-${{ matrix.clang }} \
|
clang-${{ matrix.clang }} \
|
||||||
clang-tidy-${{ matrix.clang }} \
|
clang-tidy-${{ matrix.clang }} \
|
||||||
cmake \
|
cmake \
|
||||||
@ -46,7 +47,7 @@ jobs:
|
|||||||
make \
|
make \
|
||||||
zlib1g-dev
|
zlib1g-dev
|
||||||
shell: bash
|
shell: bash
|
||||||
# Use v1 of checkout because v3 doesn't work with submodules
|
# Use v1 of checkout because v2 doesn't work with submodules
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
@ -57,7 +58,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: build
|
working-directory: build
|
||||||
- name: Upload Log
|
- name: Upload Log
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v2
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: clang-tidy-${{ matrix.clang }}-log
|
name: clang-tidy-${{ matrix.clang }}-log
|
||||||
|
53
third_party/libosmium/.ycm_extra_conf.py
vendored
Normal file
53
third_party/libosmium/.ycm_extra_conf.py
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Configuration for YouCompleteMe Vim plugin
|
||||||
|
#
|
||||||
|
# https://valloric.github.io/YouCompleteMe/
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
from os.path import realpath, dirname
|
||||||
|
|
||||||
|
basedir = dirname(realpath(__file__))
|
||||||
|
|
||||||
|
# some default flags
|
||||||
|
# for more information install clang-3.2-doc package and
|
||||||
|
# check UsersManual.html
|
||||||
|
flags = [
|
||||||
|
'-Werror',
|
||||||
|
'-Wall',
|
||||||
|
'-Wextra',
|
||||||
|
'-pedantic',
|
||||||
|
'-Wno-return-type',
|
||||||
|
'-Wno-unused-parameter',
|
||||||
|
'-Wno-unused-variable',
|
||||||
|
|
||||||
|
'-std=c++11',
|
||||||
|
|
||||||
|
# '-x' and 'c++' also required
|
||||||
|
# use 'c' for C projects
|
||||||
|
'-x',
|
||||||
|
'c++',
|
||||||
|
|
||||||
|
# workaround for https://github.com/Valloric/YouCompleteMe/issues/303
|
||||||
|
# also see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800618
|
||||||
|
'-isystem',
|
||||||
|
'/usr/lib/ycmd/clang_includes/',
|
||||||
|
|
||||||
|
# libosmium include dirs
|
||||||
|
'-I%s/include' % basedir,
|
||||||
|
'-I%s/test/include' % basedir,
|
||||||
|
'-I%s/test/data-test/include' % basedir,
|
||||||
|
|
||||||
|
# include third party libraries
|
||||||
|
'-I/usr/include/gdal',
|
||||||
|
]
|
||||||
|
|
||||||
|
# youcompleteme is calling this function to get flags
|
||||||
|
# You can also set database for flags. Check: JSONCompilationDatabase.html in
|
||||||
|
# clang-3.2-doc package
|
||||||
|
def FlagsForFile( filename ):
|
||||||
|
return {
|
||||||
|
'flags': flags,
|
||||||
|
'do_cache': True
|
||||||
|
}
|
36
third_party/libosmium/CHANGELOG.md
vendored
36
third_party/libosmium/CHANGELOG.md
vendored
@ -12,38 +12,6 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
## [2.20.0] - 2023-09-20
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
* Optionally allow fractional seconds in timestamps in OSM files.
|
|
||||||
* Enable `posix_fadvise` usage on FreeBSD.
|
|
||||||
* Make parsing PBFs a bit less picky.
|
|
||||||
* Various small code cleanups.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
* Don't use class template arguments on `GeometryFactory` constructor
|
|
||||||
definition.
|
|
||||||
|
|
||||||
## [2.19.0] - 2023-01-19
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
* Mark RapidJSON support as deprecated.
|
|
||||||
* Update included Catch to v2.13.10.
|
|
||||||
* Remove deprecated BoolVector class.
|
|
||||||
* Remove deprecated NWRIdSet class.
|
|
||||||
* Remove deprecated AssemblerConfig constructor.
|
|
||||||
* Print start of offending string in overlong string exception.
|
|
||||||
* Implement `set_thread_name()` on FreeBSD.
|
|
||||||
* Some small code cleanups.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
* Fix return type in `MembersDatabaseCommon::count_not_removed()`.
|
|
||||||
* Make bzip2 unit tests pass on musl-based systems.
|
|
||||||
* Fix bug in members database test case.
|
|
||||||
|
|
||||||
## [2.18.0] - 2022-02-07
|
## [2.18.0] - 2022-02-07
|
||||||
|
|
||||||
@ -1285,9 +1253,7 @@ long time. These will not be part of the next version of libosmium:
|
|||||||
Doxygen (up to version 1.8.8). This version contains a workaround to fix
|
Doxygen (up to version 1.8.8). This version contains a workaround to fix
|
||||||
this.
|
this.
|
||||||
|
|
||||||
[unreleased]: https://github.com/osmcode/libosmium/compare/v2.20.0...HEAD
|
[unreleased]: https://github.com/osmcode/libosmium/compare/v2.18.0...HEAD
|
||||||
[2.20.0]: https://github.com/osmcode/libosmium/compare/v2.19.0...v2.20.0
|
|
||||||
[2.19.0]: https://github.com/osmcode/libosmium/compare/v2.18.9...v2.19.0
|
|
||||||
[2.18.0]: https://github.com/osmcode/libosmium/compare/v2.17.3...v2.18.0
|
[2.18.0]: https://github.com/osmcode/libosmium/compare/v2.17.3...v2.18.0
|
||||||
[2.17.3]: https://github.com/osmcode/libosmium/compare/v2.17.2...v2.17.3
|
[2.17.3]: https://github.com/osmcode/libosmium/compare/v2.17.2...v2.17.3
|
||||||
[2.17.2]: https://github.com/osmcode/libosmium/compare/v2.17.1...v2.17.2
|
[2.17.2]: https://github.com/osmcode/libosmium/compare/v2.17.1...v2.17.2
|
||||||
|
4
third_party/libosmium/CMakeLists.txt
vendored
4
third_party/libosmium/CMakeLists.txt
vendored
@ -39,7 +39,7 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel;Dev;Cover
|
|||||||
project(libosmium)
|
project(libosmium)
|
||||||
|
|
||||||
set(LIBOSMIUM_VERSION_MAJOR 2)
|
set(LIBOSMIUM_VERSION_MAJOR 2)
|
||||||
set(LIBOSMIUM_VERSION_MINOR 20)
|
set(LIBOSMIUM_VERSION_MINOR 18)
|
||||||
set(LIBOSMIUM_VERSION_PATCH 0)
|
set(LIBOSMIUM_VERSION_PATCH 0)
|
||||||
|
|
||||||
set(LIBOSMIUM_VERSION
|
set(LIBOSMIUM_VERSION
|
||||||
@ -427,7 +427,7 @@ endif()
|
|||||||
#
|
#
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
message(STATUS "Looking for clang-tidy")
|
message(STATUS "Looking for clang-tidy")
|
||||||
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-16 clang-tidy-15 clang-tidy-14 clang-tidy-13 clang-tidy-12 clang-tidy-11)
|
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-14 clang-tidy-13 clang-tidy-12 clang-tidy-11)
|
||||||
|
|
||||||
if(CLANG_TIDY)
|
if(CLANG_TIDY)
|
||||||
message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
|
message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
|
||||||
|
@ -136,7 +136,8 @@ directory, some data tests in `test/osm-testdata` and tests of the examples in
|
|||||||
`test/examples`. They are built by the default cmake config. Run `ctest` to
|
`test/examples`. They are built by the default cmake config. Run `ctest` to
|
||||||
run them. We can always use more tests.
|
run them. We can always use more tests.
|
||||||
|
|
||||||
Tests are run automatically using Github Actions.
|
Tests are run automatically using Github Actions (Linux/macOS) and Appveyor
|
||||||
|
(Windows) services.
|
||||||
|
|
||||||
|
|
||||||
## Documenting the code
|
## Documenting the code
|
||||||
|
14
third_party/libosmium/README.md
vendored
14
third_party/libosmium/README.md
vendored
@ -7,6 +7,8 @@ A fast and flexible C++ library for working with OpenStreetMap data.
|
|||||||
Libosmium works on Linux, macOS and Windows.
|
Libosmium works on Linux, macOS and Windows.
|
||||||
|
|
||||||
[](https://github.com/osmcode/libosmium/actions)
|
[](https://github.com/osmcode/libosmium/actions)
|
||||||
|
[](https://ci.appveyor.com/project/lonvia/libosmium-eq41p/branch/master)
|
||||||
|
[](https://codecov.io/gh/osmcode/libosmium)
|
||||||
[](https://repology.org/metapackage/libosmium)
|
[](https://repology.org/metapackage/libosmium)
|
||||||
|
|
||||||
Please see the [Libosmium manual](https://osmcode.org/libosmium/manual.html)
|
Please see the [Libosmium manual](https://osmcode.org/libosmium/manual.html)
|
||||||
@ -15,8 +17,9 @@ for more details than this README can provide.
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
You need a C++11 compiler and standard C++ library. Osmium needs at least GCC
|
Because Libosmium uses many C++11 features you need a modern compiler and
|
||||||
4.8 or clang (LLVM) 3.4. (Some parts may work with older versions.)
|
standard C++ library. Osmium needs at least GCC 4.8 or clang (LLVM) 3.4.
|
||||||
|
(Some parts may work with older versions.)
|
||||||
|
|
||||||
Different parts of Libosmium (and the applications built on top of it) need
|
Different parts of Libosmium (and the applications built on top of it) need
|
||||||
different libraries. You DO NOT NEED to install all of them, just install those
|
different libraries. You DO NOT NEED to install all of them, just install those
|
||||||
@ -85,6 +88,13 @@ See the
|
|||||||
for instructions.
|
for instructions.
|
||||||
|
|
||||||
|
|
||||||
|
## Switching from the old Osmium
|
||||||
|
|
||||||
|
If you have been using the old version of Osmium at
|
||||||
|
https://github.com/joto/osmium you might want to read about the [changes
|
||||||
|
needed](https://osmcode.org/libosmium/manual.html#changes-from-old-versions-of-osmium).
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Libosmium is available under the Boost Software License. See LICENSE.
|
Libosmium is available under the Boost Software License. See LICENSE.
|
||||||
|
@ -47,7 +47,7 @@ int main(int argc, char* argv[]) {
|
|||||||
try {
|
try {
|
||||||
const std::string input_filename{argv[1]};
|
const std::string input_filename{argv[1]};
|
||||||
|
|
||||||
const osmium::memory::Buffer buffer{osmium::io::read_file(input_filename)};
|
osmium::memory::Buffer buffer{osmium::io::read_file(input_filename)};
|
||||||
|
|
||||||
const auto& map_factory = osmium::index::MapFactory<osmium::unsigned_object_id_type, osmium::Location>::instance();
|
const auto& map_factory = osmium::index::MapFactory<osmium::unsigned_object_id_type, osmium::Location>::instance();
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const std::string input_filename{argv[1]};
|
std::string input_filename{argv[1]};
|
||||||
const std::string output_filename{argv[2]};
|
std::string output_filename{argv[2]};
|
||||||
|
|
||||||
osmium::io::Reader reader{input_filename};
|
osmium::io::Reader reader{input_filename};
|
||||||
const osmium::io::File output_file{output_filename, "pbf"};
|
osmium::io::File output_file{output_filename, "pbf"};
|
||||||
const osmium::io::Header header;
|
osmium::io::Header header;
|
||||||
osmium::io::Writer writer{output_file, header, osmium::io::overwrite::allow};
|
osmium::io::Writer writer{output_file, header, osmium::io::overwrite::allow};
|
||||||
|
|
||||||
while (osmium::memory::Buffer buffer = reader.read()) { // NOLINT(bugprone-use-after-move) Bug in clang-tidy https://bugs.llvm.org/show_bug.cgi?id=36516
|
while (osmium::memory::Buffer buffer = reader.read()) { // NOLINT(bugprone-use-after-move) Bug in clang-tidy https://bugs.llvm.org/show_bug.cgi?id=36516
|
||||||
|
9
third_party/libosmium/build-appveyor.bat
vendored
9
third_party/libosmium/build-appveyor.bat
vendored
@ -24,11 +24,6 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|||||||
|
|
||||||
SET PATH=C:/projects/bzip2.v140.1.0.6.9/build/native/bin/x64/%config%;%PATH%
|
SET PATH=C:/projects/bzip2.v140.1.0.6.9/build/native/bin/x64/%config%;%PATH%
|
||||||
|
|
||||||
nuget install lz4 -Version 1.3.1.2
|
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|
||||||
|
|
||||||
SET PATH=C:/projects/lz4.1.3.1.2/build/native/bin/x64/%config%;%PATH%
|
|
||||||
|
|
||||||
CD libosmium
|
CD libosmium
|
||||||
|
|
||||||
ECHO config^: %config%
|
ECHO config^: %config%
|
||||||
@ -57,9 +52,7 @@ SET CMAKE_CMD=cmake .. -LA -G "Visual Studio 14 Win64" ^
|
|||||||
-DEXPAT_INCLUDE_DIR=C:/projects/expat.v140.2.2.5/build/native/include ^
|
-DEXPAT_INCLUDE_DIR=C:/projects/expat.v140.2.2.5/build/native/include ^
|
||||||
-DEXPAT_LIBRARY=C:/projects/expat.v140.2.2.5/build/native/lib/x64/%config%/libexpat%libpostfix%.lib ^
|
-DEXPAT_LIBRARY=C:/projects/expat.v140.2.2.5/build/native/lib/x64/%config%/libexpat%libpostfix%.lib ^
|
||||||
-DBZIP2_INCLUDE_DIR=C:/projects/bzip2.v140.1.0.6.9/build/native/include ^
|
-DBZIP2_INCLUDE_DIR=C:/projects/bzip2.v140.1.0.6.9/build/native/include ^
|
||||||
-DBZIP2_LIBRARIES=C:/projects/bzip2.v140.1.0.6.9/build/native/lib/x64/%config%/libbz2%libpostfix%.lib ^
|
-DBZIP2_LIBRARIES=C:/projects/bzip2.v140.1.0.6.9/build/native/lib/x64/%config%/libbz2%libpostfix%.lib
|
||||||
-DLZ4_INCLUDE_DIR=C:/projects/lz4.1.3.1.2/build/native/include ^
|
|
||||||
-DLZ4_LIBRARY=C:/projects/lz4.1.3.1.2/build/native/lib/x64/%config%/liblz4%libpostfix%.lib
|
|
||||||
|
|
||||||
ECHO calling^: %CMAKE_CMD%
|
ECHO calling^: %CMAKE_CMD%
|
||||||
%CMAKE_CMD%
|
%CMAKE_CMD%
|
||||||
|
3
third_party/libosmium/build-msys2.bat
vendored
3
third_party/libosmium/build-msys2.bat
vendored
@ -16,9 +16,8 @@ call C:\msys64\mingw64\bin\gem.cmd install json
|
|||||||
REM Workaround for problem with spatialite (see https://github.com/osmcode/libosmium/issues/262)
|
REM Workaround for problem with spatialite (see https://github.com/osmcode/libosmium/issues/262)
|
||||||
copy /y C:\msys64\mingw64\bin\libreadline8.dll C:\msys64\mingw64\bin\libreadline7.dll
|
copy /y C:\msys64\mingw64\bin\libreadline8.dll C:\msys64\mingw64\bin\libreadline7.dll
|
||||||
|
|
||||||
echo "Setting PROJ_LIB/DATA variable for correct PROJ.4 working"
|
echo "Setting PROJ_LIB variable for correct PROJ.4 working"
|
||||||
set PROJ_LIB=c:\msys64\mingw64\share\proj
|
set PROJ_LIB=c:\msys64\mingw64\share\proj
|
||||||
set PROJ_DATA=c:\msys64\mingw64\share\proj
|
|
||||||
|
|
||||||
set CXXFLAGS=-Wno-stringop-overflow
|
set CXXFLAGS=-Wno-stringop-overflow
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ class AmenityHandler : public osmium::handler::Handler {
|
|||||||
c.y += nr.lat();
|
c.y += nr.lat();
|
||||||
}
|
}
|
||||||
|
|
||||||
c.x /= static_cast<double>(nr_list.size());
|
c.x /= nr_list.size();
|
||||||
c.y /= static_cast<double>(nr_list.size());
|
c.y /= nr_list.size();
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -122,11 +122,11 @@ int main(int argc, char* argv[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const osmium::io::File input_file{argv[2]};
|
osmium::io::File input_file{argv[2]};
|
||||||
|
|
||||||
// Configuration for the multipolygon assembler. Here the default settings
|
// Configuration for the multipolygon assembler. Here the default settings
|
||||||
// are used, but you could change multiple settings.
|
// are used, but you could change multiple settings.
|
||||||
const osmium::area::Assembler::config_type assembler_config;
|
osmium::area::Assembler::config_type assembler_config;
|
||||||
|
|
||||||
// Set up a filter matching only forests. This will be used to only build
|
// Set up a filter matching only forests. This will be used to only build
|
||||||
// areas with matching tags.
|
// areas with matching tags.
|
||||||
|
@ -153,8 +153,8 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get input and output file names from command line.
|
// Get input and output file names from command line.
|
||||||
const std::string input_file_name{argv[1]};
|
std::string input_file_name{argv[1]};
|
||||||
const std::string output_file_name{argv[2]};
|
std::string output_file_name{argv[2]};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Initialize Reader
|
// Initialize Reader
|
||||||
|
@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {
|
|||||||
try {
|
try {
|
||||||
// The Reader is initialized here with an osmium::io::File, but could
|
// The Reader is initialized here with an osmium::io::File, but could
|
||||||
// also be directly initialized with a file name.
|
// also be directly initialized with a file name.
|
||||||
const osmium::io::File input_file{argv[1]};
|
osmium::io::File input_file{argv[1]};
|
||||||
osmium::io::Reader reader{input_file};
|
osmium::io::Reader reader{input_file};
|
||||||
|
|
||||||
// Create an instance of our own CountHandler and push the data from the
|
// Create an instance of our own CountHandler and push the data from the
|
||||||
@ -88,7 +88,7 @@ int main(int argc, char* argv[]) {
|
|||||||
// (though not this one) can use huge amounts of data. So checking actual
|
// (though not this one) can use huge amounts of data. So checking actual
|
||||||
// memore usage is often useful and can be done easily with this class.
|
// memore usage is often useful and can be done easily with this class.
|
||||||
// (Currently only works on Linux, not macOS and Windows.)
|
// (Currently only works on Linux, not macOS and Windows.)
|
||||||
const osmium::MemoryUsage memory;
|
osmium::MemoryUsage memory;
|
||||||
|
|
||||||
std::cout << "\nMemory used: " << memory.peak() << " MBytes\n";
|
std::cout << "\nMemory used: " << memory.peak() << " MBytes\n";
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
|
@ -40,11 +40,11 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get output file name from command line.
|
// Get output file name from command line.
|
||||||
const std::string output_file_name{argv[1]};
|
std::string output_file_name{argv[1]};
|
||||||
|
|
||||||
// If output file name is "-", this means STDOUT. Set the OPL file type
|
// If output file name is "-", this means STDOUT. Set the OPL file type
|
||||||
// in this case. Otherwise take the file type from the file name suffix.
|
// in this case. Otherwise take the file type from the file name suffix.
|
||||||
const osmium::io::File output_file{output_file_name, output_file_name == "-" ? ".opl" : ""};
|
osmium::io::File output_file{output_file_name, output_file_name == "-" ? ".opl" : ""};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Create a buffer where all objects will live. Use a sensible initial
|
// Create a buffer where all objects will live. Use a sensible initial
|
||||||
|
@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
|
|||||||
// Get entity types from command line if there is a 2nd argument.
|
// Get entity types from command line if there is a 2nd argument.
|
||||||
if (argc == 3) {
|
if (argc == 3) {
|
||||||
read_types = osmium::osm_entity_bits::nothing;
|
read_types = osmium::osm_entity_bits::nothing;
|
||||||
const std::string types = argv[2];
|
std::string types = argv[2];
|
||||||
if (types.find('n') != std::string::npos) {
|
if (types.find('n') != std::string::npos) {
|
||||||
read_types |= osmium::osm_entity_bits::node;
|
read_types |= osmium::osm_entity_bits::node;
|
||||||
}
|
}
|
||||||
|
@ -165,31 +165,31 @@ int main(int argc, char* argv[]) {
|
|||||||
reader.close();
|
reader.close();
|
||||||
|
|
||||||
// Write out node, way, and relation offset indexes to disk.
|
// Write out node, way, and relation offset indexes to disk.
|
||||||
const IndexFile nodes_idx{output_dir + "/nodes.idx"};
|
IndexFile nodes_idx{output_dir + "/nodes.idx"};
|
||||||
node_index.dump_as_list(nodes_idx.fd());
|
node_index.dump_as_list(nodes_idx.fd());
|
||||||
|
|
||||||
const IndexFile ways_idx{output_dir + "/ways.idx"};
|
IndexFile ways_idx{output_dir + "/ways.idx"};
|
||||||
way_index.dump_as_list(ways_idx.fd());
|
way_index.dump_as_list(ways_idx.fd());
|
||||||
|
|
||||||
const IndexFile relations_idx{output_dir + "/relations.idx"};
|
IndexFile relations_idx{output_dir + "/relations.idx"};
|
||||||
relation_index.dump_as_list(relations_idx.fd());
|
relation_index.dump_as_list(relations_idx.fd());
|
||||||
|
|
||||||
// Sort the maps (so later binary search will work on them) and write
|
// Sort the maps (so later binary search will work on them) and write
|
||||||
// them to disk.
|
// them to disk.
|
||||||
map_node2way.sort();
|
map_node2way.sort();
|
||||||
const IndexFile node2way_idx{output_dir + "/node2way.map"};
|
IndexFile node2way_idx{output_dir + "/node2way.map"};
|
||||||
map_node2way.dump_as_list(node2way_idx.fd());
|
map_node2way.dump_as_list(node2way_idx.fd());
|
||||||
|
|
||||||
map_node2relation.sort();
|
map_node2relation.sort();
|
||||||
const IndexFile node2relation_idx{output_dir + "/node2rel.map"};
|
IndexFile node2relation_idx{output_dir + "/node2rel.map"};
|
||||||
map_node2relation.dump_as_list(node2relation_idx.fd());
|
map_node2relation.dump_as_list(node2relation_idx.fd());
|
||||||
|
|
||||||
map_way2relation.sort();
|
map_way2relation.sort();
|
||||||
const IndexFile way2relation_idx{output_dir + "/way2rel.map"};
|
IndexFile way2relation_idx{output_dir + "/way2rel.map"};
|
||||||
map_way2relation.dump_as_list(way2relation_idx.fd());
|
map_way2relation.dump_as_list(way2relation_idx.fd());
|
||||||
|
|
||||||
map_relation2relation.sort();
|
map_relation2relation.sort();
|
||||||
const IndexFile relation2relation_idx{output_dir + "/rel2rel.map"};
|
IndexFile relation2relation_idx{output_dir + "/rel2rel.map"};
|
||||||
map_relation2relation.dump_as_list(relation2relation_idx.fd());
|
map_relation2relation.dump_as_list(relation2relation_idx.fd());
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
// All exceptions used by the Osmium library derive from std::exception.
|
// All exceptions used by the Osmium library derive from std::exception.
|
||||||
|
@ -47,10 +47,10 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// The input file, deduce file format from file suffix.
|
// The input file, deduce file format from file suffix.
|
||||||
const osmium::io::File input_file{argv[1]};
|
osmium::io::File input_file{argv[1]};
|
||||||
|
|
||||||
// The output file, force XML OSM file format.
|
// The output file, force XML OSM file format.
|
||||||
const osmium::io::File output_file{argv[2], "osm"};
|
osmium::io::File output_file{argv[2], "osm"};
|
||||||
|
|
||||||
// Initialize Reader for the input file.
|
// Initialize Reader for the input file.
|
||||||
// Read only changesets (will ignore nodes, ways, and
|
// Read only changesets (will ignore nodes, ways, and
|
||||||
|
@ -67,8 +67,8 @@ public:
|
|||||||
IndexAccess(const IndexAccess&) = delete;
|
IndexAccess(const IndexAccess&) = delete;
|
||||||
IndexAccess& operator=(const IndexAccess&) = delete;
|
IndexAccess& operator=(const IndexAccess&) = delete;
|
||||||
|
|
||||||
IndexAccess(IndexAccess&&) noexcept = delete;
|
IndexAccess(IndexAccess&&) = delete;
|
||||||
IndexAccess& operator=(IndexAccess&&) noexcept = delete;
|
IndexAccess& operator=(IndexAccess&&) = delete;
|
||||||
|
|
||||||
virtual ~IndexAccess() noexcept = default;
|
virtual ~IndexAccess() noexcept = default;
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public:
|
|||||||
~IndexAccessDense() noexcept override = default;
|
~IndexAccessDense() noexcept override = default;
|
||||||
|
|
||||||
void dump() const override {
|
void dump() const override {
|
||||||
const index_type index{this->fd()};
|
index_type index{this->fd()};
|
||||||
|
|
||||||
for (std::size_t i = 0; i < index.size(); ++i) {
|
for (std::size_t i = 0; i < index.size(); ++i) {
|
||||||
if (index.get(i) != TValue{}) {
|
if (index.get(i) != TValue{}) {
|
||||||
@ -116,7 +116,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool search(const osmium::unsigned_object_id_type& key) const override {
|
bool search(const osmium::unsigned_object_id_type& key) const override {
|
||||||
const index_type index{this->fd()};
|
index_type index{this->fd()};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TValue value = index.get(key);
|
TValue value = index.get(key);
|
||||||
@ -153,7 +153,7 @@ public:
|
|||||||
~IndexAccessSparse() noexcept override = default;
|
~IndexAccessSparse() noexcept override = default;
|
||||||
|
|
||||||
void dump() const override {
|
void dump() const override {
|
||||||
const index_type index{this->fd()};
|
index_type index{this->fd()};
|
||||||
|
|
||||||
for (const auto& element : index) {
|
for (const auto& element : index) {
|
||||||
std::cout << element.first << " " << element.second << "\n";
|
std::cout << element.first << " " << element.second << "\n";
|
||||||
@ -164,7 +164,7 @@ public:
|
|||||||
using element_type = typename index_type::element_type;
|
using element_type = typename index_type::element_type;
|
||||||
index_type index{this->fd()};
|
index_type index{this->fd()};
|
||||||
|
|
||||||
const element_type elem{key, TValue{}};
|
element_type elem{key, TValue{}};
|
||||||
const auto positions = std::equal_range(index.begin(),
|
const auto positions = std::equal_range(index.begin(),
|
||||||
index.end(),
|
index.end(),
|
||||||
elem,
|
elem,
|
||||||
@ -347,7 +347,7 @@ int run(const IndexAccess<TValue>& index, const Options& options) {
|
|||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
// Parse command line options.
|
// Parse command line options.
|
||||||
const Options options{argc, argv};
|
Options options{argc, argv};
|
||||||
|
|
||||||
// Open the index file.
|
// Open the index file.
|
||||||
const int fd = ::open(options.filename(), O_RDWR);
|
const int fd = ::open(options.filename(), O_RDWR);
|
||||||
|
@ -27,11 +27,11 @@ int main(int argc, char* argv[]) {
|
|||||||
try {
|
try {
|
||||||
// The Reader is initialized here with an osmium::io::File, but could
|
// The Reader is initialized here with an osmium::io::File, but could
|
||||||
// also be directly initialized with a file name.
|
// also be directly initialized with a file name.
|
||||||
const osmium::io::File input_file{argv[1]};
|
osmium::io::File input_file{argv[1]};
|
||||||
osmium::io::Reader reader{input_file};
|
osmium::io::Reader reader{input_file};
|
||||||
|
|
||||||
// OSM data comes in buffers, read until there are no more.
|
// OSM data comes in buffers, read until there are no more.
|
||||||
while (const osmium::memory::Buffer buffer = reader.read()) {
|
while (osmium::memory::Buffer buffer = reader.read()) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,14 +34,14 @@ int main(int argc, char* argv[]) {
|
|||||||
try {
|
try {
|
||||||
// The Reader is initialized here with an osmium::io::File, but could
|
// The Reader is initialized here with an osmium::io::File, but could
|
||||||
// also be directly initialized with a file name.
|
// also be directly initialized with a file name.
|
||||||
const osmium::io::File input_file{argv[1]};
|
osmium::io::File input_file{argv[1]};
|
||||||
osmium::io::Reader reader{input_file};
|
osmium::io::Reader reader{input_file};
|
||||||
|
|
||||||
// Initialize progress bar, enable it only if STDERR is a TTY.
|
// Initialize progress bar, enable it only if STDERR is a TTY.
|
||||||
osmium::ProgressBar progress{reader.file_size(), osmium::isatty(2)};
|
osmium::ProgressBar progress{reader.file_size(), osmium::isatty(2)};
|
||||||
|
|
||||||
// OSM data comes in buffers, read until there are no more.
|
// OSM data comes in buffers, read until there are no more.
|
||||||
while (const osmium::memory::Buffer buffer = reader.read()) {
|
while (osmium::memory::Buffer buffer = reader.read()) {
|
||||||
// Update progress bar for each buffer.
|
// Update progress bar for each buffer.
|
||||||
progress.update(reader.offset());
|
progress.update(reader.offset());
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
// Create a tile at this location. This will also internally use the
|
// Create a tile at this location. This will also internally use the
|
||||||
// Mercator projection and then calculate the tile coordinates.
|
// Mercator projection and then calculate the tile coordinates.
|
||||||
const osmium::geom::Tile tile{static_cast<uint32_t>(zoom), location};
|
const osmium::geom::Tile tile{uint32_t(zoom), location};
|
||||||
std::cout << "Tile: zoom=" << tile.z << " x=" << tile.x << " y=" << tile.y << "\n";
|
std::cout << "Tile: zoom=" << tile.z << " x=" << tile.x << " y=" << tile.y << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ namespace osmium {
|
|||||||
|
|
||||||
// Now create the Area object and add the attributes and tags
|
// Now create the Area object and add the attributes and tags
|
||||||
// from the relation.
|
// from the relation.
|
||||||
const bool okay = create_area(out_buffer, relation, members);
|
bool okay = create_area(out_buffer, relation, members);
|
||||||
if (okay) {
|
if (okay) {
|
||||||
out_buffer.commit();
|
out_buffer.commit();
|
||||||
} else {
|
} else {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -124,6 +124,15 @@ namespace osmium {
|
|||||||
|
|
||||||
AssemblerConfig() noexcept = default;
|
AssemblerConfig() noexcept = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @deprecated Use default constructor and set values afterwards.
|
||||||
|
*/
|
||||||
|
explicit AssemblerConfig(ProblemReporter* pr, bool d = false) :
|
||||||
|
problem_reporter(pr),
|
||||||
|
debug_level(d) {
|
||||||
|
}
|
||||||
|
|
||||||
}; // struct AssemblerConfig
|
}; // struct AssemblerConfig
|
||||||
|
|
||||||
} // namespace area
|
} // namespace area
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -332,10 +332,10 @@ namespace osmium {
|
|||||||
if (!way.nodes().empty() && way.is_closed() && !way.tags().empty()) {
|
if (!way.nodes().empty() && way.is_closed() && !way.tags().empty()) {
|
||||||
const auto d = std::count_if(way.tags().cbegin(), way.tags().cend(), std::cref(filter()));
|
const auto d = std::count_if(way.tags().cbegin(), way.tags().cend(), std::cref(filter()));
|
||||||
if (d > 0) {
|
if (d > 0) {
|
||||||
const osmium::tags::KeyFilter::iterator way_fi_begin(std::cref(filter()), way.tags().cbegin(), way.tags().cend());
|
osmium::tags::KeyFilter::iterator way_fi_begin(std::cref(filter()), way.tags().cbegin(), way.tags().cend());
|
||||||
const osmium::tags::KeyFilter::iterator way_fi_end(std::cref(filter()), way.tags().cend(), way.tags().cend());
|
osmium::tags::KeyFilter::iterator way_fi_end(std::cref(filter()), way.tags().cend(), way.tags().cend());
|
||||||
const osmium::tags::KeyFilter::iterator area_fi_begin(std::cref(filter()), area_tags.cbegin(), area_tags.cend());
|
osmium::tags::KeyFilter::iterator area_fi_begin(std::cref(filter()), area_tags.cbegin(), area_tags.cend());
|
||||||
const osmium::tags::KeyFilter::iterator area_fi_end(std::cref(filter()), area_tags.cend(), area_tags.cend());
|
osmium::tags::KeyFilter::iterator area_fi_end(std::cref(filter()), area_tags.cend(), area_tags.cend());
|
||||||
#ifdef __cpp_lib_robust_nonmodifying_seq_ops
|
#ifdef __cpp_lib_robust_nonmodifying_seq_ops
|
||||||
if (!std::equal(way_fi_begin, way_fi_end, area_fi_begin, area_fi_end)) {
|
if (!std::equal(way_fi_begin, way_fi_end, area_fi_begin, area_fi_end)) {
|
||||||
#else
|
#else
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -608,7 +608,7 @@ namespace osmium {
|
|||||||
|
|
||||||
void create_rings_simple_case() {
|
void create_rings_simple_case() {
|
||||||
auto count_remaining = m_segment_list.size();
|
auto count_remaining = m_segment_list.size();
|
||||||
for (const slocation& sl : m_locations) {
|
for (slocation& sl : m_locations) {
|
||||||
const NodeRefSegment& segment = m_segment_list[sl.item];
|
const NodeRefSegment& segment = m_segment_list[sl.item];
|
||||||
if (!segment.is_done()) {
|
if (!segment.is_done()) {
|
||||||
count_remaining -= add_new_ring(sl);
|
count_remaining -= add_new_ring(sl);
|
||||||
@ -671,7 +671,7 @@ namespace osmium {
|
|||||||
std::cerr << " Trying to merge " << open_ring_its.size() << " open rings (try_to_merge)\n";
|
std::cerr << " Trying to merge " << open_ring_its.size() << " open rings (try_to_merge)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto xrings = create_location_to_ring_map(open_ring_its);
|
std::vector<location_to_ring_map> xrings = create_location_to_ring_map(open_ring_its);
|
||||||
|
|
||||||
auto it = xrings.cbegin();
|
auto it = xrings.cbegin();
|
||||||
while (it != xrings.cend()) {
|
while (it != xrings.cend()) {
|
||||||
@ -825,7 +825,7 @@ namespace osmium {
|
|||||||
|
|
||||||
find_inner_outer_complex();
|
find_inner_outer_complex();
|
||||||
ProtoRing* outer_ring = find_enclosing_ring(ring_min->ring().min_segment());
|
ProtoRing* outer_ring = find_enclosing_ring(ring_min->ring().min_segment());
|
||||||
const bool ring_min_is_outer = !outer_ring;
|
bool ring_min_is_outer = !outer_ring;
|
||||||
if (debug()) {
|
if (debug()) {
|
||||||
std::cerr << " Open ring is " << (ring_min_is_outer ? "outer" : "inner") << " ring\n";
|
std::cerr << " Open ring is " << (ring_min_is_outer ? "outer" : "inner") << " ring\n";
|
||||||
}
|
}
|
||||||
@ -924,7 +924,7 @@ namespace osmium {
|
|||||||
|
|
||||||
// Now find all the rest of the rings (ie not starting at split locations)
|
// Now find all the rest of the rings (ie not starting at split locations)
|
||||||
if (count_remaining > 0) {
|
if (count_remaining > 0) {
|
||||||
for (const slocation& sl : m_locations) {
|
for (slocation& sl : m_locations) {
|
||||||
const NodeRefSegment& segment = m_segment_list[sl.item];
|
const NodeRefSegment& segment = m_segment_list[sl.item];
|
||||||
if (!segment.is_done()) {
|
if (!segment.is_done()) {
|
||||||
count_remaining -= add_new_ring_complex(sl);
|
count_remaining -= add_new_ring_complex(sl);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ namespace osmium {
|
|||||||
|
|
||||||
const char* role_name() const noexcept {
|
const char* role_name() const noexcept {
|
||||||
static const std::array<const char*, 4> names = {{"unknown", "outer", "inner", "empty"}};
|
static const std::array<const char*, 4> names = {{"unknown", "outer", "inner", "empty"}};
|
||||||
return names[static_cast<int>(m_role)];
|
return names[int(m_role)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const osmium::Way* way() const noexcept {
|
const osmium::Way* way() const noexcept {
|
||||||
@ -327,9 +327,9 @@ namespace osmium {
|
|||||||
|
|
||||||
if ((d > 0 && na >= 0 && na <= d && nb >= 0 && nb <= d) ||
|
if ((d > 0 && na >= 0 && na <= d && nb >= 0 && nb <= d) ||
|
||||||
(d < 0 && na <= 0 && na >= d && nb <= 0 && nb >= d)) {
|
(d < 0 && na <= 0 && na >= d && nb <= 0 && nb >= d)) {
|
||||||
const double ua = static_cast<double>(na) / static_cast<double>(d);
|
const double ua = double(na) / d;
|
||||||
const vec i = p0 + ua * (p1 - p0);
|
const vec i = p0 + ua * (p1 - p0);
|
||||||
return osmium::Location{static_cast<int32_t>(i.x), static_cast<int32_t>(i.y)};
|
return osmium::Location{int32_t(i.x), int32_t(i.y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
return osmium::Location{};
|
return osmium::Location{};
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -86,16 +86,16 @@ namespace osmium {
|
|||||||
int64_t m_num;
|
int64_t m_num;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int64_t m_sum = 0;
|
int64_t m_sum;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit ProtoRing(NodeRefSegment* segment) noexcept :
|
explicit ProtoRing(NodeRefSegment* segment) noexcept :
|
||||||
m_min_segment(segment)
|
m_min_segment(segment),
|
||||||
#ifdef OSMIUM_DEBUG_RING_NO
|
#ifdef OSMIUM_DEBUG_RING_NO
|
||||||
, m_num(next_num())
|
m_num(next_num()),
|
||||||
#endif
|
#endif
|
||||||
{
|
m_sum(0) {
|
||||||
add_segment_back(segment);
|
add_segment_back(segment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ namespace osmium {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (y_range_overlap(s1, s2)) {
|
if (y_range_overlap(s1, s2)) {
|
||||||
const osmium::Location intersection{calculate_intersection(s1, s2)};
|
osmium::Location intersection{calculate_intersection(s1, s2)};
|
||||||
if (intersection) {
|
if (intersection) {
|
||||||
++found_intersections;
|
++found_intersections;
|
||||||
if (m_debug) {
|
if (m_debug) {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -89,12 +89,12 @@ namespace osmium {
|
|||||||
|
|
||||||
// scale vector
|
// scale vector
|
||||||
constexpr inline vec operator*(double s, const vec& v) noexcept {
|
constexpr inline vec operator*(double s, const vec& v) noexcept {
|
||||||
return vec{static_cast<int64_t>(s * static_cast<double>(v.x)), static_cast<int64_t>(s * static_cast<double>(v.y))};
|
return vec{int64_t(s * v.x), int64_t(s * v.y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// scale vector
|
// scale vector
|
||||||
constexpr inline vec operator*(const vec& v, double s) noexcept {
|
constexpr inline vec operator*(const vec& v, double s) noexcept {
|
||||||
return vec{static_cast<int64_t>(s * static_cast<double>(v.x)), static_cast<int64_t>(s * static_cast<double>(v.y))};
|
return vec{int64_t(s * v.x), int64_t(s * v.y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// equality
|
// equality
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -75,15 +75,15 @@ namespace osmium {
|
|||||||
void set_object(gdalcpp::Feature& feature) {
|
void set_object(gdalcpp::Feature& feature) {
|
||||||
const char t[2] = {osmium::item_type_to_char(m_object_type), '\0'};
|
const char t[2] = {osmium::item_type_to_char(m_object_type), '\0'};
|
||||||
feature.set_field("obj_type", t);
|
feature.set_field("obj_type", t);
|
||||||
feature.set_field("obj_id", static_cast<int32_t>(m_object_id));
|
feature.set_field("obj_id", int32_t(m_object_id));
|
||||||
feature.set_field("nodes", static_cast<int32_t>(m_nodes));
|
feature.set_field("nodes", int32_t(m_nodes));
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_point(const char* problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location location) {
|
void write_point(const char* problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location location) {
|
||||||
gdalcpp::Feature feature{m_layer_perror, m_ogr_factory.create_point(location)};
|
gdalcpp::Feature feature{m_layer_perror, m_ogr_factory.create_point(location)};
|
||||||
set_object(feature);
|
set_object(feature);
|
||||||
feature.set_field("id1", static_cast<double>(id1));
|
feature.set_field("id1", double(id1));
|
||||||
feature.set_field("id2", static_cast<double>(id2));
|
feature.set_field("id2", double(id2));
|
||||||
feature.set_field("problem", problem_type);
|
feature.set_field("problem", problem_type);
|
||||||
feature.add_to_layer();
|
feature.add_to_layer();
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ namespace osmium {
|
|||||||
try {
|
try {
|
||||||
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
||||||
set_object(feature);
|
set_object(feature);
|
||||||
feature.set_field("id1", static_cast<int32_t>(way.id()));
|
feature.set_field("id1", int32_t(way.id()));
|
||||||
feature.set_field("id2", 0);
|
feature.set_field("id2", 0);
|
||||||
feature.set_field("problem", "way_in_multiple_rings");
|
feature.set_field("problem", "way_in_multiple_rings");
|
||||||
feature.add_to_layer();
|
feature.add_to_layer();
|
||||||
@ -192,7 +192,7 @@ namespace osmium {
|
|||||||
try {
|
try {
|
||||||
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
||||||
set_object(feature);
|
set_object(feature);
|
||||||
feature.set_field("id1", static_cast<int32_t>(way.id()));
|
feature.set_field("id1", int32_t(way.id()));
|
||||||
feature.set_field("id2", 0);
|
feature.set_field("id2", 0);
|
||||||
feature.set_field("problem", "inner_with_same_tags");
|
feature.set_field("problem", "inner_with_same_tags");
|
||||||
feature.add_to_layer();
|
feature.add_to_layer();
|
||||||
@ -208,7 +208,7 @@ namespace osmium {
|
|||||||
try {
|
try {
|
||||||
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
||||||
set_object(feature);
|
set_object(feature);
|
||||||
feature.set_field("id1", static_cast<int32_t>(way.id()));
|
feature.set_field("id1", int32_t(way.id()));
|
||||||
feature.set_field("id2", 0);
|
feature.set_field("id2", 0);
|
||||||
feature.set_field("problem", "duplicate_way");
|
feature.set_field("problem", "duplicate_way");
|
||||||
feature.add_to_layer();
|
feature.add_to_layer();
|
||||||
@ -229,7 +229,7 @@ namespace osmium {
|
|||||||
try {
|
try {
|
||||||
gdalcpp::Feature feature{m_layer_ways, m_ogr_factory.create_linestring(way)};
|
gdalcpp::Feature feature{m_layer_ways, m_ogr_factory.create_linestring(way)};
|
||||||
set_object(feature);
|
set_object(feature);
|
||||||
feature.set_field("way_id", static_cast<int32_t>(way.id()));
|
feature.set_field("way_id", int32_t(way.id()));
|
||||||
feature.add_to_layer();
|
feature.add_to_layer();
|
||||||
} catch (const osmium::geometry_error&) {
|
} catch (const osmium::geometry_error&) {
|
||||||
// XXX
|
// XXX
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -125,8 +125,8 @@ namespace osmium {
|
|||||||
if (value_length > osmium::max_osm_string_length) {
|
if (value_length > osmium::max_osm_string_length) {
|
||||||
throw std::length_error{"OSM tag value is too long"};
|
throw std::length_error{"OSM tag value is too long"};
|
||||||
}
|
}
|
||||||
add_size(append_with_zero(key, static_cast<osmium::memory::item_size_type>(key_length)));
|
add_size(append_with_zero(key, osmium::memory::item_size_type(key_length)));
|
||||||
add_size(append_with_zero(value, static_cast<osmium::memory::item_size_type>(value_length)));
|
add_size(append_with_zero(value, osmium::memory::item_size_type(value_length)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -142,8 +142,8 @@ namespace osmium {
|
|||||||
if (value.size() > osmium::max_osm_string_length) {
|
if (value.size() > osmium::max_osm_string_length) {
|
||||||
throw std::length_error{"OSM tag value is too long"};
|
throw std::length_error{"OSM tag value is too long"};
|
||||||
}
|
}
|
||||||
add_size(append(key.data(), static_cast<osmium::memory::item_size_type>(key.size()) + 1));
|
add_size(append(key.data(), osmium::memory::item_size_type(key.size()) + 1));
|
||||||
add_size(append(value.data(), static_cast<osmium::memory::item_size_type>(value.size()) + 1));
|
add_size(append(value.data(), osmium::memory::item_size_type(value.size()) + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -240,8 +240,8 @@ namespace osmium {
|
|||||||
if (length > osmium::max_osm_string_length) {
|
if (length > osmium::max_osm_string_length) {
|
||||||
throw std::length_error{"OSM relation member role is too long"};
|
throw std::length_error{"OSM relation member role is too long"};
|
||||||
}
|
}
|
||||||
member.set_role_size(static_cast<osmium::string_size_type>(length) + 1);
|
member.set_role_size(osmium::string_size_type(length) + 1);
|
||||||
add_size(append_with_zero(role, static_cast<osmium::memory::item_size_type>(length)));
|
add_size(append_with_zero(role, osmium::memory::item_size_type(length)));
|
||||||
add_padding(true);
|
add_padding(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,16 +330,16 @@ namespace osmium {
|
|||||||
if (length > osmium::max_osm_string_length) {
|
if (length > osmium::max_osm_string_length) {
|
||||||
throw std::length_error{"OSM user name is too long"};
|
throw std::length_error{"OSM user name is too long"};
|
||||||
}
|
}
|
||||||
comment.set_user_size(static_cast<osmium::string_size_type>(length) + 1);
|
comment.set_user_size(osmium::string_size_type(length) + 1);
|
||||||
add_size(append_with_zero(user, static_cast<osmium::memory::item_size_type>(length)));
|
add_size(append_with_zero(user, osmium::memory::item_size_type(length)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_text(osmium::ChangesetComment& comment, const char* text, const std::size_t length) {
|
void add_text(osmium::ChangesetComment& comment, const char* text, const std::size_t length) {
|
||||||
if (length > std::numeric_limits<osmium::changeset_comment_size_type>::max() - 1) {
|
if (length > std::numeric_limits<osmium::changeset_comment_size_type>::max() - 1) {
|
||||||
throw std::length_error{"OSM changeset comment is too long"};
|
throw std::length_error{"OSM changeset comment is too long"};
|
||||||
}
|
}
|
||||||
comment.set_text_size(static_cast<osmium::changeset_comment_size_type>(length) + 1);
|
comment.set_text_size(osmium::changeset_comment_size_type(length) + 1);
|
||||||
add_size(append_with_zero(text, static_cast<osmium::memory::item_size_type>(length)));
|
add_size(append_with_zero(text, osmium::memory::item_size_type(length)));
|
||||||
add_padding(true);
|
add_padding(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
2
third_party/libosmium/include/osmium/fwd.hpp
vendored
2
third_party/libosmium/include/osmium/fwd.hpp
vendored
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ namespace osmium {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
GeometryFactory() :
|
GeometryFactory<TGeomImpl, TProjection>() :
|
||||||
m_projection(),
|
m_projection(),
|
||||||
m_impl(m_projection.epsg()) {
|
m_impl(m_projection.epsg()) {
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ namespace osmium {
|
|||||||
* Constructor for default initialized projection.
|
* Constructor for default initialized projection.
|
||||||
*/
|
*/
|
||||||
template <typename... TArgs>
|
template <typename... TArgs>
|
||||||
explicit GeometryFactory(TArgs&&... args) :
|
explicit GeometryFactory<TGeomImpl, TProjection>(TArgs&&... args) :
|
||||||
m_projection(),
|
m_projection(),
|
||||||
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
|
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ namespace osmium {
|
|||||||
* projection is moved into the GeometryFactory.
|
* projection is moved into the GeometryFactory.
|
||||||
*/
|
*/
|
||||||
template <typename... TArgs>
|
template <typename... TArgs>
|
||||||
explicit GeometryFactory(TProjection&& projection, TArgs&&... args) :
|
explicit GeometryFactory<TGeomImpl, TProjection>(TProjection&& projection, TArgs&&... args) :
|
||||||
m_projection(std::move(projection)),
|
m_projection(std::move(projection)),
|
||||||
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
|
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -47,9 +47,6 @@ namespace osmium {
|
|||||||
/**
|
/**
|
||||||
* A geometry factory implementation that can be used with the
|
* A geometry factory implementation that can be used with the
|
||||||
* RapidJSON (https://github.com/miloyip/rapidjson) JSON writer.
|
* RapidJSON (https://github.com/miloyip/rapidjson) JSON writer.
|
||||||
*
|
|
||||||
* @deprecated The RapidJSON support will be removed in a future
|
|
||||||
* version of libosmium.
|
|
||||||
*/
|
*/
|
||||||
template <typename TWriter>
|
template <typename TWriter>
|
||||||
class RapidGeoJSONFactoryImpl {
|
class RapidGeoJSONFactoryImpl {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ namespace osmium {
|
|||||||
std::string out;
|
std::string out;
|
||||||
out.reserve(str.size() * 2);
|
out.reserve(str.size() * 2);
|
||||||
|
|
||||||
for (const char c : str) {
|
for (char c : str) {
|
||||||
out += lookup_hex[(static_cast<unsigned int>(c) >> 4U) & 0xfU];
|
out += lookup_hex[(static_cast<unsigned int>(c) >> 4U) & 0xfU];
|
||||||
out += lookup_hex[ static_cast<unsigned int>(c) & 0xfU];
|
out += lookup_hex[ static_cast<unsigned int>(c) & 0xfU];
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
50
third_party/libosmium/include/osmium/index/bool_vector.hpp
vendored
Normal file
50
third_party/libosmium/include/osmium/index/bool_vector.hpp
vendored
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#ifndef OSMIUM_INDEX_BOOL_VECTOR_HPP
|
||||||
|
#define OSMIUM_INDEX_BOOL_VECTOR_HPP
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
do so, all subject to the following:
|
||||||
|
|
||||||
|
The copyright notices in the Software and this entire statement, including
|
||||||
|
the above license grant, this restriction and the following disclaimer,
|
||||||
|
must be included in all copies of the Software, in whole or in part, and
|
||||||
|
all derivative works of the Software, unless such copies or derivative
|
||||||
|
works are solely in the form of machine-executable object code generated by
|
||||||
|
a source language processor.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <osmium/index/id_set.hpp>
|
||||||
|
|
||||||
|
namespace osmium {
|
||||||
|
|
||||||
|
namespace index {
|
||||||
|
|
||||||
|
/// @deprecated Use osmium::index::IdSet instead.
|
||||||
|
template <typename T>
|
||||||
|
using BoolVector = IdSet<T>;
|
||||||
|
|
||||||
|
} // namespace index
|
||||||
|
|
||||||
|
} // namespace osmium
|
||||||
|
|
||||||
|
#endif // OSMIUM_INDEX_BOOL_VECTOR_HPP
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||||
|
|
||||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
Boost Software License - Version 1.0 - August 17th, 2003
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user