-
Notifications
You must be signed in to change notification settings - Fork 571
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
Issue with WITHIN Query in Tile38 Geofencing #746
Comments
Perhaps the problem is that the WITHIN POINT command requires that the coordinates are lat/lon. You have lon/lat. |
The geojson appears to be in the correct order to me.
I only issue I see is with the
It should be:
|
No idea what I was thinking. Shouldn’t answer GitHub issues first thing in the morning. 🙃🙂 |
One other thing. The WITHIN command as shown is attempting to find objects from the “geofences” collection that are “within” a POINT. That may not give the results that you want. If what you are trying to do is to find which polygon geofences contain a specific point then I recommend using the INTERSECTS instead. |
Previously I had also changed from longitude latitude to longitude latitude, and the results were still the same. here is the generated laravel log: protected $tile38;
|
Is there a Laravel project that uses tile38 before? I've looked for several sources, and haven't found anyone who has used Laravel. Maybe you have other references, and if you use another programming language that's okay, as long as you use set and within queries. because maybe I still have errors in making the query |
Switch WITHIN with INTERSECTS and try again as suggested above. 🙂 A Polygon will never be WITHIN a point, but a Point can INTERSECT a Polygon. |
Wow, I am very grateful, finally my project was successfully completed. For geofencing, do I need to send it in this comment? I will immediately send the Laravel controller for geofencing here. once again thank you all |
To setup a geofence from that polygon you would do
e.g. to alert on vehicles in the
|
My project using Laravel and Tile38 has been completed, and I also use INTERSECTS according to your suggestion to check whether the user is in the geofencing. Below is the complete code for geofencing:
} |
I am experiencing an issue with the
WITHIN
query in Tile38 for geofencing. I have successfully set up the geofence using theSET
command, but when I execute theWITHIN
query, it always returns that the user is outside the geofence, even when the coordinates should be inside the defined area.Here are the details of my setup:
Code:
The text was updated successfully, but these errors were encountered: