ec-melodies / demo-portal

MELODIES demonstrator portal
http://ec-melodies.github.io/demo-portal/
Other
2 stars 0 forks source link

Use Case: Raster filtering by polygon #1

Closed letmaik closed 8 years ago

letmaik commented 9 years ago

Description: Wiki

Libraries to be used:

Tasks to be finished:

Filtering a grid by a polygon can be seen as a two-step process. Step 1 is to subset the grid by the bounding box of the polygon. Step 2 is to mask all grid cells outside the polygon. The result is a grid coverage on which further processing like statistics can be done. Any data outside the polygon would then be regarded as missing data.

Subsetting by bounding box and masking by polygon are currently implemented in the leaflet-coverage library, however as these operations are independent of the use of leaflet, they should be extracted into a separate library once more such processing functions are implemented.

The polygon (including MultiPolygon) itself comes from a GeoJSON document. When the user clicks "Subset" on the distribution to be subsetted he gets a listing of available GeoJSON distributions within the workspace. After selecting one of those, the GeoJSON is inspected and checked how many polygons it includes. If it contains only a single polygon, then this is chosen. If more are available, they are drawn on the map and the user has to choose one by clicking on it.

A test set can be found here: https://raw.githubusercontent.com/chrisfinch/over9k/master/public/experiments/march-2013/GBR_adm2.json