Ticket #1703: osm2pgsql-route_name.diff

File osm2pgsql-route_name.diff, 1.2 KB (added by ldp, 10 years ago)

Don't set 'name' if 'route_name' is already being set

  • output-pgsql.c

     
    673673    initList(&tags);
    674674    initList(&poly_tags);
    675675
    676     /* Clone tags from relation, dropping 'type' */
     676    /* Clone tags from relation, dropping 'type' and defering 'name' for later */
    677677    p = rel_tags->next;
    678678    while (p != rel_tags) {
    679         if (strcmp(p->key, "type"))
     679        if (strcmp(p->key, "type") && strcmp(p->key, "name"))
    680680            addItem(&tags, p->key, p->value, 1);
    681681        p = p->next;
    682682    }
     
    787787    else if( strcmp( type, "multipolygon" ) == 0 )
    788788    {
    789789        make_polygon = 1;
     790        if (getItem(rel_tags, "name") != NULL) {
     791           addItem(&tags, "name", getItem(rel_tags, "name"), 1);
     792       }
    790793
    791794        /* Copy the tags from the outer way(s) if the relation is untagged */
    792795        if (!listHasData(&tags)) {
     
    816819    else if( strcmp( type, "boundary" ) == 0 )
    817820    {
    818821        make_polygon = 0;
     822        if (getItem(rel_tags, "name") != NULL) {
     823           addItem(&tags, "name", getItem(rel_tags, "name"), 1);
     824       }
    819825    }
    820826    else
    821827    {