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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .conan/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test_package/build/
6 changes: 6 additions & 0 deletions .conan/basic-setup.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if( EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake )
include( ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake )
conan_basic_setup( TARGETS )
else()
message( WARNING "The file conanbuildinfo.cmake doesn't exist, you have to run conan install first" )
endif()
15 changes: 15 additions & 0 deletions .conan/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.15)
project(PackageTest CXX)

include( ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake )
conan_basic_setup( TARGETS )

set( CMAKE_CXX_STANDARD 17 )
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})

find_package(os-matcher 0.1 REQUIRED)

add_executable(example src/example.cpp)
target_link_libraries(example
PUBLIC CONAN_PKG::os-matcher
)
27 changes: 27 additions & 0 deletions .conan/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os

from conans import ConanFile, CMake, tools

class OsMatcherTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
exports_sources = "CMakeLists.txt", "src/*"
generators = "cmake_find_package", "cmake"
requires = [("os-matcher/0.1@amb/stable"), ("amb-log/0.5.0@amb/stable"), ("cli-app/0.4.0@amb/stable")]

def validate(self):
tools.check_min_cppstd(self, "17")

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def imports(self):
self.copy(pattern="*.dll", src="bin", dst="bin")
self.copy(pattern="*.dylib*", src="lib", dst="bin")
self.copy(pattern='*.so*', src='lib', dst='bin')

def test(self):
if not tools.cross_building(self):
os.chdir("bin")
self.run(".%sexample" % os.sep)
73 changes: 73 additions & 0 deletions .conan/test_package/src/example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

#include <OsMatcher.h>
#include <fstream>
#include <iostream>

namespace {

using namespace osmatcher;


struct TestStruct {

bool testFunction(
AppComponents::Common::Reader::CsvTrackReader &&,
osmatcher::Reader::GeoJsonMapReader &&,
osmatcher::Reader::JsonTrackReader &&,
//osmatcher::Reader::OsmMapReader &&,

osmatcher::Matcher::GraphBuilder &&,
//osmatcher::Matcher::Router &&,
osmatcher::Matcher::SamplingPointFinder &&,

osmatcher::Writer::CsvRouteWriter &&,
osmatcher::Writer::CsvSubRouteWriter &&,
osmatcher::Writer::GeoJsonMapWriter &&,
osmatcher::Writer::GeoJsonRouteWriter &&,
osmatcher::Writer::GeoJsonTrackWriter &&,
osmatcher::Writer::JsonRouteStatisticWriter &&
) {
return true;
};
};
}

int main() {

auto testStruct = TestStruct();

std::basic_string<char> tmpname = strdup("/tmp/tmpfileXXXXXX");
mkstemp(reinterpret_cast<char *>(&tmpname));
auto input = std::ifstream{tmpname};
auto output = std::ofstream{tmpname};

auto reader = osmatcher::Reader::CsvTrackReader{input};
testStruct.testFunction(
osmatcher::Reader::CsvTrackReader{input},
osmatcher::Reader::GeoJsonMapReader{input},
osmatcher::Reader::JsonTrackReader{input},
// TODO
//osmatcher::Reader::OsmMapReader{putput},

osmatcher::Matcher::GraphBuilder{},
// TODO
/*osmatcher::Matcher::Router{
0.0, true, 0.0, 0.0,
osmatcher::Matcher::Routing::SamplingPointSkipStrategy::includeEdgeCosts,
0.0, 0.0,
osmatcher::Matcher::Routing::RouteClusterPreference::cheapest
},*/
osmatcher::Matcher::SamplingPointFinder{
osmatcher::Matcher::SamplingPointFinder::SelectionStrategy::all, 0.0, 0.0
},

osmatcher::Writer::CsvRouteWriter{output},
osmatcher::Writer::CsvSubRouteWriter{output},
osmatcher::Writer::GeoJsonMapWriter{output},
osmatcher::Writer::GeoJsonRouteWriter{output},
osmatcher::Writer::GeoJsonTrackWriter{output},
osmatcher::Writer::JsonRouteStatisticWriter{output}
);

std::cout << "Reader/Matcher/Writer instantiated." << std::endl;
}
9 changes: 9 additions & 0 deletions .data/in/map.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "FeatureCollection",
"name": "map",
"features": [
{ "type": "Feature", "properties": { "Highway": "MotorwayLink", "Id": 255533610, "Offset": 0, "SourceNode": 33, "TargetNode": 81, "TravelDirection": "Forwards" }, "geometry": { "type": "LineString", "coordinates": [ [ 12.2573818, 52.2478026 ], [ 12.2576088, 52.2478396 ], [ 12.2578341, 52.2479096 ], [ 12.2580391, 52.248037 ], [ 12.258206, 52.2481594 ], [ 12.2584714, 52.2483771 ], [ 12.2586422, 52.2484897 ], [ 12.258878, 52.2485831 ], [ 12.2590848, 52.2486466 ], [ 12.2593417, 52.2486957 ], [ 12.2596512, 52.248717 ], [ 12.2600123, 52.248705 ], [ 12.2606444, 52.2486477 ], [ 12.2609493, 52.2486817 ] ] } },
{ "type": "Feature", "properties": { "Highway": "Motorway", "Id": 184173406, "Offset": 0, "SourceNode": 47, "TargetNode": 81, "TravelDirection": "Forwards" }, "geometry": { "type": "LineString", "coordinates": [ [ 12.2568627, 52.2490353 ], [ 12.2609493, 52.2486817 ] ] } },
{ "type": "Feature", "properties": { "Highway": "Motorway", "Id": 67407742, "Offset": 0, "SourceNode": 81, "TargetNode": 85, "TravelDirection": "Forwards" }, "geometry": { "type": "LineString", "coordinates": [ [ 12.2609493, 52.2486817 ], [ 12.2630089, 52.2484984 ] ] } }
]
}
Loading