[OSM-dev] [OSM-talk] Bounding box
richard at systemeD.net
Mon Feb 5 17:46:10 GMT 2007
Robert Hart wrote:
> How difficult would it be to make the API return only complete ways? I
> assume that would require multiple DB queries
SELECT n1.latitude AS lat1,n1.longitude AS long1,n1.id AS id1,n1.tags
n2.latitude AS lat2,n2.longitude AS long2,n2.id AS id2,n2.tags
current_nodes AS n1,current_nodes AS n2
AND n1.id=node_a and n2.id=node_b
ORDER BY sequence_id
is how Potlatch does it. I'm no SQL guru; no doubt it could be
optimised further .
Note that this doesn't get segment or way tags; Potlatch uses a second
query to get way tags.
 If anyone wants to download the Potlatch source (see wiki) and
sanity-check/optimise the various bits of SQL in rubyamf.cgi, that
would be extremely helpful!
More information about the dev