splitter: small patch and wishlist

Hello list, A small wish list for splitter: - honour "action='deleted'" in the input file. Rather trivial to write, but I don't send a patch because you would be horrified by my code. - make it possible to use hex data in areas.list (trivial patch, see below). Best regards, Valentijn

Hi Valentijn, I've only just seen your hex patch sorry, it looks good and I've just checked it in. Can you please give me an example of the action='deleted' tag you're talking about? Do you mean the action='delete' attribute specified in the JSOM file format? (http://wiki.openstreetmap.org/wiki/JOSM_file_format). I assume you'd like the splitter to completely ignore any nodes/ways/relations with that setting? Chris
Hello list,
A small wish list for splitter:
- honour "action='deleted'" in the input file. Rather trivial to write, but I don't send a patch because you would be horrified by my code. - make it possible to use hex data in areas.list (trivial patch, see below). Best regards,
Valentijn

Chris Miller schreef:
I've only just seen your hex patch sorry, it looks good and I've just checked it in.
Thank you :)
Can you please give me an example of the action='deleted' tag you're talking about? Do you mean the action='delete' attribute specified in the JSOM file format? (http://wiki.openstreetmap.org/wiki/JOSM_file_format). I assume you'd like the splitter to completely ignore any nodes/ways/relations with that setting?
Yes. This is useful, if you want to make hand-made changes to the map before compiling. JOSM doesn't delete things, it marks them action='delete'. I found no other (easy) way to ignore these, than to patch splitter for it. My own code has a private boolean deleted that is added to SplitParser, and in endElement() it says "if (!deleted) {writeNode(currentNode);}", while in startElement I check for attributes.getValue("action") in case of "way" and "node" (didn't bother to check "relation" but I think I should have). But as I said before, my code is too horrible to share. And maybe the places where I check and do things are wrong, too. V. -- Durgerdamstraat 29, 1507 JL Zaandam; telefoon 075-7074579

Hi Valentijn, VS> My own code has a private boolean deleted that is added to VS> SplitParser, and in endElement() it says "if (!deleted) VS> {writeNode(currentNode);}", while in startElement I check for VS> attributes.getValue("action") in case of "way" and "node" (didn't VS> bother to check "relation" but I think I should have). VS> VS> But as I said before, my code is too horrible to share. And maybe VS> the places where I check and do things are wrong, too. That's not too horrible, I've seen a lot worse from people who are supposed to be doing this sort of thing for a living! I've committed a fix for this. Note that a check in just startElement() is enough because if the appropriate mode hasn't been set there then endElement() won't do anything anyway. I've also added the same test to DivisionParser so deleted nodes don't affect the area subdivision. Chris

Chris, Chris Miller schreef:
VS> My own code has a private boolean deleted that is added to VS> SplitParser, and in endElement() it says "if (!deleted) [...] That's not too horrible,
The idea might not be, trust me: the code was :) In fact, when I woke up this morning, I realised that probably the state machine in startElement could just be bypassed - and that's what you did already(*).
I've committed a fix for this.
Thanks. V. (*) I hope Rupert Sheldrake doesn't find out
participants (2)
-
Chris Miller
-
Valentijn Sessink