[OSM-dev] Limitation on downloading ways via /map API Call

SteveC steve at asklater.com
Sun Jul 9 16:46:48 BST 2006


* @ 09/07/06 04:20:33 PM crschmidt at crschmidt.net wrote:
> Steve just closed http://trac.openstreetmap.org/ticket/214 by changing a
> MySQL variable, but there is still a (currently undocumented) limitation

It was the new code that did it, but then the runlength bug was
encountered.

> to very-long ways. group_concat can only be a maximum, by defualt, of
> 1000 characters: 
> 
>       ress = call_sql { "select
> d.id,d.segs,d.tags,current_ways.timestamp,current_ways.visible from
> (select c.id, segs, group_concat(k , concat('===', v) SEPARATOR '|||')
> as tags from (select id, group_concat(segment_id order by sequence_id)
> as segs from (select a.id, segment_id, sequence_id from (select id from
> current_way_segments where segment_id in (#{id_list}) group by id) as a,
> current_way_segments where a.id = current_way_segments.id) as b group by
> id) as c, current_way_tags where c.id = current_way_tags.id group by id)
> as d, current_ways where current_ways.id = d.id;" }
> 
> Steve has raised this default to 4000 characters:

1024, 4096 :)

> 
> 11:03:47 < SteveCCCCCCC> crschmidt, the number of digits plus two chars
> per seg id cannot exceed 4k bytes. Mysql default was 1k.
> 11:06:37 < Etienne> So thats about 450 segments at the moment.  400 when
> the segment ID goes over 9,999,999.
> 
> However:
> 11:14:07 < SteveCCCCCCC> oh dear
> 11:14:16 < SteveCCCCCCC> there are ways with 3,500 segments
> 
> In the meantime, all developers should be aware that downloading data
> via the /map API call will only show a maximum of about 450 segments. If
> a way has this many segments, it may be beneficial to your users to
> either mark it as 'incomplete' in your local dataset (so you don't
> upload the bad data back to OSM) or fetch the complete way using the
> /way API call, which doesn't have the same limitation.
> 
> This is the reason for the issues that pere reported here: 
> http://lists.openstreetmap.org/pipermail/talk/2006-July/005089.html --
> Presumably, someone downloaded the data in JOSM, which helpfully
> uploaded the data it got from the API, replacing the existing way with
> the new one downloaded from the API (or something like that).
> 
> -- 
> Christopher Schmidt
> Web Developer
> 
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

have fun,

SteveC steve at asklater.com http://www.asklater.com/steve/




More information about the dev mailing list