hotosm / galaxy-api

Backend to fetch data from Underpass
https://galaxy-api.hotosm.org/latest/redoc
GNU Affero General Public License v3.0
14 stars 5 forks source link

Standardise API Request Body with it's acceptance Criteria : Rawdata #209

Closed kshitijrajsharma closed 2 years ago

kshitijrajsharma commented 2 years ago

Plan is to enhance API request body with standard format in user readable way + make it more clear for users and other developers . Since API supports requirement for both export tool and standard user , we need to derive a better and common approach for the API request body

kshitijrajsharma commented 2 years ago

From multiple discussion we arrived to conclusion to go with following example request body for rawdata endpoint , Validation and acceptance criteria will be applied as required initially and updated on this same thread as comment

{
  "outputType": "GeoJSON",
  "fileName": "string",
  "geometry": {
    "coordinates": [
      [
        [
          "string"
        ],
        [
          "string"
        ]
      ]
    ],
    "type": "string"
  },
  "filters" : {
    "tags": { # no of rows returned 
      "point" : {"amenity":["shop"]},
      "line" : {},
      "polygon" : {"key":["value"]},
      "all_geometry" : {"building":['yes']}
      },
    "attributes": { # no of columns / name 
      "point": [], column 
      "line" : [],
      "polygon" : [],
      "all_geometry" : [],
      }
     },
  "geometryType": [
    "point","line","polygon"
  ]
}