relation_responder::relation_responder(mime::type mt, osm_id_t id_, data_selection &w_)
  : osm_responder(mt, w_), id(id_) {
  list<osm_id_t> ids;
  ids.push_back(id);

  if (sel.select_relations(ids) == 0) {
    throw http::not_found("");
  }
  else {
    check_visibility();
  }
}
relation_responder::relation_responder(mime::type mt, osm_id_t id_,
                                       factory_ptr &w_)
    : osm_current_responder(mt, w_), id(id_) {
  vector<osm_id_t> ids;
  ids.push_back(id);

  if (sel->select_relations(ids) == 0) {
    throw http::not_found("");
  } else {
    check_visibility();
  }
}
Exemple #3
0
way_responder::way_responder(mime::type mt, osm_nwr_id_t id_, data_selection_ptr &w_)
    : osm_current_responder(mt, w_), id(id_) {
  vector<osm_nwr_id_t> ids;
  ids.push_back(id);

  if (sel->select_ways(ids) == 0) {
    std::ostringstream error;
    error << "Way " << id << " was not found.";
    throw http::not_found(error.str());
  } else {
    check_visibility();
  }
}
way_full_responder::way_full_responder(mime::type mt_, osm_id_t id_, data_selection &w_) 
  : osm_responder(mt_, w_), id(id_) {
  list<osm_id_t> ids;
  ids.push_back(id);

  if (sel.select_ways(ids) == 0) {
    throw http::not_found("");
  } else {
    check_visibility();
  }

  sel.select_nodes_from_way_nodes();
}
relation_full_responder::relation_full_responder(mime::type mt_, osm_id_t id_,
                                                 factory_ptr &w_)
    : osm_current_responder(mt_, w_), id(id_) {
  vector<osm_id_t> ids;
  ids.push_back(id);

  if (sel->select_relations(ids) == 0) {
    throw http::not_found("");
  } else {
    check_visibility();
  }

  sel->select_nodes_from_relations();
  sel->select_ways_from_relations();
  sel->select_nodes_from_way_nodes();
  sel->select_relations_members_of_relations();
}