Skip to content

Instantly share code, notes, and snippets.

@hugoledoux
Last active October 5, 2017 14:29
Show Gist options
  • Save hugoledoux/c8668e137438a993fb39978a413b0160 to your computer and use it in GitHub Desktop.
Save hugoledoux/c8668e137438a993fb39978a413b0160 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fstream>
#include "json.hpp"
using json = nlohmann::json;
int main(int argc, const char * argv[]) {
std::ifstream input("/Users/hugo/projects/cityjson/example-datasets/dummy-values/example.json");
json j;
input >> j;
//-- CityJSON version
std::cout << "CityJSON version: " << j["metadata"]["crs"]["epsg"] << std::endl;
//-- access with JSON pointers
std::cout << "CityJSON version: " << j["/metadata/crs/epsg"_json_pointer] << std::endl;
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment