[OSM-talk] [Talk-ca] Northern lights

D Tucny d at tucny.com
Wed Dec 31 07:07:55 GMT 2008


2008/12/31 <michcasa at gmail.com>

> On Dec 29, 2008 10:41am, Jochen Topf <jochen at remote.org> wrote:
> > On Mon, Dec 29, 2008 at 03:08:36PM +0000, michcasa at gmail.com 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20081231/cd968126/attachment.html>


More information about the talk mailing list