Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connector with Telenav search service for charge stations #132

Closed
CodeBear801 opened this issue Jan 15, 2020 · 2 comments
Closed

Connector with Telenav search service for charge stations #132

CodeBear801 opened this issue Jan 15, 2020 · 2 comments
Assignees

Comments

@CodeBear801
Copy link

CodeBear801 commented Jan 15, 2020

Subtask of #120. For initial implementation, will directly use Telenav's search service, will consider to use alternative way(such as build spatial index, #131) to replace this dependency, user of OASIS service need to provide charge station information in certain format then could set up the solution. A even better scenario is, if we could find charge station data via public/open source data, then we could make Oasis service a free service for public.

Telenav Search REST API URL

https://<domain_name>/entity/v4/search/json?<query parameters> 

Example query of EV charging station

entity/v4/search/json?api_key=xxx&api_signature=xxx&query=EV+Charging+Station&location=37.78509%2C-122.41988&intent=around&locale=en-US&limit=25&user_id=test
  • query identify search category
  • location means the center point of query
  • limit means result expected

Result

image

response.json

Response

  • Search result is sorted by distance, for example
"distance": 443,

"distance": 551,

"distance": 827,
...
  • Useful information in response
{
     "id": "P-32394722",
     "place": {
          "address": [
              "geo_coordinates": {
                  "latitude": 37.78014,
                   "longitude": -122.42039
               },
               "nav_coordinates": [
                {
                    "latitude": 37.78014,
                    "longitude": -122.42039
                }
               ]   // end for nav_coordinates
           ] // end for address 
      }  // end for place
      "ev_connectors": {
        "total_number": 9,
          "connector_counts": [
           {
                   "level": 2,
                    "total": 9
           }
           ]
         ...
         "detail_url": "https://denali.telenav.com/entity/v4/detail/json?entity_id=P-19657842&context=c2lkPWNiOTU5NTY3LWZjZDMtNDc3My1hNWM5LTBlYWY4NDQxZTYyMyZ1c2VyX2lkPXRlc3Q"
}
@CodeBear801
Copy link
Author

CodeBear801 commented Jan 17, 2020

Decoded result example:

  "response_time": 277,
  "results": [
    {
      "id": "P-19657842",
      "place": {
        "address": [
          {
            "geo_coordinates": {
              "latitude": 37.78113,
              "longitude": -122.41921
            },
            "nav_coordinates": [
              {
                "latitude": 37.78113,
                "longitude": -122.41921
              }
            ]
          }
        ]
      },
      "distance": 443,
      "facets": {
        "ev_connectors": {
          "total_number": 6,
          "connector_counts": [
            {
              "level": 2,
              "Total": 3
            },
            {
              "level": 1,
              "Total": 3
            }
          ]
        }
      },
      "detail_url": "/entity/v4/detail/json?entity_id=P-19657842&context=c2lkPTE4ZWVmZGM0LTUzMTAtNGQ0ZC1hMWJjLTk3NmE2NGIzZjMyZCZ1c2VyX2lkPXRlc3Q"
    },
  • Based on analysis on this response, there are two changes need to be made for OASIS API
    • Output location for each charge station, original just have one group of {lat, lon}, need change to geo_coordinates + a list of nav_coordinates
    • Need add the field of "detail_url", so external user have possibility to retrieve all information related with specific charge station, potentially could add dynamic information.

CodeBear801 added a commit that referenced this issue Jan 17, 2020
      Only support nearest charge station search for now.
issues: #132
@CodeBear801
Copy link
Author

CodeBear801 commented Jan 17, 2020

For how to use search adhoc tool with Telenav internal servers, please go to this page

CodeBear801 added a commit that referenced this issue Jan 17, 2020
     - Remove "Location field", add "Address" field which contains geo_coordinates + a list of nav_coordinates
     - Add field of detail_url, external user could retrieve all information related with specific charge station
     - Add field of estimate remaining range for each solution
issue: #132 (comment)
       #128
@CodeBear801 CodeBear801 mentioned this issue Jan 17, 2020
2 tasks
CodeBear801 added a commit that referenced this issue Jan 20, 2020
wangyoucao577 pushed a commit that referenced this issue Jan 21, 2020
* feat: Implement initial connector with telenav search
      Only support nearest charge station search for now.
issues: #132

* fix: update code.
issue: #132
wangyoucao577 pushed a commit that referenced this issue Jan 22, 2020
* feat: Implement initial connector with telenav search
      Only support nearest charge station search for now.
issues: #132

* fix: update oasis api
     - Remove "Location field", add "Address" field which contains geo_coordinates + a list of nav_coordinates
     - Add field of detail_url, external user could retrieve all information related with specific charge station
     - Add field of estimate remaining range for each solution
issue: #132 (comment)
       #128

* fix: resolve conflict
issue: #128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant