You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you create a shared node with a way that has not yet been uploaded to OSM (i.e. still has an observe temporary id), this will create a new node instead of applying it as a shared node when updating both pending edits.
To solve this, we will need to do two things:
a> establish dependencies -- i.e. mark out that edit with id say observe-xyz cannot be uploaded until observe-abc is uploaded.
b> whenever a new way is uploaded, retrieve the mapping of ids from OSM when uploading the changeset, look at all pending edits, and replace the temporary OSM IDs with the newly uploaded IDs from OSM.
For a> this would ideally be handled when creating the way in the wayEditHistory screen. For b>, we would need to do something like:
In the reducer, look at all pending edits, and if any of them reference observe- IDs that have been mapped to OSM IDs, update the node ids as well as ndref references to the OSM IDs.
@geohacker - Let me know if this makes sense. I'm not certain of the way to implement the marking out of dependencies to make sure things are not uploaded out of order. This should hopefully just be something like adding a flag when creating a new way that shares nodes with a way that has an observe- id and checking for that flag when uploading (similar to how we do for photos with dependencies on new features, etc.).
The text was updated successfully, but these errors were encountered:
Currently, if you create a shared node with a way that has not yet been uploaded to OSM (i.e. still has an
observe
temporary id), this will create a new node instead of applying it as a shared node when updating both pending edits.To solve this, we will need to do two things:
observe-xyz
cannot be uploaded untilobserve-abc
is uploaded.For
a>
this would ideally be handled when creating the way in the wayEditHistory screen. Forb>
, we would need to do something like:In the
edit-to-osm-change
util, return thenodeIdMap
that will map theobserve-
temp ids to the negative IDs we have generated for the changeset upload: https://github.com/developmentseed/observe/blob/edit-ways-changesets/app/utils/edit-to-osm-change.js#L177In this uploadOsmChange function in the
osm-api
service, parse the XML result from OSM and return a mapping of negative ID to the generated OSM ID: https://github.com/developmentseed/observe/blob/edit-ways-changesets/app/services/osm-api.js#L167In the
upload-edit
util, take thenodeIdMap
and the mapping of negative IDs to generated OSM IDs, to create a mapping ofobserve-
temp IDs to the generated OSM IDs: https://github.com/developmentseed/observe/blob/edit-ways-changesets/app/utils/upload-edit.js#L33From
upload-edit
return theobserve-
ID to OSM ID map alongwith the changeset ID: https://github.com/developmentseed/observe/blob/edit-ways-changesets/app/utils/upload-edit.js#L37 - handle this change whereverupload-edit
is being called.Dispatch an action like
NEW_NODE_MAPPING
or something with the above mapping: https://github.com/developmentseed/observe/blob/edit-ways-changesets/app/actions/edit.js#L47In the reducer, look at all pending edits, and if any of them reference
observe-
IDs that have been mapped to OSM IDs, update thenode
ids as well asndref
references to the OSM IDs.@geohacker - Let me know if this makes sense. I'm not certain of the way to implement the marking out of dependencies to make sure things are not uploaded out of order. This should hopefully just be something like adding a flag when creating a new way that shares nodes with a way that has an
observe-
id and checking for that flag when uploading (similar to how we do for photos with dependencies on new features, etc.).The text was updated successfully, but these errors were encountered: