Je souhaite utiliser votre API Waze dans un projet et j’ai besoin d’aide pour l’utiliser de manière plus efficace
1°) comment déterminer la latitude longitude du second coin ?
2°) est-il possible de recevoir automatiquement les mises à jour des alertes ou dois-je faire une action GET toutes les X minutes ? et si on doit faire manuellement GET comment déterminer le meilleur intervalle pour ne pas faire trop de GET ?
3°) est-il possible d’avoir la limitation de vitesse de la voiture pour l’endroit où se trouve l’utilisateur ? ou dois-je utiliser une autre API pour cela et pourriez-vous m’en recommander une ?
4°) est-il possible d’avoir les coordonnées d’un radar fixe ou dois-je utiliser une autre API pour cela et pourriez-vous m’en recommander une ?
Merci pour votre aide
Cordialement
Pierre
Hello,
I would like to use your Waze API inside a project and I need some help to use in the more efficient way
1°) how to determine the lattitude longitude of the second corner ?
2°) is it possible to receive automaticly updates of alerts or do I have to make GET action every X minutes ? and if we have to manually make GET how to determine the best intervall to not make GET too much times ?
3°) is it possible to have the speed car limitation for where the user is ? or do I have to use another API for it and could you recommend one for me ?
4°) is it possible to have the coordonate of fix speed camera or do I have to use another API for it and could you recommend one for me?
Thank’s for your help
Best Regards
Pierre
Join in the discussion - add comment below:
Sure.
Adjusting the first answer on https://stackoverflow.com/questions/33232008/javascript-calcualate-the-geo-coordinate-points-of-four-corners-around-a-cente for our need in javascript:
const toRad = d => d * Math.PI / 180;
const getCoordinates = (pLatitude, pLongitude, pDistanceInMeters) => {
var latRadian = toRad(pLatitude);
};
In your case, the user position could be (pLatitude, pLongitude) and pDistanceInMeters is basically half of the square width you need.
For example:
getCoordinates(32, 35, 10000);
Output:
{
“bottomLeft”: “31.909563018907615,34.89335731287973”,
“topRight”: “32.09043698109239,35.10664268712027”
}
You can see how the 3 points look visually here: https://mobisoftinfotech.com/tools/plot-multiple-points-on-map/ with the following input for example:
32,35,blue,circle, "Center"
31.909563018907615,34.89335731287973,red,circle,"Bottom-left"
32.09043698109239,35.10664268712027,red,circle,“Top-right”
Feel free to let me know if you have any questions.
Thanks,
OpenWeb Ninja
Hi,
Yes we can exchange in english
Ok I will try to find how find but if you have an example it would be very kinf of you 😃
Hi Pierre-Jean
I am sorry but I don’t understand french - can we chat in english? If not, I will try to use Google Translate which I hope will be accurate enough most of the times…
If I understand you correctly and you are interested in radius R around the user located at some geo point (latitude0, longitude0), you can for example calculate the bottom-left and top-right corners of the square that is packed within a circle with radius X and send those to the API - to calculate the 2 corner points, you can use a utility function that calculates a geo point in a certain distance and an angle from a given geo point and use it to calculate bottom-left point at distance R and angle 5PI/4 and top-right distance R and angle PI/4. This is at least how you can do it with the API as is. I can also add support for point and radius queries which will do something similar to what I described above under the hood.
Thank you,
OpenWeb Ninja
Oui c’est exactement cela
Disons que si mon utilisateur démarre en voiture je souhaiterais pouvoir lui indiquer les alertes Waze autour de lui dans un rayon de x mètres puis au fur et a mesure qu’il roule interroger periodiquement pour avoir les nouvelles alertes mais sans interroger trop souvent pour ne pas consommer trop de credits
J’ai le point de depart : lattidude - longitude
Ensuite au depart quand le vehicule démarre je n’ai que cela. Ensuite je peux conserver le precedent point de geolocalisation et tenter de determiner la direction dans laquelle roule le vehicule (je ne sais pas comment faire mais je pense que je peux trouver comment faire peut etre)
A moins que vous ne puissiez modifier votre API et pouvoir (comme dans d 'autres API) indiquer un rayon autour du point et eventuellement une orientation (nord, surd, est ouest) ??
Merci pour votre aide
PIerre-Jean
Hi,
Thank you for your message.
3 + 4) Please let me check what can be done and I’ll get back to you.
Thank you,
OpenWeb Ninja