p5.Geolocate Library - Smallest usable geoFenceCiricle()


I’m building an app for a Poetry Walk through a park using P5.JS and the Geolocate library. I have the basic structure of the app setup but I am having issues with the accuracy of the GPS coordinates. As the users walks through the park they arrive at certain trigger locations, once they reach them a Poem starts to play. I’m using the geoFenCircle() function in the Geolocate library to trigger the Poems. What is the smallest radius that I could use to setup these trigger points? My GPS accuracy is all over the place depending on the day and device used. Does anyone have any tricks to get a more accurate GPS location?

Any help would be greatly appreciated.


1 Like

I suggest you do a little bit of research in google and hopefully other developers have discussed their experiences using geolocate. I don’t know much about gps used via js. In Android, you could have errors from 2 to 5 meters or even more.

Not sure what is your setup, but if you use a generous distance, say 7 to 10 m, you could show an image related to the geolocation point so people know that they should approach this point. Just an idea and hopefully you could use it in your setup.


Try this https://stackoverflow.com/questions/16202077/high-accuracy-geolocation-html5


Thanks kfrajer. The app actually shows the user an image of the location they need to get to but it’s blurred. As they move closer to the location the image comes into focus. My GPS accuracy floats anywhere from 5-40 m but that’s based on the accuracy returned in the object. It’s not a big park and I’m worried about trigger points overlapping if the accuracy decreases. I’m going to try 10 m and see how that works.


I’m curious – how did you testing work out?

Also: is the hardware device that you are using an Android phones, or is it something else?


10 m was what I decided on. Even ff your GPS accuracy is low it has been working pretty well. I haven’t tested the final version in the park, that will happen next week. I can let you know the results if you are interested.

I’ve been using a iPhone 8 & X to do the testing.

1 Like