CSTARS / ahb-decision-support-app

AHB Decision Support Application
MIT License
1 stars 1 forks source link

Landcover Service #2

Closed qjhart closed 7 years ago

qjhart commented 8 years ago

The purpose of this service is to provide a commodity for each polygon that is passed to the service. The format will be similar to the Transportation service. The user passes in a geojson GeometryCollection, for each member in the geometry collection, the service responds with an id and either a best-guess commodity or a histogram of commodities for the polygon.

Input:

{
"regions": {
    "type": "GeometryCollection",
    "geometry": [
        {"type": "Polygon","coordinates": [[[-123,46.72]...]] },
        {"type": "Polygon","coordinates": [[[-123,46.72]...]] },
      ]},
"options":{ 
 "dictionary":"CDL or DWR"
}

Output:

{"geometry":[
  {"commodity":"rice",
   "yield":35,
   "unit":"MT/ha"
  },
 { "commodity":"alfalfa"
 },
  ....]
}

There is a one to one correspondence to the input and output geometries. The values in the output array respond in the same order as the inputs.

There will be two initial dictionaries

The service responds with the median value of the CDL within the polygon. The yield is a best guess yield for this service.

qjhart commented 8 years ago

Implementation

Investigation into postgis intersection of polygons and rasters seems to indicate that tiled services are much quicker in response time. The original idea is to take 2015 CDL data, import into postgis database, reproject the data into smaller rasters that correspond exactly to our regional pixel sizes, and then use a per-pixel raster data for our median data creation.

qjhart commented 8 years ago

We need to also include