You will receive a JSON string containing an array of records. The records represent fractures mapped from a planar, horizontal outcrop. Each record represents one fracture and looks like this:
{"survey": "DGPS", "coords": [65.371, 28.593, 130.629, 47.407], "is_open": true}
Notice that each fracture has the following attributes:
'DGPS'
) or based on airborne imagery ('SRVY'
).x1, y1, x2, y2
coordinates in metres for each fracture. The point (x1, y1) represents one end of the fracture, and (x2, y2) represents the other.Considering only the fractures measured with DGPS, answer the following questions:
The data you get from requests
is a str
in JSON format. You can convert JSON into a Python data structure using the json
built-in library. For example, json.loads('[1, 2, 3]')
results in a Python list
.
Here is a small example dataset:
{"fractures": [{"survey": "DGPS", "coords": [ 65.371, 28.593, 130.629, 41.407], "is_open": true},
{"survey": "SRVY", "coords": [ 34.704, -14.876, 47.296, -3.124], "is_open": true},
{"survey": "DGPS", "coords": [-57.088, 42.648, -48.912, 37.352], "is_open": false},
{"survey": "DGPS", "coords": [-66.568, -70.693, 63.432, -69.307], "is_open": true},
{"survey": "DGPS", "coords": [-42.117, 60.92, -39.215, 59.717], "is_open": true},
{"survey": "DGPS", "coords": [-87.201, 93.463, -88.799, -92.537], "is_open": true},
],
"meta_data": {"survey_date": "2013-06-29", "surveyor": "AcmeSurveying"},
}
You'll have many more fractures than this small example. Here's how we'd answer the questions for this example data set:
open
fractures surveyed with 'DGPS'
.