Skip to main content

Posts

Showing posts from June, 2014

Testing real-time mapping on Sjernarøyane archipelago

I was quite happy with the real-time map from the hike to Preikestolen yesterday. There were some issues with the SPOT Satellite Messenger I'll write about later. First I want to make a second test on a biking trip to Sjernarøyane archipelago. We'll bring a normal GPS on the trip, to be able to check the accuracy of the SPOT Satellite Messenger. [ Fullscreen map ] We'll start biking about 9:15 am (Central European Summer Time) Sunday June 15th. New positions should appear on the map as we bike (every 5 minutes), but you still need to refresh the page to get new Instagram photos. Update: Test results I'm much more satisfied with the performance of my SPOT Satellite Messenger on this trip. I brought with me a Garmin GPS to get the full track of the biking trip, and it's shown as a blue line on the map. The track shows an overlap between the SPOT positions and the Garmin GPS. Automatically retrieving place name, terrain type, altitude and weath...

Testing my real-time expedition map to Preikestolen

In my previous blog posts, I've worked on the various parts of an expedition map that I plan to use on a 4-weeks hike between Oslo in Bergen . Now I'm ready for a test run. Tomorrow Friday, I'm leaving the island for a hike up to Preikestolen . From one of my previous trips to Preikestolen.  It's a short but scenic hike, just 4 km each way. It should be sufficient to test if the various parts of the my live tracking map: Showing real-time positions from my SPOT Satellite Messenger . Show the altitude and placename for each position, using an external API .  Showing the weather at each position, fetched from api.yr.no .  Showing Instagram photos and videos as we walk .  If you have nothing smart to do, and if everything works, you can follow us on this map from around 11 AM tomorrow (Central European Summer Time), Friday June 13th.  [ Fullscreen map ] New positions should appear on the map as we walk (every 5 minutes), but you need to refr...

Showing Instagram photos and videos on a Leaflet map

I've created a new plugin, Leaflet.Instagram , that allows you to add Instagram photos and videos to your maps. You can load photos with the Instagram API or from CartoDB . You can choose to show your images in a popup or a lightbox. The small images on the map can be clustered.  The plugin is very easy to use: L.instagram('https://api.instagram.com/v1/users/209969753/media/recent?access_token= your_access_token ').addTo(map); Just add the url and endpoint to the Leaflet API together with your access token . If you don't want to expose you're access token, I suggest that you create a proxy or sync your data with CartoDB . The plugin has built-in support for CartoDB: L.instagram('http://turban.cartodb.com/api/v2/sql?q=SELECT * FROM instagram WHERE the_geom && ST_SetSRID(ST_MakeBox2D(ST_Point(5.952, 59.329), ST_Point(5.982, 59.342)), 4326)').addTo(map);  Using CartoDB has the added benefit of allowing a wide range of spatial queri...

Syncing your Instagram photos to CartoDB

I really want to show photos on my expedition map . Instead of creating my own photo service, I want to use a service that already support geotagged photos, Instagram . To get more control, I'm syncing the metadata for my photos and videos to my CartoDB -account using the Instagram API . CartoDB-map showing Instagram photos. Please read the API Terms of Use before you start doing this. You shall not "cache or store any User Content other than for reasonable periods in order to provide the service you are providing to Instagram users" . Here I'm only syncing textual data from my own user on Instagram. You can also show your Instagram photos on a map, using the Instagram API directly, as I will show in my next blog post.  I've created a PHP cron job, instagram2cartodb.php , that will sync my photos and videos to CartoDB: The script will read the latest images from an Instagram user using an access token. It also reads the latest timestamp from...

How is the weather at this latitude, longitude location?

In my last blog post , we saw how to find the name and altitude of a latitude, longitude location. Today, I want to see what the weather is like. In Norway, we have a great free weather service, yr.no , that also comes with an API (with world coverage!). I'm going to use it to log the weather on my expedition map . yr.no is a joint weather service from the Norwegian Meteorological Institute ( met.no ) and the Norwegian Broadcasting Corporation ( NRK ). yr.no is unique in Europe because of very detailed weather forecasts and a free data policy . I'm using the location forecast API  ( terms of use ), which returns the weather forecast for a latitude, longitude location: http://api.yr.no/weatherapi/locationforecast/1.9/?lat=59.33895;lon=5.96639 It returns an XML with a 9 days forecast starting from the current hour. I'm only logging the current time forecast for my expedition map. I know it's totally useless, but this is my SPOT logging my current location so...

Finding the name and altitude of your location

