<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>geolocation &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/geolocation/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Mon, 06 Apr 2026 14:28:44 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>geolocation &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Why is it so hard to passively stalk my friends' locations?]]></title>
		<link>https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/</link>
					<comments>https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 15 Apr 2026 11:34:45 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[FourSquare]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[location]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=68114</guid>

					<description><![CDATA[I feel terribly guilty when I visit a new city, post photos of my travels, only to have a friend say &#34;Hey! Why didn&#039;t you let me know you were in my neck of the woods?&#34;  Similarly, if I bump into an old acquaintance at a conference, we both tend to say &#34;If only I&#039;d known you were here, we could have had dinner together last night!&#34;  I do enjoy the serendipity of events like FOSDEM - randomly…]]></description>
										<content:encoded><![CDATA[<p>I feel terribly guilty when I visit a new city, post photos of my travels, only to have a friend say "Hey! Why didn't you let me know you were in my neck of the woods?"</p>

<p>Similarly, if I bump into an old acquaintance at a conference, we both tend to say "If only I'd known you were here, we could have had dinner together last night!"</p>

<p>I do enjoy the serendipity of events like FOSDEM - randomly seeing a mate and expressing the joy of spontaneity. But I also like arranging to meet up in advance.</p>

<p>At the moment, my strategy is sending a blast on social media saying "I'm visiting [this city] next week, anyone fancy a beer and a natter?" I've met friends all over Europe, Australia, and New Zealand that way.  <a href="https://shkspr.mobi/blog/2025/06/meeting-my-fedifriends-afk/">It mostly works</a>.  But I can't help feeling it is inefficient and prone to missing connections.</p>

<p>I even wrote my own code to auto-post FourSquare checkins to my other social media sites.</p>

<p>Here are my ideal scenarios. Imagine something built in to Signal / WhatsApp / Whatever app you already use.</p>

<h2 id="plan-in-advance"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#plan-in-advance">Plan In Advance</a></h2>

<p>I tell my app that I'm going to Barcelona from 14th - 19th February and am happy to meet any of my friends.</p>

<p><em>✨Background Magic✨</em></p>

<p>My friend Alice has also planned a trip to Barcelona around those dates. She gets a ping saying that one of her friends is going to be in the same city. Does she want to know more?</p>

<p>So far, so <a href="https://en.wikipedia.org/wiki/Dopplr">Dopplr</a>.</p>

<p>My friend Bob lives just outside of Barcelona. He's set his "willing to travel" settings to be about 30 minutes, so also receives a ping.</p>

<p>I don't know that either of them have seen the notification until they decide they want to meet.</p>

<h2 id="spontaneous-fun"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#spontaneous-fun">Spontaneous Fun</a></h2>

<p>I step off the train in Manchester, England England.  Perhaps the app notices I'm away from home, or maybe I press the "Anyone Around?" button.</p>

<p>On a map I can see friends who have shared their rough location. I decide to message Chuck to see if he's free for a chat.</p>

<p>Dave notices my location is now within his preferred travel distance. He gives me a ring.</p>

<p>A bit like how FourSquare used to be - but with less precision.</p>

<h2 id="downsides"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#downsides">Downsides</a></h2>

<p>The above is very much the "happy path". It doesn't look at any of the knotty problems or grapple with the UI that would be needed to make this work.  But we know the technology for sharing location is viable - so what are the social issues that make this so difficult?</p>

<h3 id="social-awkwardness"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#social-awkwardness">Social Awkwardness</a></h3>

<p>"Oh, fuck, Edgar's location says he's in town. Can we pretend to be out of the country?"</p>

<p>Alternatively, "Huh, I know at least a dozen people who live in Skegness. Why aren't any of them responding to me?"</p>

<p>Social pressure and awkwardness are hard problems. No one wants to use the app that makes you feel like a friendless loser.</p>

<h3 id="privacy"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#privacy">Privacy</a></h3>

<p>Do you <em>want</em> your friends knowing your every movement? I'm sure some people do, but most probably don't. It's possible to sketch out some vague controls:</p>

<ul>
<li>Only send a notification if I push this button.</li>
<li>Don't send alerts if I am within this radius of my home / work.</li>
<li>Fuzz my location to the city / state / country level.</li>
</ul>

<h3 id="danger"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#danger">Danger</a></h3>

<p>Is it a risk to let people know vaguely where you are? Is meeting up with (semi-) strangers from the Internet a smart life choice? Is having an app stalk you across the globe giving too much data to advertisers?</p>

<p>Does that creep from work abuse the system to keep popping up whenever you're out with friends?</p>

<h2 id="technology"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#technology">Technology</a></h2>

<p>I said the technology exists for this, and that was sort of true. Every device has GPS &amp; an Internet connection. Storing a log of friends and sending them a message is a solved problem.</p>

<p>But is it solved in a decentralised and privacy preserving way?</p>

<p>No one wants to give all this power to one company. Google will build it and kill it. Facebook will sell your secrets to dropshippers. A funky start-up will be acquhired by Apple &amp; restricted to iOS devices.</p>

<p>My location is fuzzed to an acceptable degree of imprecision and then sent… where? To all my friends directly? To a central server? Can <a href="https://en.wikipedia.org/wiki/K-anonymity"><em>k</em>-anonymity</a> help?</p>

<p>Is this a separate app? Everyone seemed to leave FourSquare after they buggered around with it. Perhaps it is just a feature in existing apps?</p>

<h3 id="whats-already-there"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#whats-already-there">What's Already There?</a></h3>

<p>Messaging apps like Signal, Telegram, and WhatsApp allow you to share your location with one or more friends.</p>

<p>To me, it feels a bit weird to manually send a dropped pin to some / all of my contact. It also doesn't let you share "tomorrow I will be in…"</p>

<p>Using "Stories" is the common way to share an update with all contacts - but none of them let you automatically share your location in a story.</p>

<p>FourSquare's Swarm app allows you to check in to a "neighbourhood". But there's no obvious way of saying "London" or "Manchester" - and I'm not sure how close to an area you need to be to get an alert that your friend is there.</p>

<h2 id="whats-next"><a href="https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/#whats-next">What's Next?</a></h2>

<p>I don't want to build this. Trying to get everyone I know to adopt a new app isn't going to happen. With the fragmentation of messaging and the lack of interoperability, this is likely to remain an unsolved problem for some time.</p>

<p>So here's my strategy.</p>

<ul>
<li>Get back in to using FourSquare. Most of my friends seemed to stop using it back in 2017 when it was split into Swarm. But a few are still on there.</li>
<li>Manually post a story on Mastodon, BlueSky, Facebook, WhatsApp, Signal, and Telegram saying "Visiting Hamburg next week. Anyone want a beer?"</li>
<li>Hope that something better comes along.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=68114&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2026/04/why-is-it-so-hard-to-passively-stalk-my-friends-locations/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Android now stops you sharing your location in photos]]></title>
		<link>https://shkspr.mobi/blog/2026/04/android-now-stops-you-sharing-your-location-in-photos/</link>
					<comments>https://shkspr.mobi/blog/2026/04/android-now-stops-you-sharing-your-location-in-photos/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 13 Apr 2026 11:34:48 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[geotagging]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[OpenBenches]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=70143</guid>

					<description><![CDATA[My wife and I run OpenBenches. It&#039;s a niche little site which lets people share photos of memorial benches and their locations. Most modern phones embed a geolocation within the photo&#039;s metadata, so we use that information to put the photos on a map.  Google&#039;s Android has now broken that.  On the web, we used to use:  &#60;input type=&#34;file&#34; accept=&#34;image/jpeg&#34;&#62;   That opened the phone&#039;s photo picker…]]></description>
										<content:encoded><![CDATA[<p>My wife and I run <a href="https://openbenches.org">OpenBenches</a>. It's a niche little site which lets people share photos of memorial benches and their locations. Most modern phones embed a geolocation within the photo's metadata, so we use that information to put the photos on a map.</p>

<p>Google's Android has now broken that.</p>

<p>On the web, we used to use:</p>

<pre><code class="language-html">&lt;input type="file" accept="image/jpeg"&gt;
</code></pre>

<p>That opened the phone's photo picker and let the use upload a geotagged photo. But a while ago Google deliberately broke that.</p>

<p>Instead, we were <a href="https://issuetracker.google.com/issues/243294058#comment27">encourage to use the <em>file</em> picker</a>:</p>

<pre><code class="language-html">&lt;input type="file"&gt;
</code></pre>

<p>That opened the default file manager. This had the unfortunate side-effect of allowing the user to upload <em>any</em> file, rather than just photos. But it did allow the EXIF metadata through unmolested.  <a href="https://issuetracker.google.com/issues/428397711">Then Google broke that as well</a>.</p>

<p>Using a "Progressive Web App" doesn't work either.</p>

<p>So, can users transfer their photos via Bluetooth or QuickShare? No. <a href="https://issuetracker.google.com/issues/485307531">That's now broken as well</a>.</p>

<p>You can't even directly share via email without the location being stripped away.</p>

<p>Literally the <em>only</em> way to get a photo with geolocation intact is to plug in a USB cable, copy the photo to your computer, and then upload it via a desktop web browser?</p>

<h2 id="why"><a href="https://shkspr.mobi/blog/2026/04/android-now-stops-you-sharing-your-location-in-photos/#why">Why?!?!?</a></h2>

<p><del>Because Google run an anticompetitive monopoly on their dominant mobile operating system.</del></p>

<p>Privacy.</p>

<p>There's a worry that users don't know they're taking photos with geolocation enabled. If you post a cute picture of your kid / jewellery / pint then there's a risk that a ne’er-do-well could find your exact location.</p>

<p>Most social media services are sensible and strip the location automatically. If you try to send a geotagged photo to Facebook / Mastodon / BlueSky / WhatsApp / etc, they default to <em>not</em> showing the location. You can add it in manually if you want, but anyone downloading your photo won't see the geotag.</p>

<p>And, you know, I get it. Google doesn't want the headline "Stalkers found me, kidnapped my baby, and stole my wedding ring - how a little known Android feature puts you in danger!"</p>

<p>But it is just so <em>tiresome</em> that Google never consults their community. There was no advance notice of this change that I could find. Just a bunch of frustrated users in my inbox blaming me for breaking something.</p>

<p>I don't know what the answer is. Perhaps a pop up saying "This website wants to see the location of your photos. Yes / No / Always / Never"? People get tired of constant prompts and the wording will never be clear enough for most users.</p>

<p>It looks like the only option available will be to develop a native Android app (and an iOS one?!) with all the cost, effort, and admin that entails. Android apps have <a href="https://developer.android.com/training/data-storage/shared/media#location-media-captured">a special permission for accessing geolocation in images</a>.</p>

<p>If anyone has a <em>working</em> way to let Android web-browsers access the full geolocation EXIF metadata of photos uploaded on the web, please drop a comment in the box.</p>

<p>In the meantime, please leave a +1 on <a href="https://github.com/whatwg/html/issues/11724#issuecomment-4192228562">this HTML Spec comment</a>.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=70143&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2026/04/android-now-stops-you-sharing-your-location-in-photos/feed/</wfw:commentRss>
			<slash:comments>21</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Reverse Geocoding is Hard]]></title>
		<link>https://shkspr.mobi/blog/2025/04/reverse-geocoding-is-hard/</link>
					<comments>https://shkspr.mobi/blog/2025/04/reverse-geocoding-is-hard/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 25 Apr 2025 11:34:39 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[geotagging]]></category>
		<category><![CDATA[OpenBenches]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=59857</guid>

					<description><![CDATA[My wife and I run OpenBenches - a crowd-sourced database of nearly 40,000 memorial benches.  Every bench is geo-tagged with a latitude and longitude. But how do you go from a string of digits to something human readable?  How do I turn -33.755780,150.603769 into &#34;42 Wallaby Way, Sydney, Australia&#34;?  Luckily, that&#039;s a (somewhat) solved problem. Services like OpenCage, StadiaMaps, OpenStreetMap,…]]></description>
										<content:encoded><![CDATA[<p>My wife and I run <a href="https://openbenches.org/">OpenBenches</a> - a crowd-sourced database of nearly 40,000 memorial benches.  Every bench is geo-tagged with a latitude and longitude. But how do you go from a string of digits to something human readable?</p>

<p>How do I turn <code>-33.755780,150.603769</code> into "42 Wallaby Way, Sydney, Australia"?</p>

<p>Luckily, that's a (somewhat) solved problem. Services like <a href="https://opencagedata.com/">OpenCage</a>, <a href="https://stadiamaps.com/">StadiaMaps</a>, <a href="https://nominatim.openstreetmap.org">OpenStreetMap</a>, and <a href="https://geocode.earth/">Geocode.Earth</a> all provide APIs which transform co-ordinates into addresses.  Done! Let's go home.</p>

<p>Except… Not everywhere <em>has</em> an address.  <a href="https://openbenches.org/bench/35905">Some benches are in parks</a>. They typically don't have a street number, but might have an interesting feature nearby to help with location. For example a statue or prominent landmark.</p>

<p>And… Not every address is relevant. <a href="https://openbenches.org/bench/26061">Some benches are on streets</a>. But we probably don't want to imply that the bench is <em>inside</em> or belongs to a specific nearby house.</p>

<p>Let's step back a bit. <em>Why</em> do we want to display a human-readable address?</p>

<p>We have two use-cases.</p>

<p>"As a visitor to the site, I want to:"</p>

<ol>
<li>Read a (rough) textual representation of where the bench is.</li>
<li>Click on a component of the address to see all benches within that area.</li>
</ol>

<p>The first is easy to explain:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2025/04/OB-Address.webp" alt="Map. Under it is an address of &quot;Middlewich, Cheshire East, England, United Kingdom&quot;." width="1134" height="638" class="aligncenter size-full wp-image-59858">

<p>The second is harder.  Suppose a bench is in Wellington, New Zealand. We want to create a URl like <a href="https://openbenches.org/location/New%20Zealand/Wellington/">openbenches.org/location/New Zealand/Wellington/</a>. That way, users can click on the word "Wellington" and find all the benches nearby. A user can also manually edit that URl to increase or decrease precision.</p>

<p>Both of these are problems of <em>precision</em>.</p>

<p>Let's take a look at <a href="https://nominatim.openstreetmap.org/reverse?lat=51.476845&amp;lon=-0.295296&amp;format=jsonv2">how one of the reverse geocoding services</a> deals with transforming <code>51.476845,-0.295296</code> into an address:</p>

<blockquote><p>Royal Botanic Gardens, Kew, Sandycombe Road, Kew, London Borough of Richmond upon Thames, London, Greater London, England, TW9 2EN, United Kingdom</p></blockquote>

<p><strong>That is <em>too much</em> address!</strong></p>

<p>Yes, it is technically accurate. But it contains far too much detail for humans, the postcode is irrelevant, and the weird-subdivisions are nothing that a local person would use.</p>

<p>Looking at the full API response, we can see:</p>

<pre><code class="language-json">{
  "place_id": 258770727,
  "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
  "name": "Royal Botanic Gardens, Kew",
  "display_name": "Royal Botanic Gardens, Kew, Elizabeth Cottages, Kew, London Borough of Richmond upon Thames, London, Greater London, England, TW9 3NJ, United Kingdom",
  "address": {
    "leisure": "Royal Botanic Gardens, Kew",
    "road": "Elizabeth Cottages",
    "suburb": "Kew",
    "city_district": "London Borough of Richmond upon Thames",
    "ISO3166-2-lvl8": "GB-RIC",
    "city": "London",
    "state_district": "Greater London",
    "state": "England",
    "ISO3166-2-lvl4": "GB-ENG",
    "postcode": "TW9 3NJ",
    "country": "United Kingdom",
    "country_code": "gb"
  }
}
</code></pre>

<p>Aha! Perhaps I can build a better address using just those components!</p>

<p>Except… Not every country has states. And not all states are used when giving addresses. Not every location is in a city. Some places have villages, prefectures, municipalities, and hamlets.</p>

<p>New York, New York is a valid address, but <a href="https://blog.opencagedata.com/post/99059889253/good-looking-addresses-solving-the-berlin-berlin">Berlin, Berlin</a> is not!</p>

<p>There's an <a href="https://github.com/OpenCageData/address-formatting">address formatter by OpenCage</a> which is pretty sensible about stripping off irrelevant details. But, to go back to my first point, not every map location on OpenBenches is a street address and - even if it is on a street - it probably shouldn't have a house number.</p>

<p>Well, there's kind of a solution to that! Most mapping provider have a <abbr title="Point of Interest">POI</abbr> function - we can find nearby things of interest and use them as a location.</p>

<p>Here's a <a href="https://openbenches.org/bench/36734">bench in Cook County, Illinois, USA</a>. The POI address is:</p>

<pre><code class="language-json">{
…
   "name": "Central Park",
   "coarse_location": "Des Plaines, IL, USA",
…
}
</code></pre>

<p>I <em>assume</em> there's only one Central Park in Des Plaines. Do people know that "Il" is Illinois? Would "Cook County" be useful?</p>

<p>On the subject of localisation, not everywhere speaks English. Do I want to display addresses like "<span lang="ja">原爆の子の像, 広島, 日本</span>"? How about "原爆の子の像, Hiroshima, Japan"?</p>

<p>We're an international site, but most benches are in Anglophone countries.</p>

<p>Of course, just because something is <em>physically</em> near a POI, that doesn't mean it is <em>logically</em> close to it.</p>

<p>Consider a bench situated <a href="https://www.openstreetmap.org/query?lat=50.580682&amp;lon=-3.467831">at the edge of this park</a>
<img src="https://shkspr.mobi/blog/wp-content/uploads/2025/04/map.webp" alt="A map, with a marker situated just across a river." width="1328" height="1060" class="aligncenter size-full wp-image-59864"></p>

<p>The nearest POI is "Gay's Creamery" - across the river. Is that what you'd expect?  Is there any way to easily say "if a point is <em>inside</em> an amenity* then use that as the address?</p>

<p>I don't want the users of our site to have to select from a list of POIs or addresses, this should be as automated as possible.</p>

<h2 id="the-plan"><a href="https://shkspr.mobi/blog/2025/04/reverse-geocoding-is-hard/#the-plan">The Plan</a></h2>

<p>For each bench:</p>

<ol>
<li>Use StadiaMaps to get the nearest POI.</li>
<li>Get the data in English.</li>
<li>Concatenate the name and coarse location.</li>
<li>Save the "address".</li>
<li>Wait for complaints?</li>
</ol>

<p>Thoughts?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=59857&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2025/04/reverse-geocoding-is-hard/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Rebuilding FourSquare for ActivityPub using OpenStreetMap]]></title>
		<link>https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/</link>
					<comments>https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 27 Jan 2024 12:34:55 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[ActivityPub]]></category>
		<category><![CDATA[fediverse]]></category>
		<category><![CDATA[FourSquare]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[OpenStreetMap]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=49432</guid>

					<description><![CDATA[I used to like the original FourSquare. The &#34;mayor&#34; stuff was a bit silly, and my friends never left that many reviews, but I loved being able to signal to my friends &#34;I am at this cool museum&#34; or &#34;We&#039;re at this pub if you want to meet&#34; or &#34;Spending the day at the park&#34;.  So, is there a way to recreate that early Web 2.0 experience with open data and ActivityPub? Let&#039;s find out!  This quest is…]]></description>
										<content:encoded><![CDATA[<p>I used to like the original FourSquare. The "mayor" stuff was a bit silly, and my friends never left that many reviews, but I loved being able to signal to my friends "I am at this cool museum" or "We're at this pub if you want to meet" or "Spending the day at the park".</p>

<p>So, is there a way to recreate that early Web 2.0 experience with open data and ActivityPub? Let's find out!</p>

<p>This quest is divided into two parts.</p>

<ol>
<li>Get nearby "Points of Interest" (POI) from OpenStreetMap.</li>
<li>Share a location on the Fediverse.</li>
</ol>

<h2 id="openstreetmap-api"><a href="https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/#openstreetmap-api">OpenStreetMap API</a></h2>

<p>OpenStreetMap is the Wikipedia of maps. It is a freely available resource which anyone can edit (if they're skilled enough).</p>

<p>It also comes with a pretty decent API for querying things.  For example, <a href="https://overpass-turbo.eu/s/1GaE"><code>nw["amenity"]({{bbox}});</code> finds all "amenities" near a specific location</a>.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2024/01/amenities-fs8.png" alt="Map of a part of London. Some parts are highlighted." width="826" height="504" class="aligncenter size-full wp-image-49441">

<p>As you can see, it has highlighted <em>some</em> useful areas - a pharmacy and a pub. But it has <em>ignored</em> other useful locations - the train station and the park. It has also included some things that we may not want - bike parking and a taxi rank.</p>

<p>What API call is needed to get <em>useful</em> locations of of OverPass?</p>

<p>It's possible to specify the <em>type</em> of thing to find using <code>nw["amenity"="restaurant"];</code> - but adding every single type of thing would quickly end up with a very large query containing hundreds of types.</p>

<p>It is also possible to <em>exclude</em> specific types of places. This retrieves all amenities except for fast food joints:</p>

<pre><code class="language-_">nw["amenity"]({{bbox}});
-
nw["amenity"="fast_food"]({{bbox}});
</code></pre>

<p>Again, that would be complex.</p>

<p>Perhaps one solution is just to return <em>everything</em> and let the user decide if they want to check in to a telephone kiosk or a fire hydrant?  That's a bit user-hostile.</p>

<p>Instead, <a href="https://overpass-turbo.eu/s/1GaP">this query returns everything which has a name</a> <code>nw["name"]({{bbox}});</code></p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2024/01/names-fs8.png" alt="Map of London with several bits highlighted." width="826" height="504" class="aligncenter size-full wp-image-49442">

<p>That cuts out any unnamed things - like park benches and car-sharing spots. But it does add named roads and train lines.</p>

<p>It is possible to <a href="https://osm-queries.ldodds.com/tutorial/05-nodes-combined-filter.osm.html">use filters to exclude results from OverPass</a>. The best that I can come up with is: <a href="https://overpass-turbo.eu/s/1GaR"><code>nw["name"][!"highway"][!"railway"][!"waterway"][!"power"]({{bbox}});</code></a></p>

<p>That gets everything which has a name, but isn't a highway or railway or waterway or powerline. It isn't perfect - but it will do!</p>

<p>This is the query which will retrieve the 25 nearest things within 100 metres of a specific latitude and longitude. It includes the name and any other tags, the location, and the OSM ID.</p>

<p><a href="https://overpass-api.de/api/interpreter?data=[out:json];nw%5B%22name%22%5D%5B%21%22highway%22%5D%5B%21%22railway%22%5D%5B%21%22waterway%22%5D%5B%21%22power%22%5D(around:100,51.5202,-0.1040);out%20center%20qt%2025;"><code>overpass-api.de/api/interpreter?data=[out:json];nw["name"][!"highway"][!"railway"][!"waterway"][!"power"](around:100,51.5202,-0.1040);out center qt 25;</code></a></p>

<h2 id="activitypub"><a href="https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/#activitypub">ActivityPub</a></h2>

<p>There's good news and bad news here. Firstly, ActivityStreams (which are subscribed to in ActivityPub) <a href="https://www.w3.org/TR/activitystreams-vocabulary/#places">supports the concept of "Place"</a> and <a href="https://www.w3.org/ns/activitystreams#location">"Location"</a>.</p>

<p>Once the user has a latitude and longitude, the can share it - along with a message, photo, or anything else.</p>

<p>Something like:</p>

<pre><code class="language-json">{
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Note",
    "content": "Here in NYC! &lt;a href=\"https://www.openstreetmap.org/way/958999496\"&gt;John Lennon's Imagine Mosaic&lt;/a&gt;.",
    "attachment": [
        {
            "type": "Image",
            "mediaType": "image\/jpeg",
            "url": "https:\/\/fastly.4sqi.net\/img\/general\/590x786\/56367_9pxuZJD7d1hgPdaMFcFq1pipvTTMynBJsYcpHH-b8mU.jpg",
            "name": "A photo of a mosaic which says 'Imagine'."
        }
    ],
    "location": {
        "name": "John Lennon's Imagine",
        "type": "Place",
        "longitude": 40.77563,
        "latitude": -73.97474
    }
}
</code></pre>

<p>For example, here's <a href="https://pixelfed.social/p/dansup/75783646421848064?fs=1">a PixelFed post with an attached location</a> - and this is the <a href="https://pixelfed.social/p/dansup/75783646421848064.json">JSON representation</a>. That status can be reposted into other social networks.</p>

<p>It is worth noting that Mastodon doesn't (natively) support location - if you <a href="https://mastodon.social/@Edent/100581317169164202">view my repost of that PixelFed post</a> you'll see there's no location metadata attached. That's OK! It just means that the status needs to include human-readable data.</p>

<p>Similarly, Mastodon doesn't support the <a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-arrive"><code>arrive</code></a> vocabulary. So this will be limited to a message with a location attached.</p>

<p><a href="https://benjojo.co.uk/u/benjojo/h/5j4yjq8JbrKY6Vp79K">Other ActivityPub services <em>do</em> support location</a>.</p>

<h2 id="putting-it-all-together"><a href="https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/#putting-it-all-together">Putting it all together</a></h2>

<p>Well… that's a job for next week. Probably!</p>

<ul>
<li>Building a web site which gets the user's location is easy.</li>
<li>Getting the data from OverPass should be straightforward.</li>
<li>Creating an ActivityPub server which can post geotagged notes into the Fediverse might be a little beyond my skillset!  Some testing with <a href="https://tinysubversions.com/notes/activitypub-tool/">Darius Kazemi's AP Glitch</a> suggests this should work.</li>
</ul>

<p>If you'd like to help, please leave a comment.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=49432&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/feed/</wfw:commentRss>
			<slash:comments>30</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Mobile Badvertising: Peugeot]]></title>
		<link>https://shkspr.mobi/blog/2010/08/mobile-badvertising-peugeot/</link>
					<comments>https://shkspr.mobi/blog/2010/08/mobile-badvertising-peugeot/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 27 Aug 2010 09:02:54 +0000</pubDate>
				<category><![CDATA[badvertising]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[peugeot]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=2415</guid>

					<description><![CDATA[Peugeot&#039;s new mobile advert has a couple of critical flaws - but has just enough innovation to redeem it in my eyes.  Read on to find the two basic mistakes they made, how to solve them, and the cool feature you should be incorporating into your adverts.   Clicking on the advert takes you onto a fairly swish looking landing page.  There are some clear calls-to-action, and some attractive…]]></description>
										<content:encoded><![CDATA[<img class="aligncenter size-full wp-image-2417" title="advert" src="https://shkspr.mobi/blog/wp-content/uploads/2010/08/advert.gif" alt="Peugeot Advert" width="480" height="75">

<p>Peugeot's new mobile advert has a couple of critical flaws - but has just enough innovation to redeem it in my eyes.  Read on to find the two basic mistakes they made, how to solve them, and the cool feature you should be incorporating into your adverts.
<span id="more-2415"></span></p>

<p>Clicking on the advert takes you onto a fairly swish looking landing page.  There are some clear calls-to-action, and some attractive graphics.</p>

<p><a href="https://shkspr.mobi/blog/wp-content/uploads/2010/08/snap20100826_105816.png"><img class="aligncenter size-full wp-image-2423" title="snap20100826_105816" src="https://shkspr.mobi/blog/wp-content/uploads/2010/08/snap20100826_105816.png" alt="Landing Page" width="480" height="800"></a></p>

<p>I find the text a little hard to read.  Let's zoom in.</p>

<p><a href="https://shkspr.mobi/blog/wp-content/uploads/2010/08/snap20100826_105822.png"><img class="aligncenter size-full wp-image-2424" title="snap20100826_105822" src="https://shkspr.mobi/blog/wp-content/uploads/2010/08/snap20100826_105822.png" alt="Zoomed in image text" width="480" height="800"></a></p>

<p>Yikes!  The whole site is an image!  This is incredibly bad practice for several reasons.</p>

<ul>
    <li>The page weight will be excessive.  This means your site will be slow to load and possibly cost your customers more to access it.</li>
    <li>Inability to zoom in.  With some smartphones like the X10mini having tiny screen, you need to consider how your site will look over a wide range of devices.</li>
    <li>SEO.  Search engines can't read images.  Plain text will ensure your site is spidered.</li>
    <li>Reflowing - what happens when the user rotates the screen?  Your image won't scale and reflow as well as text.</li>
    <li>Updating.  If you need to update the site, you'll have to edit a series of images - one for each screen size.  With text, one change and you're done.</li>
</ul>

<h2 id="in-praise-of"><a href="https://shkspr.mobi/blog/2010/08/mobile-badvertising-peugeot/#in-praise-of">In Praise of...</a></h2>

<p>The usual "Find A Dealer" service asks the user to type in their postcode or some other location based detail.  I'm very pleased to say that Peugeot goes one step beyond this.  They take advantage of the geo-location api of the phone so that the user doesn't have to do any extra work.  Brilliant.
<img class="aligncenter size-full wp-image-2419" title="snap20100826_105923" src="https://shkspr.mobi/blog/wp-content/uploads/2010/08/snap20100826_105923.png" alt="Location API in use" width="480" height="800">
This is a great use of the technology.  Let computers do what they do best and reduce the need of your user to type data in.
You can use a <a href="http://code.google.com/p/geo-location-javascript/wiki/SupportedPlatforms">cross-platform geo-location solution like Google Gears</a> to detect your users' location.</p>

<p>Ideally, the domain name should be that of the product.&nbsp; The user probably doesn't know who "sevenal-fit.com" are - but they would recognise "peugeot.com".</p>

<h2 id="text-effects"><a href="https://shkspr.mobi/blog/2010/08/mobile-badvertising-peugeot/#text-effects">Text Effects</a></h2>

<p>This is the final fly in the ointment.
Is this piece of text a link?  <span style="text-decoration: underline;">How about this one</span>?  <span style="color: #0000ff;"><span style="text-decoration: underline;">What about this</span></span>?</p>

<p>By convention - and good usability practice - links are styled differently than regular text.&nbsp; Usually by underlining or displaying in a different colour.&nbsp; It helps the user see what actions they can take on a page.&nbsp; Have a look at this results page and see if you can tell what you can click on.</p>

<p><a href="https://shkspr.mobi/blog/wp-content/uploads/2010/08/results.png"><img class="aligncenter size-medium wp-image-2416" title="results" src="https://shkspr.mobi/blog/wp-content/uploads/2010/08/results-180x300.png" alt="Results Page" width="180" height="300"></a></p>

<p>Not very intuitive - is it?&nbsp; It looks like a list of results with no further information.</p>

<p>As it happens, you <em>can</em> click on the dealer names.</p>

<p><a href="https://shkspr.mobi/blog/wp-content/uploads/2010/08/click-to-call.png"><img class="aligncenter size-medium wp-image-2418" title="click to call" src="https://shkspr.mobi/blog/wp-content/uploads/2010/08/click-to-call-180x300.png" alt="No text decoration" width="180" height="300"></a>Again, there's no text decoration.&nbsp; While it's good that they've used click-to-call for the phone numbers, there's no indication until you've placed your finger or cursor over the text that it's a link.</p>

<p>Don't make your users think.&nbsp; Clearly signpost the actions which are available to them.</p>

<p>It's also worth including a map of the area - or even directions from the user's current location.&nbsp; Remember, the end goal of this advert is to make someone buy a car.&nbsp; Make it as easy as possible for your users to go from advert to purchase.</p>

<h2 id="conclusion"><a href="https://shkspr.mobi/blog/2010/08/mobile-badvertising-peugeot/#conclusion">Conclusion</a></h2>

<p>Text is better than images.</p>

<p>Remember to decorate your text correctly.</p>

<p>Geo-location is awesome - but don't forget to display a map.</p>

<p>Finally, consider which domain name the users will see and if they will trust it to store their data securely.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=2415&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2010/08/mobile-badvertising-peugeot/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Mashed Up Maps]]></title>
		<link>https://shkspr.mobi/blog/2009/07/mashed-up-maps/</link>
					<comments>https://shkspr.mobi/blog/2009/07/mashed-up-maps/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 08 Jul 2009 11:20:38 +0000</pubDate>
				<category><![CDATA[voteuk]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[mashup]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=241</guid>

					<description><![CDATA[As part of my project to create a mobile polling station locator site, I&#039;ve been playing with various mapping APIs.  As a base experiment, I passed the postcode of a polling station (GU22 7DT) to both Google Maps and Yahoo Maps.  Here are the results.   -   Two things of interest to note.  Firstly, Google has a specific &#34;Mobile&#34; call in the API, it reformats the map image to be more readable on…]]></description>
										<content:encoded><![CDATA[<p>As part of my project to create a <a href="https://shkspr.mobi/blog/2009/07/getting-people-to-the-polling-station/">mobile polling station locator</a> site, I've been playing with various mapping APIs.</p>

<p>As a base experiment, I passed the postcode of a polling station (GU22 7DT) to both Google Maps and Yahoo Maps.  Here are the results.</p>

<p><img class="size-full wp-image-243" title="ymaps1" src="https://shkspr.mobi/blog/wp-content/uploads/2009/07/ymaps1.gif" alt="Yahoo! Maps" width="240" height="240"> - <img class="size-full wp-image-244" title="gmaps1" src="https://shkspr.mobi/blog/wp-content/uploads/2009/07/gmaps1.gif" alt="Google Maps" width="240" height="240"></p>

<p>Two things of interest to note.</p>

<p>Firstly, Google has a specific "Mobile" call in the API, it reformats the map image to be more readable on the mobile - I think you'll agree that Google edges out Yahoo here.</p>

<p>Secondly, Google maps is <em>less accurate</em> than Yahoo! Maps.  Severely so.  While maps.google.com is highly accurate when passed a postcode, the API seems only to look at the first part and discard the rest.  Yahoo on the other hand is unnervingly precise.</p>

<p>What to do?  Well, as all the cool kids are doing, let's have ourselves a mashup!</p>

<p>We can call Yahoo Maps to get the Latitude and Longitude of a postcode thusly
<code>http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&amp;zip=gu227dt&amp;state=uk</code>
This will return
<code>&lt;Latitude&gt;51.318691&lt;/Latitude&gt;</code>
<code>&lt;Longitude&gt;-0.543540&lt;/Longitude&gt;</code>
<code>&lt;Address/&gt;</code>
<code>&lt;City&gt;Woking, GU22 7DT&lt;/City&gt;</code>
<code>&lt;State&gt;United Kingdom&lt;/State&gt;</code>
<code>&lt;Country&gt;GB&lt;/Country&gt;</code>
We take the Latitude and Longitude and pass it to Google Maps like so
<code>http://maps.google.com/staticmap?center=<span style="color: #ff0000;">$lat</span>,<span style="color: #ff0000;">$long</span>&amp;markers=<span style="color: #ff0000;">$lat</span>,<span style="color: #ff0000;">$long</span>,tiny&amp;zoom=14&amp;size=240x240&amp;maptype=mobile&amp;key=&amp;sensor=false</code>
Which nets us this map.</p>

<p></p><div id="attachment_242" style="width: 250px" class="wp-caption alignnone"><img aria-describedby="caption-attachment-242" class="size-full wp-image-242" title="gmap2" src="https://shkspr.mobi/blog/wp-content/uploads/2009/07/gmap2.gif" alt="Google Map from Yahoo Geo Location" width="240" height="240"><p id="caption-attachment-242" class="wp-caption-text">Google Map from Yahoo Geo Location</p></div><p></p>

<p>Hey presto! Better looking than the Yahoo Map and better accuracy than the Google Map.</p>

<p>The geocoding prescision of the Google Maps API is very poor for UK postcodes.  There really shouldn't need to be this need sort of work around.</p>

<p>This is the sort of data that the UK government should be providing.  The <a href="https://web.archive.org/web/20090609045317/https://openspace.ordnancesurvey.co.uk/openspace/support.html">Ordnance Survey have an API</a> but it seems restricted to JavaScript which isn't very useful for most mobile phones.  Nevertheless I'll have a play with it and see if it's more useful.</p>

<p><em>Edit</em></p>

<p id="line1">I am now using <a href="https://web.archive.org/web/20140208154955/http://ernestmarples.com/blog/">Ernest Marples' Postcode Latitude/Longitude Lookup API </a>which has much greater accuracy than either Google or Yahoo.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=241&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2009/07/mashed-up-maps/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
