SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Processing 2.0
+ Open Data
@stevebattle
stevebattle.me
blog.stevebattle.me
processing.freeforums.org
Here’s the plan
1.Access Open Data (weather forecast)
2.Read JSON (JavaScript Object Notation)
3.Graphical widgets (ControlP5)
4.Upload App to mobile device
Access Open Data
• The Met Office have created DataPoint:
http://www.metoffice.gov.uk/datapoint
• Free registration here to get a key:
http://bit.ly/11ApBRT
• All resources have a base URL:
http://datapoint.metoffice.gov.uk/public/data/
• Add resource path and key parameter:
http://datapoint.metoffice.gov.uk/public/data/
RESOURCE?key=XXXX
• Five day forecast for Bristol:
http://datapoint.metoffice.gov.uk/public/data/
val/wxfcs/all/json/310004?res=daily&key=XXXX
• Save this sketch as ‘weather’
• Drag openjson.jar onto the PDE, see:
http://code.google.com/p/battle-bot/downloads/list
JSON http://www.json.org
• Objects {} containing string:value pairs
• Arrays [] of values
• Values can be objects, arrays, strings, numbers,
booleans, or null
{"Locations": {"Location": [
{
"id": "3094",
"name": "Rosehearty Samos",
"longitude": "-2.121",
"latitude": "57.698"
},
...
{
"id": "354552",
"name": "Perranuthnoe (Perran Sands) (Beach)",
"longitude": "-5.4411",
"latitude": "50.1121"
}
]}}
• Use a loop to search JSON for an
object named ‘Bristol’.
Get the five day forecast
{"SiteRep": {
"Wx": {"Param": [
{
"$": "Day Maximum Temperature",
"name": "Dm",
"units": "C"
}, ...
]},
"DV": {
"dataDate": "2013-08-02T21:00:00Z",
"Location": {
"Period": [
{
"value": "2013-08-02Z",
"type": "Day",
"Rep": [
{
"Dm": "24", ...
} ]
}, ... ]
}
"type": "Forecast"
}
}}
The five day forecast
Method chaining
Plan ahead with a sketch
Graphical Widgets
• Sketch > Import Library > Add Library
• Sketch > Import Library > ControlP5
import controlP5.*;
ListBox Widget
public void draw() {
background(255);
fill(0);
}
•Define locationID as global:
String locationID = "310004"; // Bristol
•Replace // Search for ‘Bristol’ code with:
initList(locations);
•Detect the List selection event
to assign locationID
Tab Widgets
• To make the siteList selection happen
before it gets the forecast we’ll put
them on different tabs.
• Move the forecasting code at the end
of setup() into its own function...
...and call the function when the
‘forecast’ tab is selected.
Chart Widget
• Instead of printing the forecast we’ll
plot the temperatures on a chart.
Chart chart;
Modify initForecast()
Upload App
A few minor tweaks are required to run
this as an Android App.
• Switch to ‘Android’ mode.
• You have to give the App permission to
use the internet:
Android > Sketch Permisions > Check INTERNET
App Mods
• Set the size() for the device:
size(displayWidth,displayHeight);
• Optionally change the orientation:
orientation(LANDSCAPE);
• The tab widgets are too small:
cp5.getTab(“default”).setWidth(200).setHeight(40);
cp5.getTab(“forecast”).setWidth(200).setHeight(40);
• The ListBox is too small. Double:
ItemHeight, BarHeight, ScrollBarWidth.
• The font is too small:
PFont pfont = createFont(“Ariel”,20,true);
cp5.setFont(new ControlFont(pfont,24));
Summary
• Decorating the Met Office weather
chart is left as an exercise for the
reader. See controlP5 javadoc:
<http://www.sojamo.de/libraries/controlP5/reference/>
• Try displaying other information in
the forecast, such as the weather
summary (field “W”).
<http://www.metoffice.gov.uk/media/pdf/3/0/DataPoint_API_reference.pdf>
• You now have the technology to create
great open data Apps using Processing
2.0

Contenu connexe

Tendances

ArcGIS GeoEvent Processor
ArcGIS GeoEvent ProcessorArcGIS GeoEvent Processor
ArcGIS GeoEvent ProcessorEsri
 
