SlideShare una empresa de Scribd logo
1 de 39
Descargar para leer sin conexión
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

Más contenido relacionado

Destacado

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
 

Destacado (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
 

Similar 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
 

Similar 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

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

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