If you know the latitude and longitude a location, how can you get additional information about the place? There are a lot of APIs and web services that will tell you. This blog post focuses on a web service from the Norwegian Mapping Authority , which will give you the name, altitude and terrain type of your location. In my previous blog posts ( 1 , 2 , 3 , 4 ) I showed you how to use a SPOT Satellite Messenger to track your trips. This will give you a series of latitude and longitude points, and the time they where recorded, but that's about it. For my expedition map , I'm especially interested in the altitude of my location, which can be used to draw a height profile of the track. I would also like to show the name of the places I've been. Luckily, the Norwegian Mapping Authority ("Kartverket") provides such a service with a great level of detail. The service allows you to send in a latitude/longitude position, and obtain the altitude, nearest place name...

Real-time tracking with SPOT and Leaflet

I've created a new plugin, Leaflet.SpotTracker , that makes is super easy to add real-time tracking to your maps. The plugin displays tracking data directly from a SPOT Satellite Messenger , or from CartoDB . One line is enough if you're using the SPOT API : L.spotTracker('your_feed_id').addTo(map); This API has a request limit (500 requests within 15 minutes) and it will only fetch the last 50 messages from the last 7 days. I therefore recommend to sync your messages to CartoDB , or similar storage options. You can also load tracking data from CartoDB with the plugin: L.spotTracker('your_feed_id', {     api: 'http://turban.cartodb.com/api/v2/sql',     url: "{api}?q=SELECT * FROM spot WHERE feed_id='{feed}' ORDER BY timestamp" }).addTo(map); A few examples from my kayak trip around Foldøy island (it will work better for longer expeditions ): The plugin will draw a line between all locations recorded, and you can styl...

Real-time mapping of your trip with SPOT and CartoDB

In my last blog post , we saw how we could synchronize data from a SPOT unit to a CartoDB table. Today, I wanted to test if the system worked. As I'm currently staying on a small island, long hikes are very limited, so I decided to go around the island with my kayak. It takes me about an hour. GPS studies on a small island can be extremely hard :-) Before I started my journey, I created a new shared page on my SPOT account. I also adjusted the tracking interval on my SPOT to 5 minutes, which would give me about 12 locations around the island. The shared page need to be "Active" to have access to the location feed.  This gave me an URL to a public map (valid for 7 days only!):  http://share.findmespot.com/shared/faces/viewspots.jsp?glId=0pGqOT43h6tTRcGJujqltqRYE3rHNu6db It's not the best design I've seen, but it works. We'll soon create our own map.  The map URL also gave me the feed id: "0pGqOT43h6tTRcGJujqltqRYE3rHNu6db...

Syncing data from your SPOT Satellite Messenger to CartoDB

In my last blog post , we looked at how you can track your trips using the open API of the SPOT Satellite Messenger. A limitation is that you can only get your locations from the last 7 days, and the web service has request limits (500 request within 15 minutes). To avoid these limitations we can sync the data to a CartoDB account using a PHP cron job. CartoDB is a great choice as it allows us to both visualize and to query our tracking data. A cron job is a script on the server running periodically at fixed times, dates, or intervals. I've created my cron job in PHP, but you can choose the language you want. What you need is a server which allows to run scripts repeatedly. I'm using the  cron job support from my hosting provider, Bluehost . As I'm tracking my position every 10 minutes, the cron job is running at 10 minutes interval to sync the data. CartoDB is providing a simple PHP library to make use of the CartoDB API as easy as possible. The library allows us to...

Real-time satellite tracking for your expeditions

On my 4 week hike between Oslo and Bergen , I want to show my real-time location on a map. I could use an app on my mobile phone, but mobile coverage and electricity supply is sparse in the Norwegian mountains. Instead, I've acquired a satellite messenger which sends my location every 10 minutes. There are different providers of satellite messengers like DeLorme InReach and SPOT . Although InReach seems to have a better satellite coverage in Norway, I decided to buy a SPOT Gen3  because of the open data API . My plan is to match my own tracking data with other location services. The SPOT Gen3 has 5 buttons: Help button to alert my personal contacts that I need help in non-life-threatening situations.  S.O.S. button for emergencies only. Custom Message: Set up a message before leaving to send to contacts with my GPS location. Allow friends and family to follow my progress in near real-time. Check In: Let family and friends know I'm ok. I ho...

Expedition mapping - from Oslo to Bergen by foot

Nordryggen mountain range. Map from fjellkjeden.no . This is my first blog post in a new series about expedition mapping. I'm currently preparing for a 4 week hike from Oslo to Bergen in August this year. I'll start in my hometown Oslo and walk through the wooden lowlands surrounding the city, Nordmarka . Then I'm heading for the mountains that will take me all the way to Bergen. I'll be crossing Europes longest mountain range , recently named Nordryggen ("the north ridge").   Of course, maps will be important when preparing, while walking and to document the journey. I've started with a pile of good old paper maps to find the optimal route. I want to spend as much time as possible above the tree line, and it's clearly not the shortest route between the two cities. We have a great network of mountain trails and cabins in Norway, maintained by the Norwegian Trekking Association , and I'll use it's facilities when available.  I...