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

Return units #36

Open
aetiologicCanada opened this issue Jan 30, 2018 · 3 comments
Open

Return units #36

aetiologicCanada opened this issue Jan 30, 2018 · 3 comments

Comments

@aetiologicCanada
Copy link

This lovely function returns three elements: Time, Distance and Status.
What are the units for Time and Distance? This should be specified at least in the documentation
and perhaps in the returned object.

@Demetrio92
Copy link
Collaborator

Demetrio92 commented Jan 31, 2018

It should, indeed. However the package just scraps the results from google maps API, which is returning something like

<DistanceMatrixResponse>
   <status>OK</status>
   <origin_address>... </origin_address>
   <destination_address> ...</destination_address>
   <row>
      <element>
         <status>OK</status>
         <duration>
            <value>812</value>
            <text>14 mins</text>
         </duration>
         <distance>
            <value>4209</value>
            <text>4.2 km</text>
         </distance>
      </element>
   </row>
</DistanceMatrixResponse>

So the distance is in meters and duration is in seconds.
Hope, this helps for now.

@rodazuero
Copy link
Owner

Thanks for your comments.
This information is in the first paragraph of the README file.
"The distance is returned in meters and the time in seconds."

@Demetrio92
Copy link
Collaborator

The function should actually return units and not just the number. I'll keep the issue open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants