SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
FUN WITH MAPS & PHP
Chris Shiflett — @shiflett — shiflett.org
Web aficionado, author, blogger, soccer player, bike
Who am I?   rider, beer drinker, music lover, Brooklynite.
0. Landice




   Dettifoss
TRAVELOG

Tag everything
– #landice


Blog
– every night


Timeline Visualizations
– maps?


A!regate and Plot
– photos, tweets, videos, etc.
1. Research




   Sjónarsker
EXISTING TOOLS

GPS
– Garmin GPS 60CSx


GPSBabel
– gpsbabel.org


EveryTrail
– everytrail.com


HoudahGeo
– houdah.com/houdahGeo/
2. Reykjavík




    Stóra-Víti
3. Photos




  Kirkjufell
<?xml version="1.0" encoding="UTF-8"?>
<gpx
  version="1.0"
  creator="GPSBabel - http://gpsbabel.org/"
  xmlns:xsi="http://w3.org/2001/XMLSchema-instance"
  xmlns="http://topografix.com/GPX/1/0"
  xsi:schemaLocation="http://topografix.com/GPX/1/0
                       http://topografix.com/GPX/1/0/gpx.xsd">
<time>2009-06-14T23:52:23Z</time>
<bounds minlat="64.143006038" minlon="-21.955686333"
maxlat="64.153455254" maxlon="-21.915427381"/>
<trk>
  <name>14-JUN-09 01</name>
<number>1</number>
<trkseg>
<trkpt lat="64.150910676" lon="-21.946594650">
  <ele>13.115112</ele>
  <time>2009-06-14T21:01:25Z</time>
</trkpt>
<trkpt lat="64.150785115" lon="-21.945423950">
  <ele>13.595825</ele>
  <time>2009-06-14T21:02:08Z</time>
</trkpt>
</trkseg>
</trk>
</gpx>
PARSING GPX
$xml = simplexml_load_file('trip.gpx');

foreach($xml->trk as $part) {
    foreach ($part->trkseg->trkpt as $point) {
        /*
        $point['lat']
        $point['lon']
        $point->time
        $point->ele
        */
    }
}
4. Maps




 Bláa lónið
Garmin GPS 60CSx               Nikon D300




                   HoudahGeo
