Dhi13man / open_route_service

An encapsulation made around openrouteservice API for Dart and Flutter projects. Made for easy generation of Routes and Directions on Maps, Isochrones, Time-Distance Matrix, Pelias Geocoding, POIs, Elevation and routing Optimizations using their amazing API.
https://pub.dev/packages/open_route_service
MIT License
30 stars 7 forks source link

TODO: Make Metadata schema class and include it into every data model it's needed in. #5

Open Dhi13man opened 3 years ago

Dhi13man commented 3 years ago

Example metadata

{
    "metadata": {
        "attribution": "openrouteservice.org | OpenStreetMap contributors",
        "service": "matrix",
        "timestamp": 1632652598861,
        "query": {
            "locations": [
                [
                    9.70093,
                    48.477473
                ],
                [
                    9.207916,
                    49.153868
                ],
                [
                    37.573242,
                    55.801281
                ],
                [
                    115.663757,
                    38.106467
                ]
            ],
            "profile": "driving-car",
            "responseType": "json"
        },
        "engine": {
            "version": "6.6.1",
            "build_date": "2021-07-05T10:57:48Z",
            "graph_date": "2021-09-12T10:05:32Z"
        }
    }
}
Dhi13man commented 3 years ago

API Documentation

https://openrouteservice.org/dev/#/api-docs/

Potential Implementation steps

  1. Test out the various API endpoints and their responses. See how those responses correspond to encapsulated Data Model Classes in the package.
  2. See which responses include this metadata model.
  3. Make an ORSMetadata class and include it as a member of all the encapsulated classes of the package that need it as per the information from Step 1.
Dhi13man commented 3 years ago

Metadata -> query can be kept dynamic or Map<String, dynamic>