geosolutions-it / gfdrr-det

Data Exploration Tool
https://waffle.io/geosolutions-it/gfdrr-det
GNU General Public License v3.0
3 stars 0 forks source link

hooked up the new HeveDetails model to API serializers and refactored… #83

Closed ricardogsilva closed 6 years ago

ricardogsilva commented 6 years ago

This PR is connected to #13 Major changes:

The single layer API now responds to a request to:

http://10.0.1.95:8000/gfdrr_det/api/v1/exposures/{layer-id}/

with the following GeoJSON content:

{
  "id": 282,
  "type": "Feature",
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          29.5835,
          -1.47298
        ],
        [
          29.5835,
          4.21036
        ],
        [
          35.00017,
          4.21036
        ],
        [
          35.00017,
          -1.47298
        ],
        [
          29.5835,
          -1.47298
        ]
      ]
    ]
  },
  "properties": {
    "url": "http://10.0.1.95:8000/gfdrr_det/api/v1/exposures/282/?format=json",
    "title": "Uga v10 buildings 136",
    "name": "uga_v10_buildings_136",
    "description": "Uganda exposure v10 by ImageCat",
    "category": "buildings",
    "aggregation_type": "aggregated",
    "wms_url": "http://10.0.1.95:8080/geoserver/hev-e/wms",
    "counts": {
      "data": {
        "construction_material": {
          "unknown": 110617,
          "masonry": 526429,
          "wood": 134913,
          "concrete": 18283
        },
        "occupancy": {
          "unknown": 790242
        },
        "construction_date": {
          "unknown": 790242
        }
      },
      "name": "Number of assets"
    }
  }
}