While editing some cities I see a lot of unneeded/excessive nodes. For example, here: See that the street is straight and the left middle node is unneeded. I found question 8348 but I just can't select everything and simplify (it can remove valid nodes or just can't remove the node (caused by too high or too low max-error value)) nor I can select everything and straight them too. While looking at the data with a lower zoom level it's also difficult to spot this small square in JOSM. Another example: And the nodes that probably aren't needed: So my problem is: is it possible to highlight these kind of nodes in JOSM, please? (nodes that are part of a way, have no tags nor are connected to anything else (another ways, for example)). Something to display them with a big icon and/or color, like this: There is no problem that it's an ugly view but I need a quick way to view these possible spurious nodes (so I can then review them manually and remove if needed). asked 13 May '13, 15:29 naoliv
showing 5 of 7
show 2 more comments
|
Answering my own question, I did create a MapCSS style:
The first block will highlight with a blue square every node that is part of a way tagged with highway=* (even nodes that are tagged or connected to other ways, but they are handled after). Second block will make nodes that are connected to other ways (node:connection) or nodes that have any tags (node:tagged) have a gray color and a smaller size (to stay less noticeable in JOSM). This: Is now seen as this with the style: Like aseerel4c26 suggested, missing features are:
It is perfectly fitting my needs but any kind of suggestion/improvements are welcome. answered 22 May '13, 21:12 naoliv aseerel4c26 ♦ 1
Thanks for sharing! And for those wondering what to do with the junk above... Use a text editor, paste the code, and save it as foo.css (or similar) anywhere. Then add the file path to JOSM in Edit/Preferences/Map Settings/Map Paint Styles. I've used JOSM for years, but apparently there are still many things to find out. :)
(22 May '13, 21:39)
gnurk
Very good, naoliv! For other who don't understand the CSS syntax that good, could you mention (please add it with the "edit" function) what the rule does? It is not as restrictive in highlighting as my suggested conditions (yes, those are not useful as they are, practically) are, right?
(22 May '13, 23:21)
aseerel4c26 ♦
1
aseerel4c26, I did edit it like you suggested. And as you said, it doesn't implement all the rules from your other comment (but as it is now, it's perfectly fitting my needs). Thanks!
(24 May '13, 20:30)
naoliv
|
In your private data version you can remove (or do whatever you want with) these "unneeded" points. But, please, be careful doing similar changes to the OSM source data. There may be some, to us unknown, reasons for uploading these "unneeded"/redundant points by local editors. Besides, the cases you refer to are just a little fraction of the redundant node cases. The node redundancy comes from point replications, colinear (and almost colinear) neighbouring vector/line-segments, cases like ...A,B,C,B,C...C,D..., overlapping (or almost overlapping) ways/polylines in the same or different object classes and so on. The number of "unneeded" nodes in a Planet dump may easily exceed 10**8 (hundred million). So, my suggestion is, do not worry about these "unneeded" points in the OSM source data. In raster mapping (rendered/pre-rasterized map images on servers) you will never see them. In vector mapping (rendering/rasterization on the clients, parametric data transmission) mappers will remove this redundancy anyway especially in mobile mapping (simply, it is too expensive to transmit them in cellular networks). answered 18 May '13, 08:09 sanser 2
Sorry if I look rude here (it's really not the intention) but I know what I am doing. In no way I am going to destroy data (and exactly because of this I don't want to use any kind of automated process to remove the nodes). Like I said before, I just need help in highlighting these nodes. The majority of the cases that I see in my area are nodes created by new users. If I am doing some QA work or updating an area, I see no problem in also removing spurious nodes.
(18 May '13, 14:25)
naoliv
|
Not every untagged node which is not connected to more than one road is unneeded. In fact, except for the Tiger import and some bad GPX-trace-to-OSM-way conversions most of these nodes are really useful. Besides there is no way to automagically decide whether such a node is unneeded or not.
I know. This is exactly why I need only to highlight the nodes and not an automated process to remove them. By highlight the nodes I can review them manually.
Although JOSM's search function is very powerful it doesn't seem to support all of your constraints.
Can some kind of custom map style/MapCSS be created for this?
I'm not familiar with MapCSS but I guess it is possible given the already different style of single and multiple connected nodes. Still I wouldn't worry too much about them. Removing them is probably not worth the effort. But if you create such a style then publishing it doesn't harm, too :).
OK, edited the initial question to give a better explanation. I don't need an automated tool to simplify nor nothing. I just want to have the middle nodes somehow highlighted.
I think this condition is needed: highlight NodeA if it
$threshold may be 0 or 0.001 or something (depends on personal taste).