6aika / issue-reporting

Reference Open311 API server implementation
MIT License
7 stars 4 forks source link

Add Geometry extension #38

Closed akx closed 8 years ago

akx commented 8 years ago

Add a geometry extension; to be specified more closely by @aapris.

aapris commented 8 years ago

(In the future API may support a rich set of geospatial filters, if someone wants to implement them.)

aapris commented 8 years ago

If request is POSTed as json, it could look like this:

{
    "title": "Geometry example",
    "service_code": "180",
    "description": "LineString as requested",
    "first_name": "Test",
    "last_name": "Post",
    "geometry": {
        "type": "LineString",
        "coordinates": [
            [25.0, 60.18],
            [25.01, 60.19],
            [25.02, 60.20],
            [25.025, 60.21]
        ]
    }
}

Example request using HttPie and JSON payload: http POST 'http://127.0.0.1:8000/api/georeport/v2/requests.json?extensions=citysdk,media' < request-post-geo.json

Leave off media to switch from multipart to urlencoded form post type.

aapris commented 8 years ago

If request is multipart/formdata, geometry should be regular form field filled with valid geojson. Example request using HttPie:

http -f POST 'http://127.0.0.1:8000/api/georeport/v2/requests.json?extensions=citysdk,media' service_code=171 title='Multipart geometry' description="Multipart" email=Email@addre.ss first_name=First last_name=Last phone=Phone geometry='{"type":"LineString","coordinates": [[25.0, 60.18],[25.01, 60.19],[25.02, 60.20],[25.025, 60.21]]}' media@~/picture.jpg

aapris commented 8 years ago

More detailed specification as requested by @akx . Of course, assignee is encouraged to contact the client if specification has obvious stupidities.

akx commented 8 years ago

Fixed via #63!