[Openstreetmap] XMLRPC interface question
Ben Gimpert
ben at somethingmodern.com
Sat Sep 3 08:26:00 BST 2005
Hi Frank,
I'm not sure how much help I'll be, since this SQL is getting phased and
and I haven't looked at it in a while. (We should probably move to the
dev mailman too, methinks?) Nonetheless, here goes:
On Sat, Sep 03, 2005 at 11:31:08AM +0200, Frank Mohr wrote:
> Ben Gimpert wrote:
> > Frank,
> >
> > Yeah that's probably most recently my mess. ;) What specific method(s)
> > are returning the mysterious 4th integer -- I'll look into it.
> >
> > Ben
> >
>
> my perl script looks like this:
>
> @list = $osm->getNodes($maxlat,$minlon,$minlat,$maxlon);
>
> foreach my $node (@list)
> {
> $node->print();
> my @list1 = $osm->getLines(($node->{"nodeid"}));
> foreach my $line (@list1)
> {
> $line->print();
> }
> }
>
> (i know .. i shold send a list of nodeids to getLines ..
> but this is for a limited test area)
Hey, it's your call -- but the underlying "IN (123, 234, 345)" clause in
the SQL is much faster.
> some values i get :
>
> # looks like expected:
>
> Line:
> lineid = "113697"
> point1 = "155124"
> point2 = "155125"
>
>
> # here i assumed it's the streetid,
> # but i always get a 14
> Line:
> lineid = "148349"
> point1 = "191970"
> point2 = "191971"
> streetid = "14"
Is there any chance this mysterious "14" might actually -- and thus
incorrectly -- in the data *as* the street's name?
> the getLines method calls the XMLRPC Method
> public java.util.Vector getLines(java.lang.String sToken,
> java.util.Vector vNodes)
>
>
> this is handled by getLines() in osmServerHandler.java
> which just returns getLines() from osmServerSQLHandler.java
>
> this first gets the segment.uid, segment.node_a, segment.node_b as
> expected from the database
> then there is this second sql block that should add the street name
The second SQL block is structured similarly to the first -- including
another "IN (123, 234, 345)" clause -- but pulls the key "name" out of
the osmKeys table for each segment.
> when i just had a look at this code, i noticed some problems there
> (SVN Revision: 544)
> - the name string is allways added, even if it's empty
Feature or bug?! You decide.
> - what happens if a segment belongs to more than one street
> (there is no problem to create that with
> newStreet()/addSegmentToStreet() and i also think we need that
The getLines() will probably return the most recent belonged-to
street, since we've got an "ORDER BY timestamp DESC" on damn near
everything.
> ->
> http://www.openstreetmap.org/wiki/index.php/Thoughts_about_Data_Structures)
>
> frank
>
>
>
>
>
>
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
More information about the talk
mailing list