[josm-dev] How to update changes in dataSet ?

Marko Mäkelä marko.makela at iki.fi
Tue Jan 4 08:54:57 GMT 2011


On Tue, Jan 04, 2011 at 12:01:03AM -0200, Flávio Henrique wrote:
>Hi there!
>I need help to figure out how to update the dataset after some changes. I'll
>try to explain.
>
>My goal is select an area with mouse and search similar ways (specific 
>tests) and try to combine them. The problem is after combine some ways, 
>the method NavigatableComponent.getCurrentDataSet().getWays() returns 
>the same unchanged data. I tried the 
>nc.getCurrentDataSet().beginUpdate() and endUpdate() methods but no 
>success.
>
>So, how to update the dataSet after some modifications? Please?

I am not sure if this helps, but perhaps you should have a look at my 
WaySelector plugin. The WaySelector plugin extends the current 
selection, but it looks like you may need the opposite: reducing the 
current selection.

I developed the WaySelector for selecting a complex coastline (to 
inspect that no natural=coastline lines (which should be natural=water) 
are on the mainland side of the coastline). I invoked JOSM on an extract 
of just natural=coastline ways of a Geofabrik extract of Finland, 
clicked on one coastline segment and then hit Shift+W to select the 
whole coastline.

>I know, by my log, that some ways are combined, but after the 
>endUpdate() call, another nc.getCurrentDataSet().getWays() returns the 
>same previous data (unchanged).

If I understood correctly, you are merging the nodes of some ways to 
existing ways, and you want to remove the ways from which you merged the 
nodes. After removing the ways from the dataset, you might need to 
remove the ways from the selection as well.

Best regards,

	Marko



More information about the josm-dev mailing list