I understood, and it was not meant to be orthogonalized. Just playing and testing.
The message (for now): Why not change the negative into positive : "Please add another corner to orthogonalize this shape / polygon" Some suggestions: Create the same function for 30, 45, 60, 120, 150, 210, 240, 270 degrees AND 90 degrees mixed in one shape. (gets tricky I think) May be that could work on my star building. Would be nice however if those corners that ARE within for example 85 and 95 degrees were orthogonalized. As well as corners close to +/- 5 degrees could be straightened. Even better if the remaining angles could be symmetrized. I am not sure however, if that works on all shapes ..... A further improvement could be to accept all shapes that are -selected- instead of just single closed ways. many many roads are essentially build rectangular, and in the maps only close approximations. I imagine 4 roads selected . As your calculation happens only on the nodes (isn't it?) it must be possible. Thanks for the great work. This literally improved my building mapping with a factor 2 at least, at the same time creating much better results. Gert Gremmen ----------------------------------------------------- Openstreetmap.nl (alias: cetest) -----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Hermann Schwaerzler Verzonden: Friday, November 21, 2008 11:02 AM Aan: [EMAIL PROTECTED] Onderwerp: Re: [josm-dev] [PATCH] - OrthogonalizeAction hello gert Gert Gremmen wrote: > http://tile.openstreetmap.nl/?zoom=18&lat=51.99522&lon=4.34562&layers=B0 > 00000F > > I suppose you can put that URL into JOSM and download > the area. > I tried using JOM version 1087 and the most recent > plug-ins (though that should not be a problem) > Actually it does not delete it, but becomes invisible. you mean the buildings that look like a three-pointed star? well, you can't orthogonalize those as the function tries to orthogonalize _all_ edges. that does not work with such a shape as only shapes with an even number of edges can be truely orthogonalized! I think we need another check before orthogonalizing. how about that: // Check if way has an even number of edges if (((way.nodes.size() - 1) % 2) == 1) { JOptionPane.showMessageDialog(Main.parent, tr("Please select a way with an even number of edges.")); return; } I don't like the wording of the dialog-message. Can someone suggest a better one? regards hermann _______________________________________________ josm-dev mailing list [EMAIL PROTECTED] http://lists.openstreetmap.org/listinfo/josm-dev _______________________________________________ josm-dev mailing list [EMAIL PROTECTED] http://lists.openstreetmap.org/listinfo/josm-dev