CHT: API for filtering events

Bug #993165 reported by matley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Medium
Giuseppe Vallarelli

Bug Description

Design and implements an API for filtering events.

Geometry input parameters should be nhlib geometry class instances https://github.com/gem/nhlib/tree/master/nhlib/geo

The following APIs should be designed and implemented:

1) Global search. Find all the events
2) Distance Search. Find all the events within a distance of (e.g. 300 km) from point (Lon, Lat)
3) Polygon Search. Find all the events that lie on the surface enclosed by a polygon (Use WKT to denote a polygon).

Each API return value should be of type sqlalchemy.orm.Query ( http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query )

Each API result set can be further refined by applying one or more filters. E.g.

Event.distance_search(aPoint, aDistance).filter_by(magnitude > 5).filter_by(date < datetime.now())

Provide test cases for each API method. Some test fixtures can be found at https://bugs.launchpad.net/openquake/+bug/979915/+attachment/3053004/+files/myanmar_sample_catalogue_for_queries.csv

Some query examples are given in https://bugs.launchpad.net/openquake/+bug/979915

matley (matley)
description: updated
description: updated
description: updated
matley (matley)
description: updated
description: updated
matley (matley)
description: updated
Changed in openquake:
status: New → In Progress
Revision history for this message
Graeme Weatherill (graeme-9) wrote :

Some test data:

i) test_query_input_catalogue.csv - Short catalogue for geometry selection tests
ii) test_geometries_2polygons_1point.txt - Description of the geometries of two polygons and one point for geographical distance testing.
iii) solution_in_polygon_results.csv - List for each measure in test_query_input_catalogue.csv indicating True or False is the measure is inside polygon 1 or 2 respectively, and the distance (in km) from the point.

Revision history for this message
Graeme Weatherill (graeme-9) wrote :
Revision history for this message
Graeme Weatherill (graeme-9) wrote :
Changed in openquake:
importance: Undecided → Medium
assignee: nobody → Giuseppe Vallarelli (gvallarelli)
status: In Progress → Fix Committed
Changed in openquake:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.