public long updateMap ( Map < String , String > tags , Iterable < Element > elements , Handler < DiffElement > handler ) { tags . put ( "created_by" , osm . getUserAgent ( ) ) ; long changesetId = openChangeset ( tags ) ; /* the try-finally is not really necessary because the server closes an open changeset after 24 hours automatically but it is nicer if we clean up after ourselves in case of error ourselves. */ try { uploadChanges ( changesetId , elements , handler ) ; } finally { closeChangeset ( changesetId ) ; } return changesetId ; }
Opens a changeset uploads the data closes the changeset and subscribes the user to it .