connect geojson library
diff --git a/.gitignore b/.gitignore index b3db4cf..758bbfa 100644 --- a/.gitignore +++ b/.gitignore
@@ -8,4 +8,6 @@ compile_commands.json CTestTestfile.cmake .vscode -build \ No newline at end of file +build +includes +.DS_Store \ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt index 211604c..c06e271 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -1,9 +1,14 @@ cmake_minimum_required(VERSION 3.0.0) project(delaunator VERSION 0.1.0) -# include(CTest) -# enable_testing() +if (NOT EXISTS "${PROJECT_SOURCE_DIR}/includes") + execute_process(COMMAND bash "-c" "(cd ${PROJECT_SOURCE_DIR} && ./fetch-includes.sh)") +endif() + include_directories ("${PROJECT_SOURCE_DIR}/src") +include_directories ("${PROJECT_SOURCE_DIR}/includes/rapidjson/include") +# add_subdirectory("includes/rapidjson") + add_executable(delaunator src/main.cpp) set(CPACK_PROJECT_NAME ${PROJECT_NAME})
diff --git a/fetch-includes.sh b/fetch-includes.sh new file mode 100755 index 0000000..9039cab --- /dev/null +++ b/fetch-includes.sh
@@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +mkdir -p ./includes +rm -rf ./includes/* + +git clone --branch v1.1.0 --depth=1 git@github.com:Tencent/rapidjson.git ./includes/rapidjson
diff --git a/src/main.cpp b/src/main.cpp index c4a394d..87f8949 100644 --- a/src/main.cpp +++ b/src/main.cpp
@@ -1,5 +1,10 @@ -#include <iostream> +// #include <iostream> +#include "rapidjson/document.h" +#include <cstdio> -int main(int, char**) { - std::cout << "Hello, world!\n"; +int main(int, char* argv[]) { + const char* filename = argv[1]; + // std::cout << filename << std::cou; + // std::printf("Hello, world!\n"); + std::printf("%s", filename); }
diff --git a/test-files/map-mercator.geojson b/test-files/map-mercator.geojson new file mode 100644 index 0000000..ea1544e --- /dev/null +++ b/test-files/map-mercator.geojson
@@ -0,0 +1,11 @@ +{ +"type": "FeatureCollection", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::900913" } }, +"features": [ +{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 1469272.557697656564415, 6881014.160288135521114 ] } }, +{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 1474776.023734191432595, 6912659.089998200535774 ] } }, +{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 1501376.109577432041988, 6908531.490470800548792 ] } }, +{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 1502293.35391685529612, 6879485.419722434133291 ] } }, +{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 1489299.059108373941854, 6894314.203209755942225 ] } } +] +}
diff --git a/test-files/map.geojson b/test-files/map.geojson new file mode 100644 index 0000000..5e7b93a --- /dev/null +++ b/test-files/map.geojson
@@ -0,0 +1 @@ +{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[13.198699951171873,52.445129091618824]}},{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[13.248138427734375,52.61805778461654]}},{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[13.487091064453123,52.59554047871389]}},{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[13.495330810546875,52.43675780021384]}},{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[13.37860107421875,52.517892228382834]}}]} \ No newline at end of file