All,<br><br>A follow-up to my last email.  It&#39;s been an epic but I&#39;ve solved most of the technical hurdles for producing a GeoRSS feed from Pmwiki.  I could do with your help on extending PmWiki&#39;s &#39;feed.php&#39; below.<br>
<br>As proof of concept I&#39;m adding two new custom mark-ups to save PTV&#39;s representing latitude and longitude for each page.  My mark-up in wiki pages is:<br><br>(:latitude 50.1234:)<br>(:longitude -1.23456:)<br><br>
I get PTV&#39;s into the system using the following:<br><br>$FmtPV[&#39;$Latitude&#39;] = &#39;@$page[&quot;latitude&quot;]&#39;;<br>
$FmtPV[&#39;$Longitude&#39;] = &#39;@$page[&quot;longitude&quot;]&#39;;<br>
$SaveProperties[] = &#39;latitude&#39;;<br>
$SaveProperties[] = &#39;longitude&#39;;<br>
<br>I add my own custom feed format handled by PmWiki&#39;s core &#39;feed.php&#39; script using (copied from existing rss entry):<br><br>SDVA($FeedFmt[&#39;georss&#39;][&#39;feed&#39;], .... &lt;--- same as Pm&#39;s core rss line [snipped here]<br>
<br>SDVA($FeedFmt[&#39;georss&#39;][&#39;item&#39;], array(<br>  &#39;_start&#39; =&gt; &quot;&lt;item&gt;\n&quot;,<br>  &#39;_end&#39; =&gt; &quot;&lt;/item&gt;\n&quot;,<br>  &#39;title&#39; =&gt; &#39;{$Group} / {$Title}&#39;,<br>
  &#39;link&#39; =&gt; &#39;{$PageUrl}&#39;,<br>  &#39;description&#39; =&gt; &#39;{$Description}&#39;,<br>  &#39;geo:lat&#39;  =&gt; &#39;{$Latitude}&#39;,<br>  &#39;geo:long&#39;  =&gt; &#39;{$Longitude}&#39;,<br><b>  &#39;georss:point&#39; =&gt; &#39;{$Latitude} {$Longitude}&#39;,    &lt;------- please look here<br>
</b>  &#39;dc:contributor&#39; =&gt; &#39;{$LastModifiedBy}&#39;,<br>  &#39;dc:date&#39; =&gt; &#39;$ItemISOTime&#39;,<br>  &#39;pubDate&#39; =&gt; &#39;$ItemRSSTime&#39;,<br>  &#39;enclosure&#39; =&gt; &#39;RSSEnclosure&#39;));<br>
<br>I include the above using:<br><br>if ($action == &#39;georss&#39;)  include_once(&quot;scripts/feeds.php&quot;);<br><br>If I draw your attention to the &#39;georss:point&#39; line which concatenates latitude and longitude, adding a space character in the middle.  All this works fine when I have a lat/lng defined in my page.  The problem I have is that when a page doesn&#39;t have a lat/lng I get the &#39;georss:point&#39; line in my rss output with the value set to a space.  The thing I like about the other &#39;geo:lat&#39; and &#39;geo:long&#39; lines is that they are automagically removed from the rss output if the page doesn&#39;t contain them.<br>
<br>How can I get this behaviour with the &#39;georss:point&#39; line above?<br><br>If I can get this solved I&#39;ll write it up as a recipe for others to play with.<br><br>Thanks in advance,<br>-Steve.<br><br><div class="gmail_quote">
2009/10/19  <span dir="ltr">&lt;<a href="mailto:stevecrisp@gmail.com">stevecrisp@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear Pm community,<br><br>As per title I&#39;m attempting to write a proof of concept PmWiki recipe for geotagging support in PmWiki.  I could do with some design advice on my embryonic ideas/ramblings below:<br><br>(1) We want to add geotag to relevant wiki pages.  New markup needed (:coord &lt;lat&gt;, &lt;lng&gt;:) e.g. (:coord 52.12345, -1.23456789:).  This would create metatags in the resultant html output in keeping with say Wikipedia&#39;s ideas here: <br>

<br>+ <a href="http://en.wikipedia.org/wiki/Geotagging" target="_blank">http://en.wikipedia.org/wiki/Geotagging</a><br>+ <a href="http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Geographical_coordinates" target="_blank">http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Geographical_coordinates</a><br>

<br>So we have geotagged page we need to get to the data (from other applications) in various ways; GeoRSS feed, backend database<br><br>(2) For the GeoRSS feed I&#39;m hoping I&#39;ll simply reuse one of the existing RSS feeds and convert the output to GeoRSS XML output.  Hopefull I&#39;ll be able to get this working for Recent Changes for example.  GeoRSS is good as many mapping clients consume this.  I could also adapt for output of KML also lets not jump before I&#39;m walking!<br>

<br>(3) The end goal for the database backend is we could use PmWiki to display
relevant content to a specified grid reference, and a few quick
geodetic calculations could give me a list of pages with content near
to a specific coordinate.  This is a bit like Flikr for photos.  I&#39;ll start with the SQLite receipe (<a href="http://www.pmwiki.org/wiki/Cookbook/SQLite" target="_blank">http://www.pmwiki.org/wiki/Cookbook/SQLite</a>) as I&#39;ve used this before with PmWiki.  I could add two new columns to the &#39;pages&#39; table which will extract the latitude and longitude data from my new markup as per (1) above.  This will help me perform quick distance calculations at a later time without inspecting the page content.  Ideally I&#39;d use either Postgres (PostGIS extensions) or MySQL backend (with geo extensions).<br>

<br>For those that are still reading, I&#39;ve the following initial questions:<br><br>(a) has this been done before?<br>(b) if not, does the above sound achievable (assuming a few pointers from this community as I uncover issues)?<br>

(c) I assume I&#39;ll copy the (:summary:) markup item to create new new (:coord:) markup.  Is this good practise?<br>(d) Will a customer RSS feed (read GeoRSS feed) be possible from the content of data available from the recent changes RSS feed?  I&#39;ll need page title and coord markup within the XML output.<br>

(e) For the database backend, starting with SQLite recipe, can I simply add two columns (lat &amp; lng) and have the new (:coord:) markup be parsed by it?<br><br>Any advice very much welcome.<br>--Steve.<br>
</blockquote></div><br>