@@ -68,17 +68,21 @@ class ChangesetProvider @Inject() (
6868 *
6969 * @param changes The changes to be submitted to OSM
7070 * @param changeSetComment The changeset comment to be associated with the change
71+ * @param accessToken The OAuth access token for authentication
72+ * @param taskId Optional taskId to associate with this changeset
73+ * @param source Optional source to be associated with the changeset
7174 * @return future that will return the OSMChange that was submitted to the OSM servers
7275 */
7376 def submitOsmChange (
7477 changes : OSMChange ,
7578 changeSetComment : String ,
7679 accessToken : String ,
77- taskId : Option [Long ] = None
80+ taskId : Option [Long ] = None ,
81+ source : Option [String ] = None
7882 )(implicit c : Option [Connection ] = None ): Future [Elem ] = {
7983 val p = Promise [Elem ]()
8084 // create the new changeset
81- this .createChangeset(changeSetComment, accessToken) onComplete {
85+ this .createChangeset(changeSetComment, accessToken, source ) onComplete {
8286 case Success (changesetId) =>
8387 // retrieve the current version of the osm feature
8488 // conflate the current tags with provided tags
@@ -248,15 +252,21 @@ class ChangesetProvider @Inject() (
248252 *
249253 * @param comment The comment to associate with the changeset
250254 * @param accessToken The access token for the user
255+ * @param source Optional source to be associated with the changeset
251256 * @return
252257 */
253- def createChangeset (comment : String , accessToken : String ): Future [Int ] = {
258+ def createChangeset (
259+ comment : String ,
260+ accessToken : String ,
261+ source : Option [String ] = None
262+ ): Future [Int ] = {
254263 // Changeset XML Element
255264 val newChangeSet =
256265 <osm >
257266 <changeset >
258267 <tag k =" created_by" v =" MapRoulette" />
259268 <tag k =" comment" v ={comment}/>
269+ {source.filter(_.nonEmpty).map(s => <tag k =" source" v ={s}/>).getOrElse(NodeSeq .Empty )}
260270 </changeset >
261271 </osm >
262272 implicit val url = s " ${config.getOSMServer}/api/0.6/changeset/create "
0 commit comments