Closed arminus closed 1 year ago
You can try merging ds:
const DataSetMerger = Java.type('org.openstreetmap.josm.data.osm.DataSetMerger');
let ds1 = Api.downloadObject(840103836, 'way', {full: true});
let l = josm.layers.addDataLayer({ds: ds1, name: 'myways'});
let ds2 = Api.downloadObject(25689829, 'way', {full: true});
ds1 = new DataSetMerger(ds1, ds2);
ds1.merge();
Great, that works, thanks a lot!
Starting with the simple working example:
How do I add additional ways as retrieved by consecutive Api.downloadObject calls to the existing layer? The following approach doesn't work:
causes a
class jdk.proxy2.$Proxy34 cannot be cast to class org.openstreetmap.josm.data.osm.OsmPrimitive (jdk.proxy2.$Proxy34 is in module jdk.proxy2 of loader 'app'; org.openstreetmap.josm.data.osm.OsmPrimitive is in unnamed module of loader 'app')