[Tilesathome] ROMA problems with relations

Florian Lohoff flo at rfc822.org
Wed Sep 3 12:16:30 BST 2008


On Wed, Sep 03, 2008 at 01:03:42PM +0200, Florian Lohoff wrote:
> > I'm not sure how the ROMA handles relations. It's not trivial because 
> > they usually are 2 levels of indirection away from nodes (which you get 
> > from bbox), and some even more.
> 
> Okay - i look for relations by nodes and ways found in the bbox - all
> relations where those are members should be returned. Additionally i
> look for relations where the former relations participate as a member.
> That should be the rails port behaviour. It might be that it has bugs
> though.
> 
> Okay - had a look - ROMA bug ... I check the code - the mirror database
> has the relation and the members.

Found it - Would check for relations if there was only 1 way or 1 node.
One day i'll beat Larry Wall for making the number of elements in an
array be 0 if there is actually 1.

Offending code:

        my @nodeids=keys %{$nodeidhash};
        if ($#nodeids > 0) { 
                my $nrelids=get_relationid_by_member($dbh, "node", @nodeids);
                push @relids, @{$nrelids};
        }

        my @wayids=keys %{$wayidhash};
        if ($#wayids > 0) {
                my $wrelids=get_relationid_by_member($dbh, "way", @wayids);
                push @relids, @{$wrelids};
        }       

Should both be >= 0 - fix is active ...

Flo
-- 
Florian Lohoff                  flo at rfc822.org             +49-171-2280134
	Those who would give up a little freedom to get a little 
          security shall soon have neither - Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20080903/6497781b/attachment.pgp>


More information about the Tilesathome mailing list