Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Graph view should not display raw error when the focus boundary is not included by the dataset boundary. #199

Open
Zodiase opened this issue May 24, 2018 · 10 comments
Assignees
Labels

Comments

@Zodiase
Copy link
Contributor

Zodiase commented May 24, 2018

From @kintigh:

If you select an area outside the dataset boundary (which you probably should not be able to do) you get an error when graph view tries to draw a graph.

@Zodiase Zodiase self-assigned this May 24, 2018
@Zodiase
Copy link
Contributor Author

Zodiase commented May 24, 2018

@kintigh I'm not sure what would be the best way to do the geometry inclusion test on the client. Even though there are only rectangles and points, since we are planning to have more shapes soon (like circles), if there's a check it'd better to cover as much of the use case as possible, which basically means checking between two polygons.

A quick workaround for now, since the server is returning this error, is to present the error better instead of showing the raw message, just like the timeout error. Do you think that would resolve this issue for now? If so, what do you think would be a good error message? How about "Please only select a point or area within the boundary"?

@kintigh
Copy link

kintigh commented May 24, 2018

That is reasonable. I just didn't want a data error. How about. "Please select a point or area within the dataset boundary. "

@bocinsky
Copy link

I just wanted to note that if a user selects an area that crosses the dataset boundary, it succeeds silently, presumably just averaging over the desired area within the dataset. This is probably the desired behavior, but we might want to alert the user somehow that the calculated area is smaller than that which they specified. Perhaps automatically crop their selected area to the dataset boundary?

@tmcphillips
Copy link
Member

This issue is resolved for points, but not rectangular regions.

If I click on a point outside the data set coverage in Graph View I get the error "Please select a point or area within the dataset boundary", as expected.

However, if I select a rectangle outside the data set coverage, I still get the error message, "Error when requesting data."

@tmcphillips tmcphillips reopened this Jun 26, 2018
@Zodiase
Copy link
Contributor Author

Zodiase commented Jun 27, 2018

@tmcphillips

When a point outside of the boundary is used, I receive the following error from the time-series server:

{  
   "timestamp":1530110557814,
   "status":400,
   "error":"Bad Request",
   "exception":"org.openskope.timeseries.controller.InvalidArgumentException",
   "message":"Coordinates are outside region covered by the dataset",
   "path":"/timeseries-service/api/v1/timeseries/lbda-v2/palmer_modified_drought_index"
}

and a match with the error message "Coordinates are outside region covered by the dataset" is used to determine the cause of the error (for displaying the user friendly error message).

But for a rectangle that is completely outside of the boundary, I get something like this:

{  
   "timestamp":1530110569634,
   "status":400,
   "error":"Bad Request",
   "exception":"org.openskope.timeseries.controller.InvalidArgumentException",
   "message":"Traceback (most recent call last):\n  File \"/usr/local/bin/zonalinfo.py\", line 149, in <module>\n    main()\n  File \"/usr/local/bin/zonalinfo.py\", line 118, in main\n    masked, transform, window = raster_geometry_mask(src, geoms, crop=True, all_touched=True)\n  File \"/usr/local/lib/python2.7/dist-packages/rasterio/mask.py\", line 87, in raster_geometry_mask\n    raise ValueError('Input shapes do not overlap raster.')\nValueError: Input shapes do not overlap raster.\n",
   "path":"/timeseries-service/api/v1/timeseries/lbda-v2/palmer_modified_drought_index"
}

I don't think I can reliably use the message to determine the cause of the error. Can I?

Also there is no error when the geometry is partially out of boundary.

@tmcphillips
Copy link
Member

I just made changes to timeseries-service to return a Bad Request response with the message property set to "The selected area does not overlap the region covered by the dataset" when a request is made for a time series over an area entirely outside the coverage of the data set.

I'll build a new Docker image for the service.

@Zodiase Zodiase assigned tmcphillips and unassigned Zodiase Jul 9, 2018
@Zodiase
Copy link
Contributor Author

Zodiase commented Jul 9, 2018

The work here is for @tmcphillips to update the time series service to return proper error messages when the box selection is completely outside of the dataset boundary.

@tmcphillips
Copy link
Member

I fixed this 12 days ago and thought it would be in the latest image running on staging, but I'm still seeing the old error when selecting a rectangle fully outside the dataset coverage. I'll try to figure out why the changes aren't reflected on staging.

@tmcphillips
Copy link
Member

Ok, I manually pulled the latest image for the timeseries-service to both tacc-staging and staging. They now both return the following kind of response when selecting a rectangle outside the coverage:

{
"timestamp":1531175545250,
"status":400,"error":"Bad Request",
"exception":"org.openskope.timeseries.controller.InvalidArgumentException",
"message":"The selected area does not overlap the region covered by the dataset",
"path":"/timeseries-service/api/v1/timeseries/paleocar_2/water_year_precipitation"
}

@Zodiase
Copy link
Contributor Author

Zodiase commented Jul 13, 2018

Should be resolved in v0.1.30.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants