Gubaer / josm-scripting-plugin

Task automation in the OpenStreetMap editor JOSM
https://gubaer.github.io/josm-scripting-plugin
GNU General Public License v3.0
26 stars 9 forks source link

Possible bug when updating coordinates of elements #59

Closed SafwatHalaby closed 7 years ago

SafwatHalaby commented 7 years ago

I'm iterating a collection of elements that were downloaded from the OSM server.

///etc...foreach element
{
 element.lat = 34;
 element.lon = 35;
}

For some reason, the above code will correctly set lon to 35, but lat will be set to the element's previous longitude. It's as if this is being executed:

element.lat = element.lon;
element.lon = 35;

The following variation seems to work fine:

///etc...foreach element
{
 element.pos = {lat: 34, lon: 35}
}
Gubaer commented 7 years ago

Fixed in ff38789. Deployed a new release. Please update from JOSM preferences dialog. Requires JOSM >= 13007.

SafwatHalaby commented 7 years ago

You're doing an amazing job maintaining this plugin. Thank you.

SafwatHalaby commented 7 years ago

Slightly offtopic. These are bot scripts based on this plugin: https://github.com/SafwatHalaby/osm-bot. You may want to check them out.

Gubaer commented 7 years ago

Interesting! One of my customers, a local public transport provider, might be interested in your GTFS bot!

SafwatHalaby commented 7 years ago

For more info about the gtfs script, see this forum post and this one. Conflicts are resolved with a nice trick that allows incremental updates. A dedicated Wiki page with good documentation will be set-up soon, once I finish testing / changing things.

Also, I may eventually make the script emit mappers vs gtfs conflict logs that could be given back to the provider for feedback.

SafwatHalaby commented 7 years ago

Wiki page: https://wiki.openstreetmap.org/wiki/User:SafwatHalaby/scripts/gtfs (work in progress)