Esempio n. 1
0
int output_pgsql_t::pending_relation(osmid_t id, int exists) {
    taglist_t tags_int;
    memberlist_t members_int;
    int ret = 0;

    // Try to fetch the relation from the DB
    if (m_mid->relations_get(id, members_int, tags_int)) {
        ret = pgsql_process_relation(id, members_int, tags_int, exists, true);
    }

    return ret;
}
Esempio n. 2
0
int output_pgsql_t::relation_add(osmid_t id, const memberlist_t &members, const taglist_t &tags)
{
    const std::string *type = tags.get("type");

    /* Must have a type field or we ignore it */
    if (!type)
        return 0;

    /* Only a limited subset of type= is supported, ignore other */
    if ( (*type != "route") && (*type != "multipolygon") && (*type != "boundary"))
        return 0;


    return pgsql_process_relation(id, members, tags, 0);
}
Esempio n. 3
0
int output_pgsql_t::relation_add(osmid_t id, struct member *members, int member_count, struct keyval *tags)
{
  const std::string *type = tags->getItem("type");

  /* Must have a type field or we ignore it */
  if (!type)
      return 0;

  /* Only a limited subset of type= is supported, ignore other */
  if ( (*type != "route") && (*type != "multipolygon") && (*type != "boundary"))
    return 0;


  return pgsql_process_relation(id, members, member_count, tags, 0);
}
Esempio n. 4
0
int output_pgsql_t::pending_relation(osmid_t id, int exists) {
    keyval tags_int;
    member *members_int;
    int count_int;
    int ret = 0;

    // Try to fetch the relation from the DB
    if (!m_mid->relations_get(id, &members_int, &count_int, &tags_int)) {
        ret = pgsql_process_relation(id, members_int, count_int, &tags_int, exists, true);
        free(members_int);
    }
    tags_int.resetList();

    return ret;
}
Esempio n. 5
0
int output_pgsql_t::relation_add(osmium::Relation const &rel)
{
    char const *type = rel.tags()["type"];

    /* Must have a type field or we ignore it */
    if (!type)
        return 0;

    /* Only a limited subset of type= is supported, ignore other */
    if (strcmp(type, "route") != 0 && strcmp(type, "multipolygon") != 0
        && strcmp(type, "boundary") != 0) {
        return 0;
    }

    return pgsql_process_relation(rel);
}
Esempio n. 6
0
int output_pgsql_t::pending_relation(osmid_t id, int exists) {
    // Try to fetch the relation from the DB
    // Note that we cannot use the global buffer here because
    // we cannot keep a reference to the relation and an autogrow buffer
    // might be relocated when more data is added.
    rels_buffer.clear();
    if (m_mid->relations_get(id, rels_buffer)) {
        // If the flag says this object may exist already, delete it first.
        if (exists) {
            pgsql_delete_relation_from_output(id);
        }

        auto const &rel = rels_buffer.get<osmium::Relation>(0);
        return pgsql_process_relation(rel);
    }

    return 0;
}