The API is currently only using the default text-based mechanisms to search date and spatial fields. We want to add a standard compliment of spatial/temporal searches.
Desired Searches
Spatial Search
Parameters
bounding box
fully_contained
true: returns results that lie fully inside of the given bounding box (default?
false: returns results that overlap in any way with the given bounding box
Considerations
Do we want to consider arbitrary polygon searches instead of bounding boxes?
Relevant Models
Natively Capable
Deployments have a spatial_bounds field and can be directly searched.
Inferred
Other models will need to have their search inferred through the linkage to a Deployment object.
Campaign
IOP
SignificantEvents
DOI
Validation
API should validate incoming requests and send back instructive messages for invalid requests.
incorrect date format
start_date after end_date
Date Searches
Parameters
start_date
end_date
fully_contained: boolean
true: returns items who's dates are fully contained within given range (default?)
false: returns items who's dates overlap with given range
Considerations
May want to consider an easy way for users to input common searches such as, 'all dates after 2016', perhaps by leaving the end date blank
Relavant Models
Natively Date Capable Models
Some models have a start_date and end_date field, and can be directly searched. Implementing search for these models is the minimum acceptance criteria.
Campaign
Deployment
IOP
SignificantEvent
Inferred Date Models
Some models do not have their own date fields, but relevant dates can be inferred through their parent linkage to a date capable model. Such inferred models which we might want to add a helper function to infer and allow search are:
DOI (through campaign or deployment linkage)
Instrument (through DOI linkage)
Platform (through DOI linkage)
Validation
API should validate incoming requests and send back instructive messages for invalid requests.
invalid bounding box format (not a number, etc)
invalid bounding box (doesn't form a convex shape)
note: still adding details
Overview
The API is currently only using the default text-based mechanisms to search date and spatial fields. We want to add a standard compliment of spatial/temporal searches.
Desired Searches
Spatial Search
Parameters
bounding box
fully_contained
Considerations
Relevant Models
Natively Capable
Deployments have a
spatial_bounds
field and can be directly searched.Inferred
Other models will need to have their search inferred through the linkage to a Deployment object.
Validation
API should validate incoming requests and send back instructive messages for invalid requests.
Date Searches
Parameters
start_date
end_date
fully_contained
: booleanConsiderations
Relavant Models
Natively Date Capable Models
Some models have a
start_date
andend_date
field, and can be directly searched. Implementing search for these models is the minimum acceptance criteria.Inferred Date Models
Some models do not have their own date fields, but relevant dates can be inferred through their parent linkage to a date capable model. Such inferred models which we might want to add a helper function to infer and allow search are:
Validation
API should validate incoming requests and send back instructive messages for invalid requests.