Customized story map for agrg weather network
Customized story map for agrg weather networkCustomized story map for agrg weather network
Customized story map for agrg weather networkswap0
 
Thesis Final Presentation
Thesis Final PresentationThesis Final Presentation
Thesis Final Presentationcreacher
 
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson HagenGIS in the Rockies
 
Air Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi teamAir Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi teamData Science Society
 
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)Jan-Hendrik Kuperus
 
Thermal Analysis in Ecotect
Thermal Analysis in EcotectThermal Analysis in Ecotect
Thermal Analysis in EcotectNYCCTfab
 
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...Databricks
 
Improving Weather Information Data Services with FME
Improving Weather Information Data Services with FMEImproving Weather Information Data Services with FME
Improving Weather Information Data Services with FMESafe Software
 
MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#Erik Lebel
 
Hydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick GuideHydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick GuideEmmanuel Mathot
 
GEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generationGEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generationEmmanuel Mathot
 
Surveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic CountriesSurveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic CountriesDirk Ahlers
 

Tendances (20)

ArcGIS GeoEvent Processor
ArcGIS GeoEvent ProcessorArcGIS GeoEvent Processor
ArcGIS GeoEvent Processor
 
Customized story map for agrg weather network
Customized story map for agrg weather networkCustomized story map for agrg weather network
Customized story map for agrg weather network
 
Thesis Final Presentation
Thesis Final PresentationThesis Final Presentation
Thesis Final Presentation
 
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
 
510p3saleh
510p3saleh510p3saleh
510p3saleh
 
Air Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi teamAir Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi team
 
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
 
Thermal Analysis in Ecotect
Thermal Analysis in EcotectThermal Analysis in Ecotect
Thermal Analysis in Ecotect
 
Data Sources
Data SourcesData Sources
Data Sources
 
google chart
google chartgoogle chart
google chart
 
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
 
Google charts
Google chartsGoogle charts
Google charts
 
Improving Weather Information Data Services with FME
Improving Weather Information Data Services with FMEImproving Weather Information Data Services with FME
Improving Weather Information Data Services with FME
 
Dent
DentDent
Dent
 
MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#
 
Hydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick GuideHydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick Guide
 
Ecotect Presentaion
Ecotect PresentaionEcotect Presentaion
Ecotect Presentaion
 
GEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generationGEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generation
 
[Year 2012-13] Wimax
[Year 2012-13] Wimax[Year 2012-13] Wimax
[Year 2012-13] Wimax
 
Surveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic CountriesSurveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic Countries
 

En vedette

ぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニングぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニングなおき きしだ
 
Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015Ryosuke Okuta
 
Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Ken Morishita
 
Deep Learningと画像認識   ~歴史・理論・実践~
Deep Learningと画像認識 ~歴史・理論・実践~Deep Learningと画像認識 ~歴史・理論・実践~
Deep Learningと画像認識   ~歴史・理論・実践~nlab_utokyo
 
自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning自然言語処理のためのDeep Learning
自然言語処理のためのDeep LearningYuta Kikuchi
 
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)徹 上野山
 
機械学習概論 講義テキスト
機械学習概論 講義テキスト機械学習概論 講義テキスト
機械学習概論 講義テキストEtsuji Nakai
 
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築Tatsuya Tojima
 
機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual Talks機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual TalksYuya Unno
 
機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話Ryota Kamoshida
 
scikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアルscikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアル敦志 金谷
 

En vedette (11)

ぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニングぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニング
 
Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015
 
Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識
 
Deep Learningと画像認識   ~歴史・理論・実践~
Deep Learningと画像認識 ~歴史・理論・実践~Deep Learningと画像認識 ~歴史・理論・実践~
Deep Learningと画像認識   ~歴史・理論・実践~
 
自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning
 
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)
 
機械学習概論 講義テキスト
機械学習概論 講義テキスト機械学習概論 講義テキスト
機械学習概論 講義テキスト
 
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
 
機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual Talks機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual Talks
 
機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話
 
scikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアルscikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアル
 

Similaire à Processing 2.0 + Open Data

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxNgLQun
 
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!Sébastien Levert
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!BIWUG
 
SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!Sébastien Levert
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 seriesopenbala
 
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...Sébastien Levert
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalrErhwen Kuo
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
Howtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboardHowtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboardGeoMedeelel
 
Full Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey DiagramFull Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey DiagramNeo4j
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxkarthikaparthasarath
 
Build Location Based App on bada
Build Location Based App on badaBuild Location Based App on bada
Build Location Based App on badaCheng Luo
 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Chris Griffith
 
Leveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRMLeveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRMAsa Kusuma
 

Similaire à Processing 2.0 + Open Data (20)

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
 
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
 
SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
 
@Ionic native/google-maps
@Ionic native/google-maps@Ionic native/google-maps
@Ionic native/google-maps
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
Global mapperhelp
Global mapperhelpGlobal mapperhelp
Global mapperhelp
 
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
 
Map
MapMap
Map
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
 
Phone Gap
Phone GapPhone Gap
Phone Gap
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
Howtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboardHowtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboard
 
Full Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey DiagramFull Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey Diagram
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
 
Build Location Based App on bada
Build Location Based App on badaBuild Location Based App on bada
Build Location Based App on bada
 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5
 
Leveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRMLeveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRM
 

Plus de Steven Battle

Digital Storytelling with Twine
Digital Storytelling with TwineDigital Storytelling with Twine
Digital Storytelling with TwineSteven Battle
 
Coding Chinese Dragons
Coding Chinese DragonsCoding Chinese Dragons
Coding Chinese DragonsSteven Battle
 
Coding with Counting Songs: “Ten Green Bottles” in Python
Coding with Counting Songs: “Ten Green Bottles”  in PythonCoding with Counting Songs: “Ten Green Bottles”  in Python
Coding with Counting Songs: “Ten Green Bottles” in PythonSteven Battle
 
Ashby's Mobile homeostat
Ashby's Mobile homeostatAshby's Mobile homeostat
Ashby's Mobile homeostatSteven Battle
 
Turtle Geometry the Python Way
Turtle Geometry the Python WayTurtle Geometry the Python Way
Turtle Geometry the Python WaySteven Battle
 
Quick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture EvaluationQuick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture EvaluationSteven Battle
 
Autaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural VehiclesAutaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural VehiclesSteven Battle
 
The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2Steven Battle
 
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2Steven Battle
 
Adventures in ARM Assembler
Adventures in ARM AssemblerAdventures in ARM Assembler
Adventures in ARM AssemblerSteven Battle
 
Ecore Model Reflection in RDF
Ecore Model Reflection in RDFEcore Model Reflection in RDF
Ecore Model Reflection in RDFSteven Battle
 
Introduction to App Development with Processing 2
Introduction to App Development with Processing 2Introduction to App Development with Processing 2
Introduction to App Development with Processing 2Steven Battle
 
CycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCycCycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCycSteven Battle
 

Plus de Steven Battle (16)

Digital Storytelling with Twine
Digital Storytelling with TwineDigital Storytelling with Twine
Digital Storytelling with Twine
 
Coding Chinese Dragons
Coding Chinese DragonsCoding Chinese Dragons
Coding Chinese Dragons
 
Coding with Counting Songs: “Ten Green Bottles” in Python
Coding with Counting Songs: “Ten Green Bottles”  in PythonCoding with Counting Songs: “Ten Green Bottles”  in Python
Coding with Counting Songs: “Ten Green Bottles” in Python
 
Droid Geometry
Droid GeometryDroid Geometry
Droid Geometry
 
Squishy logic
Squishy logicSquishy logic
Squishy logic
 
Ashby's Mobile homeostat
Ashby's Mobile homeostatAshby's Mobile homeostat
Ashby's Mobile homeostat
 
Turtle Geometry the Python Way
Turtle Geometry the Python WayTurtle Geometry the Python Way
Turtle Geometry the Python Way
 
Quick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture EvaluationQuick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture Evaluation
 
Autaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural VehiclesAutaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural Vehicles
 
The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2
 
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
 
Robots Are GO!
Robots Are GO!Robots Are GO!
Robots Are GO!
 
Adventures in ARM Assembler
Adventures in ARM AssemblerAdventures in ARM Assembler
Adventures in ARM Assembler
 
Ecore Model Reflection in RDF
Ecore Model Reflection in RDFEcore Model Reflection in RDF
Ecore Model Reflection in RDF
 
