2008/12/31 <[email protected]> > On Dec 29, 2008 10:41am, Jochen Topf <[email protected]> wrote: > > On Mon, Dec 29, 2008 at 03:08:36PM +0000, [email protected] wrote: > > > > >> There just was a discussion on dev about a single way with 40.000 > nodes. > > > > >> > > > > >> That is far too long to be able to handle it with current software and > > > > >> > > > > >> makes lots of problems. Are you maybe referring to that? Ways should > not > > > > >> > > > > >> have more than 1000 nodes or so. > > > > >> > > > > > > > > > > Yes we are. The current ways we are talking about may have more than 40 > > > > > 000 nodes. I would like to delete them and replace them by chopping the > > > > > ways. > > > > > > > > > > Do you known how I could delete the current ones at once. I thought > about > > > > > something like: SELECT boundary FROM ways WHERE > > > > > (boundary='administrative' AND admin_level=4 AND source='geobase'). The > > > > > number we should get is 503 ways. > > > > > > > > When you uploaded those ways you should have gotten the new way_id. If > > > > you didn't record this but remember on which day you did the upload you > > > > can download the right daily or hourly diff (from > > > > http://planet.openstreetmap.org/) and find the IDs in there. (And record > > > > the IDs the next time you do a bulk upload for cases like this.) > > > > > > Ok. I found the IDs of the ways I would like to delete. What do I do next > to retrieve them and remove them. Thanks. > > Michel > > One way to do it would be to script a request to http://api.openstreetmap.org/api/0.5/way/<wayid> for each wayid, stripping the <?xml?>, <osm> and </osm> tags out and concatenating into a single file...
Parse the resulting file extracting node IDs, and add lines similar to "<node id=<nodeid> lat='0' lon='0' visible='false' />" to the beginning of the file... If you want to/can use JOSM to remove them, when complete, add back the <?xml and <osm> tag at the top, the </osm> tag at the bottom and replace all instances of visible='true' with visible='false', load into JOSM and hit upload... Otherwise, you'll probably need to use the bulk import script, for this, you'd add <?xml, <osmChange and <delete tags at the top and </delete> and </osmChange> at the bottom, then feed it through the bulk import script... I hope that helps... It's quite easily scriptable, though perhaps someone has a premade bulk-delete script already... d
_______________________________________________ Talk-ca mailing list [email protected] http://lists.openstreetmap.org/listinfo/talk-ca

