New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changeset metadata download to include number of changes #1947

Closed
mmd-osm opened this Issue Aug 14, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@mmd-osm
Contributor

mmd-osm commented Aug 14, 2018

For statistical reasons, it might be interesting to also include the number of changes (field "num_changes" in changesets table) in the changeset(s) result. This way it would be possible to easily identify empty changesets, or avoid downloading large changesets only to find out how many changes are included. Also, editors like JOSM could display this additional column in the Changeset Manager.

If this is ok, I would create an accompanying issue for cgimap as well.

diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 502637c2a..1aa1e1fd3 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -232,6 +232,7 @@ class Changeset < ActiveRecord::Base
     bbox.to_unscaled.add_bounds_to(el1, "_") if bbox.complete?
 
     el1["comments_count"] = comments.length.to_s
+    el1["changes_count"] = num_changes.to_s
 
     if include_discussion
       el2 = XML::Node.new("discussion")

@tomhughes

This comment has been minimized.

Show comment
Hide comment
@tomhughes

tomhughes Aug 14, 2018

Member

You know github has a convenient way of attaching a patch to an issue, called a pull request...

Member

tomhughes commented Aug 14, 2018

You know github has a convenient way of attaching a patch to an issue, called a pull request...

@mmd-osm

This comment has been minimized.

Show comment
Hide comment
@mmd-osm

mmd-osm Aug 14, 2018

Contributor

Sure, I can do that. The only issue at the moment is that my local unit tests don't work, and it will probably fail miserably on Travis. Let's see...

Contributor

mmd-osm commented Aug 14, 2018

Sure, I can do that. The only issue at the moment is that my local unit tests don't work, and it will probably fail miserably on Travis. Let's see...

@mmd-osm

This comment has been minimized.

Show comment
Hide comment
@mmd-osm

mmd-osm Sep 4, 2018

Contributor

Closing, as #1948 got merged. The respective cgimap patch is in zerebubuth/openstreetmap-cgimap@2931c8d - release in version 0.6.2.

Contributor

mmd-osm commented Sep 4, 2018

Closing, as #1948 got merged. The respective cgimap patch is in zerebubuth/openstreetmap-cgimap@2931c8d - release in version 0.6.2.

@mmd-osm mmd-osm closed this Sep 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment