Searching Earthquake Data
Searching Earthquake Data
Introduction
Earthquake Data
• Using earthquake data as basis for study
• Object orientation with classes
• Searching, sorting, understanding data
• Parsing and transforming data
Earthquake Data
• Using earthquake data as basis for study
• Object orientation with classes
• Searching, sorting, understanding data
• Parsing and transforming data
• Transition to further study
• Capstone Project
• UCSD Specialization
• On your own
Real-time Data, November 11, 2015
• http://bit.ly/dukesoftware-quake11
Visualizing earthquake data in California,
United States
World/Asian Quakes, 11/11/2015
• Larger magnitude quakes ocean based?
• Creating maps by creating CSV files
Transforming and Using Data
• Data from http://earthquake.usgs.gov is in
XML format. JSON another data standard
Latitude,Longitude,Magnitude,Info
60.08,-152.76,2.50,45km S of Redoubt Volcano, Alaska
36.33,-115.76,1.30,24km NE of Pahrump, Nevada
33.83,-117.00,1.00,7km NW of San Jacinto, California
33.83,-117.00,0.80,7km NW of San Jacinto, California
Transforming and Using Data
• Data from http://earthquake.usgs.gov is in
XML format. JSON another data standard
• Widespread standards, tricky to parse
• We need CSV format for Google Maps
• Also used in other mapping services
Latitude,Longitude,Magnitude,Info
60.08,-152.76,2.50,45km S of Redoubt Volcano, Alaska
36.33,-115.76,1.30,24km NE of Pahrump, Nevada
33.83,-117.00,1.00,7km NW of San Jacinto, California
33.83,-117.00,0.80,7km NW of San Jacinto, California
Transforming and Using Data
• Data from http://earthquake.usgs.gov is in
XML format. JSON another data standard
• Widespread standards, tricky to parse
• We need CSV format for Google Maps
• Also used in other mapping services
• Transforming data common application
Latitude,Longitude,Magnitude,Info
60.08,-152.76,2.50,45km S of Redoubt Volcano, Alaska
36.33,-115.76,1.30,24km NE of Pahrump, Nevada
33.83,-117.00,1.00,7km NW of San Jacinto, California
33.83,-117.00,0.80,7km NW of San Jacinto, California
Parsing and Transforming Data
• Parsing isn't simple, so let's use an API we
created to return collection of QuakeEntry
objects
• Location private
private
Location myLocation;
String title;
private double depth;
• Magnitude private double magnitude;
• Description }
QuakeEntry and Location Classes
• QuakeEntry holds relevant data from USGS
XML feed public class QuakeEntry {
• Location private
private
Location myLocation;
String title;
private double depth;
• Magnitude private double magnitude;
• Description }