[OSM-talk] Users' activity feeds

Hugh Barnes list.osm at hughbris.com
Mon Aug 25 13:42:58 BST 2008


On Saturday 23 August 2008 17:59:00 Hugh Barnes wrote:
> If such feeds were to be provided through the project's infrastructure, it
> shouldn't be too hard to do XSL transforms from a bounded area dataset
> download [citation needed]. All of the required metadata seems to be there.
> (Maybe not enough of history). I'll try to find some time tonight
> (Saturday) to do this and hopefuly get back either way tomorrow.
>
> I realise there would be questions of architecture before such a tool could
> be deployed on a server (load, caching, possible size limits, frequency
> limits), but it sounds like a fun exercise to start on.
>
> I'm not sure what the easiest way to query a user's activity would be,
> probably the API. (Again, wiki down). The bounded area dataset might also
> be best obtained through API calls.
>

I've been picking away at a transformation of a bounded XML dataset. Must … 
stop … tweaking. It seems usable locally at the moment, though I haven't been 
able to get a nice rendering from Gecko. The validator says it's valid with a 
few warnings.

I invoked the script with xsltproc on the sample URL in the wiki 
(http://api.openstreetmap.org/api/0.5/map?bbox=11.54,48.14,11.543,48.145, 
saved to api-sample.osm.xml), like so:

xsltproc --stringparam since.time 2008-06-02T20:28:47+01:00 osm2atom.xsl 
api-sample.osm.xml > change-sample.atom.xml

Unfortunately, you currently need to supply a comparison datetime as a 
parameter. I can use the exslt templates to solve this, but it makes bundling 
something I can simply attach a whole lot more difficult.

To get a local setup to continue checking changes for you, you'd need to 
string together some scripts doing wget and cron, or whatever.

I've attached the XSL transformation (osm2atom.xsl) and my output document 
(change-sample.atom.xml). I'll be happy to put this transform into svn if 
anyone thinks it's worth pursuing as a service on the server. I also don't 
mind moving this discussion to the dev list if it has legs.

Some miscellaneous notes, a.k.a. the devil in the detail:
- When the wiki came back, I looked at alternate datasources but didn't really 
come up with anything completely suitable. The live dataset at least 
shows "changes" (of unknown kinds) to OSM elements, so it's just workable as 
a watch. I would like for there to be a dataset a little more suited to the 
task. I don't think it's worth investing much more time transforming this 
dataset.
- A timestamp in the bounded XML would be a useful enhancement 
(/osm/@timestamp)
- The XML document has no namespace. This can cause problems for consumers.
- I only did bounded area changes, not user changes, as I couldn't find 
anything suitable at all.

On the need for this type of service, I believe demand will only increase for 
it, as Nick and François alluded, especially if vandalism and other 
maliciousness becomes a problem.

Apologise if this is incoherent. Sleepiness has loomed.

Cheers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osm2atom.xsl
Type: text/x-xslt
Size: 11955 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20080825/0ecac11f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: change-sample.atom.xml
Type: text/xml
Size: 9015 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20080825/0ecac11f/attachment.xml>


More information about the talk mailing list