Example #1
0
static void DumpWay(const osmscout::TypeConfig* typeConfig,
                    const osmscout::WayRef way,
                    osmscout::Id id)
{
  std::cout << "Way {" << std::endl;

  std::cout << "  id: " << id << std::endl;
  std::cout << "  fileOffset: " << way->GetFileOffset() << std::endl;

  DumpWayAttributes(way->GetAttributes(),
                    typeConfig,
                    2);

  if (!way->nodes.empty()) {
    std::cout << std::endl;

    for (size_t n=0; n<way->nodes.size(); n++) {
      std::cout << "  node[" << n << "] {";

      if (way->ids[n]!=0) {
        std::cout << " id: " << way->ids[n];
      }

      std::cout << " lat: " << way->nodes[n].GetLat() << " lon: "<< way->nodes[n].GetLon() << " }" << std::endl;
    }
  }

  std::cout << "}" << std::endl;
}
Example #2
0
static void DumpWay(const osmscout::TypeConfigRef& typeConfig,
                    const osmscout::WayRef way,
                    osmscout::Id id)
{
  osmscout::GeoBox   boundingBox;
  osmscout::GeoCoord center;

  way->GetBoundingBox(boundingBox);

  std::cout << "Way {" << std::endl;

  std::cout << "  id: " << id << std::endl;
  std::cout << "  fileOffset: " << way->GetFileOffset() << std::endl;
  std::cout << "  type: " << way->GetType()->GetName() << std::endl;
  std::cout << "  boundingBox: " << boundingBox.GetDisplayText() << std::endl;
  std::cout << "  center: " << boundingBox.GetCenter().GetDisplayText() << std::endl;
  std::cout << "  cell level: " << CalculateCellLevel(boundingBox) << std::endl;

  std::cout << std::endl;

  DumpFeatureValueBuffer(way->GetFeatureValueBuffer(),
                         IDENT);

  if (!way->nodes.empty()) {
    std::cout << std::endl;

    for (size_t n=0; n<way->nodes.size(); n++) {
      std::cout << "  node[" << n << "] {";

      if (n<way->ids.size() &&
          way->ids[n]!=0) {
        std::cout << " id: " << way->ids[n];
      }

      std::cout << " lat: " << way->nodes[n].GetLat() << " lon: "<< way->nodes[n].GetLon() << " }" << std::endl;
    }
  }

  std::cout << "}" << std::endl;
}