<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"> I work with Will on the CAP103 project and succeeded yesterday to calculate daily statistics for the CAP103 geographic zone.<br>I adapted a python script originally written by Sebastien
Pierrel. The OsmApi module contains changeset functions that are usefull
to interrogate the OSM API and obtain the history of objects.<br><br>For
a BBOX, a specific contributor and a date range, we can interrogate the
OSM API an list the changesets. Below are examples for changeset
ID=16327554. <br><br>And looking more in detail about the Changeset
function, I see that there are collection of objects
edited. We should be able with this historical data to calculate more
detailed statistics (ie. objects created, modified, deleted).<br><br>It
is quitee easy to treat this with Python script but there might be some limits when interrogating the OSM API. Then, it is possible to shorten the period analyzed.<br><br>For each changeset, you have the creation date and the Comment variable. <br>Example : Changeset collection item using osmApi.ChangesetsGet function<br>{16327554:
{u'uid': 1339602, u'open': False, u'min_lat': u'19.626711',
u'created_at': u'2013-05-28T18:08:50Z', u'max_lon': u'-71.9161975',
u'tag': {u'comment': u'Projet cap103 edition a distance', u'created_by':
u'JOSM/1.5 (5939 fr) Linux Ubuntu 12.04.2 LTS'}, u'user': u'John
Carlo', u'max_lat': u'19.7288581', u'min_lon': u'-71.9958761',
u'closed_at': u'2013-05-28T19:31:18Z', u'id': 16327554}}<br><br>The
osmApi.ChangesetDownload is also usefull to obtain the history of
objects. This list the various objects edited (ie. node, way, relation),
their status (created, edited, deleted) and Tags.<br><br>Objects Collection
using function osmApi.ChangesetDownload(changeset id)<br>{u'action':
u'create', u'data': {u'changeset': 16327554, u'uid': 1339602,
u'timestamp': u'2013-05-28T18:08:53Z', u'lon': -71.9755596, u'visible':
True, u'version': 1, u'user': u'John Carlo', u'lat': 19.6543342, u'tag':
{u'addr:housenumber': u'0869H-10-100', u'addr:street': u'Village
Nativity Terrier-Rouge'}, u'id': 2323372166L}, u'type': u'node'}<br><br>{u'action':
u'modify', u'data': {u'changeset': 16327554, u'uid': 1339602,
u'timestamp': u'2013-05-28T18:08:53Z', u'nd': [330537291, 1028932465,
330525425, 330600909, 330585780, 1028932361, 2262221592L, 330547550,
2316028253L, 330581577, 330533684, 330575573, 330525334, 330538780,
330551803, 330540720, 2312207865L, 330541763, 330557722, 330534653,
330560877, 330555513, 330539911, 330579005, 330575077, 330584161,
330538354, 330548147, 2323372173L, 330559532, 330527407, 330531707,
330600600, 330531364, 330549754, 330541775, 330587579],
u'tag': {u'name': u'Route Nationale # 6', u'haiti:code': u'RN',
u'haiti:import_file': u'3.osm', u'haiti:source_file':
u'intersect8_polyid__3.shp', u'haiti:objectid': u'1431',
u'haiti:source': u'CNIGS and CartONG', u'haiti:type': u'Nationale',
u'ref': u'RN 6', u'haiti:nom2': u'RN6', u'haiti:nom': u'Nationale no 6',
u'highway': u'primary'}, u'visible': True, u'version': 3, u'user':
u'John Carlo', u'id': 222650616}, u'type': u'way'}<br><br>{u'action':
u'modify', u'data': {u'changeset': 16327554, u'uid': 1339602,
u'timestamp': u'2013-05-28T18:28:07Z', u'nd': [2322223911L, 2323407166L,
2322223910L, 2322223673L, 2322223674L, 2322223911L], u'tag':
{u'building': u'yes'}, u'visible': True, u'version': 2, u'user': u'John
Carlo', u'id': 223313287}, u'type': u'way'}<br><br>{u'action':
u'delete', u'data': {u'changeset': 16327554, u'uid': 1339602,
u'timestamp': u'2013-05-28T18:28:08Z', u'nd': [], u'tag': {},
u'visible': False, u'version': 2, u'user': u'John Carlo',
u'id': 223438254}, u'type': u'way'}<br><div><span><br></span></div><div> </div><div><span style="font-style:italic;color:rgb(0, 0, 191);font-weight:bold;">Pierre <br></span><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font face="Arial" size="2"> <b><span style="font-weight:bold;">De :</span></b> Paul Norman <penorman@mac.com><br> <b><span style="font-weight: bold;">À :</span></b> 'william skora' <skorasaurus@gmail.com>; dev@openstreetmap.org <br> <b><span style="font-weight: bold;">Envoyé le :</span></b> Vendredi 24 mai 2013 5h23<br> <b><span style="font-weight: bold;">Objet :</span></b> Re: [OSM-dev] Querying Changeset Tags in OSM API<br> </font> </div>
<div class="y_msg_container"><br><div id="yiv7318691783"><style><!--
#yiv7318691783
_filtered #yiv7318691783 {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;}
_filtered #yiv7318691783 {font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;}
_filtered #yiv7318691783 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
_filtered #yiv7318691783 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
#yiv7318691783
#yiv7318691783 p.yiv7318691783MsoNormal, #yiv7318691783 li.yiv7318691783MsoNormal, #yiv7318691783 div.yiv7318691783MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}
#yiv7318691783 a:link, #yiv7318691783 span.yiv7318691783MsoHyperlink
{color:blue;text-decoration:underline;}
#yiv7318691783 a:visited, #yiv7318691783 span.yiv7318691783MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
#yiv7318691783 p.yiv7318691783MsoListParagraph, #yiv7318691783 li.yiv7318691783MsoListParagraph, #yiv7318691783 div.yiv7318691783MsoListParagraph
{margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}
#yiv7318691783 span.yiv7318691783EmailStyle17
{font-family:"Calibri", "sans-serif";color:#1F497D;}
#yiv7318691783 .yiv7318691783MsoChpDefault
{font-family:"Calibri", "sans-serif";}
_filtered #yiv7318691783 {margin:1.0in 1.0in 1.0in 1.0in;}
#yiv7318691783 div.yiv7318691783WordSection1
{}
#yiv7318691783
_filtered #yiv7318691783 {}
_filtered #yiv7318691783 {font-family:"Calibri", "sans-serif";}
_filtered #yiv7318691783 {font-family:"Courier New";}
_filtered #yiv7318691783 {font-family:Wingdings;}
_filtered #yiv7318691783 {font-family:Symbol;}
_filtered #yiv7318691783 {font-family:"Courier New";}
_filtered #yiv7318691783 {font-family:Wingdings;}
_filtered #yiv7318691783 {font-family:Symbol;}
_filtered #yiv7318691783 {font-family:"Courier New";}
_filtered #yiv7318691783 {font-family:Wingdings;}
#yiv7318691783 ol
{margin-bottom:0in;}
#yiv7318691783 ul
{margin-bottom:0in;}
--></style><div><div class="yiv7318691783WordSection1"><div class="yiv7318691783MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">You could do this with pgsnapshot (or if just doing analysis, osm2pgsql) in the same database as changesetmd, and then do JOINs between the tables to get objects that were last modified in a changeset that had a particular tag.</span></div><div class="yiv7318691783MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></div><div class="yiv7318691783MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">This may be hampered by two things</span></div><div class="yiv7318691783MsoListParagraph" style=""><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"><span style="">-<span
style="font:7.0pt "Times New Roman";"> </span></span></span><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">A lack of minutely diff support by changesetmd</span></div><div class="yiv7318691783MsoListParagraph" style=""><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"><span style="">-<span style="font:7.0pt "Times New Roman";"> </span></span></span><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">A lack of schema support in most OSM software. See <a rel="nofollow" target="_blank" href="http://www.postgresql.org/docs/9.1/static/ddl-schemas.html">http://www.postgresql.org/docs/9.1/static/ddl-schemas.html</a> in the postgresql docs for information about schemas.
osmosis</span></div><div class="yiv7318691783MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></div><div class="yiv7318691783MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">This probably isn’t exactly what you want, but I think it’s the best there is at this point. </span></div><div class="yiv7318691783MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></div><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt;"><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;"><div class="yiv7318691783MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma", "sans-serif";">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma",
"sans-serif";"> william skora [mailto:skorasaurus@gmail.com] <br><b>Sent:</b> Sunday, May 05, 2013 8:50 AM<br><b>To:</b> dev@openstreetmap.org<br><b>Subject:</b> [OSM-dev] Querying Changeset Tags in OSM API</span></div></div></div><div class="yiv7318691783MsoNormal"> </div><div><div><div><div><div class="yiv7318691783MsoNormal"> </div></div><div class="yiv7318691783MsoNormal">Hi, <br><br>I'm curious if there's any current capabilities to filter entire objects based on the tags used on the changeset. I'm on the CAP103 team in Northern Haiti with HOT and we'd like to filter objects modified by mappers that we are training by querying changesets, instead of adding a tag to each object within a specific bbox and a changeset tag with something like source:Project=CAP103.<br> <br>Ideally, I'd prefer to do this through a server-side interface (XAPI) but would be open to client-side filtering options like osmosis. </div></div><div
class="yiv7318691783MsoNormal" style="margin-bottom:12.0pt;">as I understand, Overpass isn't currently capable to do this; it is only able to query within </div></div><div class="yiv7318691783MsoNormal">Any advice and help is appreciated. <br><br>Regards,<br>Will </div></div></div></div></div></div><br>_______________________________________________<br>dev mailing list<br><a ymailto="mailto:dev@openstreetmap.org" href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/listinfo/dev" target="_blank">http://lists.openstreetmap.org/listinfo/dev</a><br><br><br></div> </div> </div> </blockquote></div> </div></body></html>