Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BiG-CZ: Update Search Endpoint to Accept GeoJSON and WKAoI #2251

Open
rajadain opened this issue Sep 12, 2017 · 1 comment
Open

BiG-CZ: Update Search Endpoint to Accept GeoJSON and WKAoI #2251

rajadain opened this issue Sep 12, 2017 · 1 comment
Labels

Comments

@rajadain
Copy link
Member

As of #2246, we are sending the full geometry of the area of interest for searching, in a payload akin to this:

{
  "catalog": "cinergi",
  "query": "water",
  "geom": {
    "type": "MultiPolygon",
    "coordinates": [
      [
        []
      ]
    ]
  },
  "from_date": null,
  "to_date": null
}

To better match the API design used for the new Geoprocessing API (#2201), make it so this endpoint accepts GeoJSON in the POST body, and all other parameters (catalog, query, from_date, to_date) are in the query.

Also, add a wkaoi query parameter, that if present with an empty POST body, causes a lookup of a well-known AoI by that name. If no such entry is found, the endpoint should return a 404.

If neither a wkaoi nor a valid GeoJSON is found in the POST body, then return a 400.

@rajadain rajadain added the BigCZ label Sep 12, 2017
@rajadain
Copy link
Member Author

As of #2258, we have a good common framework for filters, but are still constructing the parameters in a level above (in startSearch). The filters would be easier to work with / compose if they could provide their own parameters, so we could do something like this:

var geom = this.get('geom'),
    query = this.get('query')
    getParams = function (x) { x.getParams(); },
    params = this.get('filters').map(getParams).join('&'),
    url = BASE_URL + '?query=' + query + '&' + params;

$.post(url, geom);

@rajadain rajadain added queue 1 and removed queue labels Sep 21, 2017
@ajrobbins ajrobbins removed the 1 label Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants