New in Wolfram
Mathematica
8: Import and Export Formats
◄
previous
|
next
►
Application Areas
Import JSON Files from Web Services
This imports a JSON file from Google's map web service containing elevation data points between the cities of Champaign, IL and Boston, MA.
In[1]:=
X
elevationData = Import[ "http://maps.googleapis.com/maps/api/elevation/json?path=40.1130,-\ 88.2611|42.3216,-71.0891&samples=500&sensor=false", "JSON"]; ListPlot[Cases[elevationData, HoldPattern["elevation" -> value_] :> value, Infinity], Joined -> True, ColorFunction -> ColorData["LightTerrain"], PlotStyle -> Thick, AxesLabel -> {None, "Elevation in Meters"}, Ticks -> {{{0, "Champaign, IL", {0, .01}}, {500, "Boston, MA", {0, .01}}}, Automatic}]
Out[1]=