EVERYTRAIL
$query = $db->prepare("SELECT     lat, lon
                       FROM       points
                       WHERE      timestamp > '$start'
                       AND        timestamp < '$end'
                       ORDER BY   timestamp");
$query->execute();

$points = array();

while ($row = $query->fetch()) {
    $points[] = array('lat' => $row['lat'],
                      'lon' => $row['lon']);
}

$trip['points'] = $points;
$json = json_encode($trip);
file_put_contents("/tmp/landice-$day.json", $json);
// FIXME: http://tr.im/selectclosest
$sql = "SELECT   lat, lon, elevation,
                 ABS(timestamp - :timestamp) as distance
        FROM     points
        ORDER BY distance
        LIMIT    1"
$select = $this->db->prepare($sql);
 
foreach ($this->photos as $photo) {
    $id = (string)$photo['id'];
 
    // Get lat and lon from points table.
    $select->execute(array('timestamp' => $photo['timestamp']));
    $row = $select->fetch();
    $this->photos[$id]['lat'] = $row['lat'];
    $this->photos[$id]['lon'] = $row['lon'];
    $this->photos[$id]['elevation'] = $row['elevation'];
}
FLICKR API

$flickrMethod = 'flickr.photos.getInfo';
$apiUrl = "http://api.flickr.com/services/rest/?
method={$flickrMethod}&api_key={$this->apiKey}&photo_id={$id}";
$xml = simplexml_load_file($apiUrl);
 
$title = (string)$xml->photo->title;
$desc = (string)$xml->photo->description;
Google Maps   OpenStreetMaps
5. Challenges




   Stykkishólmur
CLUSTERS
PERFORMANCE


20,000 points loaded on a
single map is very slow

You don’t need a# points
for every view

Mature solutions exist
–http://tr.im/polyline
6. Storytelling




     Reykjavík
7. Future




   Tjörnin
TRAILS




GPX Tracking
GEOLOCATION API




 http://mozi#a.com/en-US/firefox/geolocation/
  http://dev.w3.org/geo/api/spec-source.html
Click here
FEEDBACK?


Fo#ow me on Twitter
– @shiflett


Comment on my blog
– shiflett.org


Email me
– chris@shiflett.org
Thanks for listening!




Chris Shiflett — @shiflett — shiflett.org

Mais conteúdo relacionado

Destaque

OpenWrt Case Study 2008
OpenWrt Case Study 2008OpenWrt Case Study 2008
OpenWrt Case Study 2008Rex Tsai
 
遺失的時代精神 - Zeitgeist and GNOME Activity Journal
遺失的時代精神 - Zeitgeist and GNOME Activity Journal遺失的時代精神 - Zeitgeist and GNOME Activity Journal
遺失的時代精神 - Zeitgeist and GNOME Activity JournalRex Tsai
 
Get your FLOSS problems solved
Get your FLOSS problems solvedGet your FLOSS problems solved
Get your FLOSS problems solvedRex Tsai
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web SecurityChris Shiflett
 
Building a developer community with containers
Building a developer community with containersBuilding a developer community with containers
Building a developer community with containersRex Tsai
 
Sistem pencegah kebakaran
Sistem pencegah kebakaranSistem pencegah kebakaran
Sistem pencegah kebakaranUTHM
 

Destaque (6)

OpenWrt Case Study 2008
OpenWrt Case Study 2008OpenWrt Case Study 2008
OpenWrt Case Study 2008
 
遺失的時代精神 - Zeitgeist and GNOME Activity Journal
遺失的時代精神 - Zeitgeist and GNOME Activity Journal遺失的時代精神 - Zeitgeist and GNOME Activity Journal
遺失的時代精神 - Zeitgeist and GNOME Activity Journal
 
Get your FLOSS problems solved
Get your FLOSS problems solvedGet your FLOSS problems solved
Get your FLOSS problems solved
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web Security
 
Building a developer community with containers
Building a developer community with containersBuilding a developer community with containers
Building a developer community with containers
 
Sistem pencegah kebakaran
Sistem pencegah kebakaranSistem pencegah kebakaran
Sistem pencegah kebakaran
 

Semelhante a Fun with Maps and PHP

Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
 
Keeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkKeeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkJeremy Kendall
 
GeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri ProjectGeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri ProjectKentaro Ishimaru
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkJeremy Kendall
 
Geo distance search with my sql presentation
Geo distance search with my sql presentationGeo distance search with my sql presentation
Geo distance search with my sql presentationGSMboy
 
OSCON july 2011
OSCON july 2011OSCON july 2011
OSCON july 2011chelm
 
Всеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.jsВсеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.jsYandex
 
Keeping It Small with Slim
Keeping It Small with SlimKeeping It Small with Slim
Keeping It Small with SlimRaven Tools
 
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiMonitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiInfluxData
 
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016Luigi Dell'Aquila
 
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011John Ford
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony TechniquesKris Wallsmith
 
Das Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based ServicesDas Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based ServicesStephan Schmidt
 
Where20 2008 Ruby Tutorial
Where20 2008 Ruby TutorialWhere20 2008 Ruby Tutorial
Where20 2008 Ruby TutorialShoaib Burq
 

Semelhante a Fun with Maps and PHP (20)

Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
Keeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro FrameworkKeeping it Small: Getting to know the Slim Micro Framework
Keeping it Small: Getting to know the Slim Micro Framework
 
Where in the world
Where in the worldWhere in the world
Where in the world
 
app.js.docx
app.js.docxapp.js.docx
app.js.docx
 
GeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri ProjectGeoTechTalk InkSatogaeri Project
GeoTechTalk InkSatogaeri Project
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro framework
 
Sample document
Sample documentSample document
Sample document
 
Geo distance search with my sql presentation
Geo distance search with my sql presentationGeo distance search with my sql presentation
Geo distance search with my sql presentation
 
OSCON july 2011
OSCON july 2011OSCON july 2011
OSCON july 2011
 
Всеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.jsВсеволод Струкчинский: Node.js
Всеволод Струкчинский: Node.js
 
Keeping It Small with Slim
Keeping It Small with SlimKeeping It Small with Slim
Keeping It Small with Slim
 
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiMonitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
 
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
Das Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based ServicesDas Web Wird Mobil - Geolocation und Location Based Services
Das Web Wird Mobil - Geolocation und Location Based Services
 
Where20 2008 Ruby Tutorial
Where20 2008 Ruby TutorialWhere20 2008 Ruby Tutorial
Where20 2008 Ruby Tutorial
 
Php
PhpPhp
Php
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Fun with Maps and PHP

  • 1. FUN WITH MAPS & PHP Chris Shiflett — @shiflett — shiflett.org
  • 2. Web aficionado, author, blogger, soccer player, bike Who am I? rider, beer drinker, music lover, Brooklynite.
  • 3. 0. Landice Dettifoss
  • 4. TRAVELOG Tag everything – #landice Blog – every night Timeline Visualizations – maps? A!regate and Plot – photos, tweets, videos, etc.
  • 5. 1. Research Sjónarsker
  • 6. EXISTING TOOLS GPS – Garmin GPS 60CSx GPSBabel – gpsbabel.org EveryTrail – everytrail.com HoudahGeo – houdah.com/houdahGeo/
  • 7. 2. Reykjavík Stóra-Víti
  • 8.
  • 9.
  • 10.
  • 11. 3. Photos Kirkjufell
  • 12. <?xml version="1.0" encoding="UTF-8"?> <gpx version="1.0" creator="GPSBabel - http://gpsbabel.org/" xmlns:xsi="http://w3.org/2001/XMLSchema-instance" xmlns="http://topografix.com/GPX/1/0" xsi:schemaLocation="http://topografix.com/GPX/1/0 http://topografix.com/GPX/1/0/gpx.xsd"> <time>2009-06-14T23:52:23Z</time> <bounds minlat="64.143006038" minlon="-21.955686333" maxlat="64.153455254" maxlon="-21.915427381"/> <trk> <name>14-JUN-09 01</name> <number>1</number> <trkseg> <trkpt lat="64.150910676" lon="-21.946594650"> <ele>13.115112</ele> <time>2009-06-14T21:01:25Z</time> </trkpt> <trkpt lat="64.150785115" lon="-21.945423950"> <ele>13.595825</ele> <time>2009-06-14T21:02:08Z</time> </trkpt> </trkseg> </trk> </gpx>
  • 13. PARSING GPX $xml = simplexml_load_file('trip.gpx'); foreach($xml->trk as $part) { foreach ($part->trkseg->trkpt as $point) { /* $point['lat'] $point['lon'] $point->time $point->ele */ } }
  • 14.
  • 15. 4. Maps Bláa lónið
  • 16. Garmin GPS 60CSx Nikon D300 HoudahGeo
  • 18.
  • 19. $query = $db->prepare("SELECT lat, lon FROM points WHERE timestamp > '$start' AND timestamp < '$end' ORDER BY timestamp"); $query->execute(); $points = array(); while ($row = $query->fetch()) { $points[] = array('lat' => $row['lat'], 'lon' => $row['lon']); } $trip['points'] = $points; $json = json_encode($trip); file_put_contents("/tmp/landice-$day.json", $json);
  • 20. // FIXME: http://tr.im/selectclosest $sql = "SELECT lat, lon, elevation, ABS(timestamp - :timestamp) as distance FROM points ORDER BY distance LIMIT 1" $select = $this->db->prepare($sql);   foreach ($this->photos as $photo) { $id = (string)$photo['id'];   // Get lat and lon from points table. $select->execute(array('timestamp' => $photo['timestamp'])); $row = $select->fetch(); $this->photos[$id]['lat'] = $row['lat']; $this->photos[$id]['lon'] = $row['lon']; $this->photos[$id]['elevation'] = $row['elevation']; }
  • 21. FLICKR API $flickrMethod = 'flickr.photos.getInfo'; $apiUrl = "http://api.flickr.com/services/rest/? method={$flickrMethod}&api_key={$this->apiKey}&photo_id={$id}"; $xml = simplexml_load_file($apiUrl);   $title = (string)$xml->photo->title; $desc = (string)$xml->photo->description;
  • 22.
  • 23. Google Maps OpenStreetMaps
  • 24. 5. Challenges Stykkishólmur
  • 25.
  • 27. PERFORMANCE 20,000 points loaded on a single map is very slow You don’t need a# points for every view Mature solutions exist –http://tr.im/polyline
  • 28. 6. Storytelling Reykjavík
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. 7. Future Tjörnin
  • 35. GEOLOCATION API http://mozi#a.com/en-US/firefox/geolocation/ http://dev.w3.org/geo/api/spec-source.html
  • 37.
  • 38. FEEDBACK? Fo#ow me on Twitter – @shiflett Comment on my blog – shiflett.org Email me – chris@shiflett.org
  • 39. Thanks for listening! Chris Shiflett — @shiflett — shiflett.org