GeoGraphJsonOutput.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2016, University of Freiburg,
  2. // Chair of Algorithms and Data Structures.
  3. // Authors: Patrick Brosi <brosi@informatik.uni-freiburg.de>
  4. #ifndef UTIL_GEO_OUTPUT_GEOGRAPHJSONOUTPUT_H_
  5. #define UTIL_GEO_OUTPUT_GEOGRAPHJSONOUTPUT_H_
  6. #include <ostream>
  7. #include <string>
  8. #include "util/String.h"
  9. #include "util/geo/output/GeoJsonOutput.h"
  10. #include "util/graph/Graph.h"
  11. namespace util {
  12. namespace geo {
  13. namespace output {
  14. class GeoGraphJsonOutput {
  15. public:
  16. inline GeoGraphJsonOutput(){};
  17. // print a graph to the provided path
  18. template <typename N, typename E>
  19. void print(const util::graph::Graph<N, E>& outG, std::ostream& str);
  20. // print a graph to the provided path, but treat coordinates as Web Mercator coordinates and reproject to WGS84
  21. template <typename N, typename E>
  22. void printLatLng(const util::graph::Graph<N, E>& outG, std::ostream& str);
  23. private:
  24. template <typename T>
  25. Line<T> createLine(const util::geo::Point<T>& a,
  26. const util::geo::Point<T>& b);
  27. // print a graph to the provided path
  28. template <typename N, typename E>
  29. void printImpl(const util::graph::Graph<N, E>& outG, std::ostream& str, bool proj);
  30. };
  31. #include "util/geo/output/GeoGraphJsonOutput.tpp"
  32. }
  33. }
  34. }
  35. #endif // UTIL_GEO_OUTPUT_GEOGRAPHJSONOUTPUT_H_