2008/12/31  <span dir="ltr"><<a href="mailto:michcasa@gmail.com">michcasa@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Dec 29, 2008 10:41am, Jochen Topf <<a href="mailto:jochen@remote.org" target="_blank">jochen@remote.org</a>> wrote:<br>> On Mon, Dec 29, 2008 at 03:08:36PM +0000, <a href="mailto:michcasa@gmail.com" target="_blank">michcasa@gmail.com</a> wrote:<br>
> <br>> >> There just was a discussion on dev about a single way with 40.000 nodes.<br>> <br>> >><br>> <br>> >> That is far too long to be able to handle it with current software and<br>
> <br>> >><br>> <br>> >> makes lots of problems. Are you maybe referring to that? Ways should not<br>> <br>> >><br>> <br>> >> have more than 1000 nodes or so.<br>> <br>> >><br>
> <br>> ><br>> <br>> > Yes we are. The current ways we are talking about may have more than 40<br>> <br>> > 000 nodes. I would like to delete them and replace them by chopping the<br>> <br>> > ways.<br>
> <br>> ><br>> <br>> > Do you known how I could delete the current ones at once. I thought about<br>> <br>> > something like: SELECT boundary FROM ways WHERE<br>> <br>> > (boundary='administrative' AND admin_level=4 AND source='geobase'). The<br>
> <br>> > number we should get is 503 ways.<br>> <br>> <br>> <br>> When you uploaded those ways you should have gotten the new way_id. If<br>> <br>> you didn't record this but remember on which day you did the upload you<br>
> <br>> can download the right daily or hourly diff (from<br>> <br>> <a href="http://planet.openstreetmap.org/" target="_blank">http://planet.openstreetmap.org/</a>) and find the IDs in there. (And record<br>> <br>
> the IDs the next time you do a bulk upload for cases like this.)<br>> <br>> <br><br></div>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.<br><br>
Michel<div><div></div><div class="Wj3C7c"><br></div></div></blockquote><div><br>One way to do it would be to script a request to <a href="http://api.openstreetmap.org/api/0.5/way/">http://api.openstreetmap.org/api/0.5/way/</a><wayid> for each wayid, stripping the <?xml?>, <osm> and </osm> tags out and concatenating into a single file... <br>
<br>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...<br><br>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...<br>
<br>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...<br>
<br>I hope that helps... It's quite easily scriptable, though perhaps someone has a premade bulk-delete script already...<br><br>d<br> <br></div></div><br>