Introduction to App Development with Processing 2
Introduction to App Development with Processing 2Introduction to App Development with Processing 2
Introduction to App Development with Processing 2
 
CycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCycCycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCyc
 

Dernier

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Dernier (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Processing 2.0 + Open Data

  • 1. Processing 2.0 + Open Data @stevebattle stevebattle.me blog.stevebattle.me processing.freeforums.org
  • 2. Here’s the plan 1.Access Open Data (weather forecast) 2.Read JSON (JavaScript Object Notation) 3.Graphical widgets (ControlP5) 4.Upload App to mobile device
  • 3. Access Open Data • The Met Office have created DataPoint: http://www.metoffice.gov.uk/datapoint • Free registration here to get a key: http://bit.ly/11ApBRT • All resources have a base URL: http://datapoint.metoffice.gov.uk/public/data/ • Add resource path and key parameter: http://datapoint.metoffice.gov.uk/public/data/ RESOURCE?key=XXXX • Five day forecast for Bristol: http://datapoint.metoffice.gov.uk/public/data/ val/wxfcs/all/json/310004?res=daily&key=XXXX
  • 4. • Save this sketch as ‘weather’ • Drag openjson.jar onto the PDE, see: http://code.google.com/p/battle-bot/downloads/list
  • 5. JSON http://www.json.org • Objects {} containing string:value pairs • Arrays [] of values • Values can be objects, arrays, strings, numbers, booleans, or null {"Locations": {"Location": [ { "id": "3094", "name": "Rosehearty Samos", "longitude": "-2.121", "latitude": "57.698" }, ... { "id": "354552", "name": "Perranuthnoe (Perran Sands) (Beach)", "longitude": "-5.4411", "latitude": "50.1121" } ]}}
  • 6. • Use a loop to search JSON for an object named ‘Bristol’.
  • 7. Get the five day forecast
  • 8. {"SiteRep": { "Wx": {"Param": [ { "$": "Day Maximum Temperature", "name": "Dm", "units": "C" }, ... ]}, "DV": { "dataDate": "2013-08-02T21:00:00Z", "Location": { "Period": [ { "value": "2013-08-02Z", "type": "Day", "Rep": [ { "Dm": "24", ... } ] }, ... ] } "type": "Forecast" } }} The five day forecast
  • 10. Plan ahead with a sketch
  • 11. Graphical Widgets • Sketch > Import Library > Add Library • Sketch > Import Library > ControlP5 import controlP5.*;
  • 12. ListBox Widget public void draw() { background(255); fill(0); }
  • 13. •Define locationID as global: String locationID = "310004"; // Bristol •Replace // Search for ‘Bristol’ code with: initList(locations);
  • 14.
  • 15. •Detect the List selection event to assign locationID
  • 16. Tab Widgets • To make the siteList selection happen before it gets the forecast we’ll put them on different tabs.
  • 17. • Move the forecasting code at the end of setup() into its own function...
  • 18. ...and call the function when the ‘forecast’ tab is selected.
  • 19. Chart Widget • Instead of printing the forecast we’ll plot the temperatures on a chart. Chart chart;
  • 21. Upload App A few minor tweaks are required to run this as an Android App. • Switch to ‘Android’ mode. • You have to give the App permission to use the internet: Android > Sketch Permisions > Check INTERNET
  • 22. App Mods • Set the size() for the device: size(displayWidth,displayHeight); • Optionally change the orientation: orientation(LANDSCAPE); • The tab widgets are too small: cp5.getTab(“default”).setWidth(200).setHeight(40); cp5.getTab(“forecast”).setWidth(200).setHeight(40); • The ListBox is too small. Double: ItemHeight, BarHeight, ScrollBarWidth. • The font is too small: PFont pfont = createFont(“Ariel”,20,true); cp5.setFont(new ControlFont(pfont,24));
  • 23.
  • 24. Summary • Decorating the Met Office weather chart is left as an exercise for the reader. See controlP5 javadoc: <http://www.sojamo.de/libraries/controlP5/reference/> • Try displaying other information in the forecast, such as the weather summary (field “W”). <http://www.metoffice.gov.uk/media/pdf/3/0/DataPoint_API_reference.pdf> • You now have the technology to create great open data Apps using Processing 2.0