Use device location services to automatically pick nearest facility/site record
We have hundreds of facilities, sites, etc. distributed throughout the state (i.e., it's a HUGE option list). It would be much smoother if there was a location function to do a quick nearest neighbor analysis and picking the facility/site record with the smallest lat/long differences from my location (using location services).
-
Hi Jacob, running with your idea, the Map app gets you the closest store (facility) but it isn't doing anything outside of that (capturing any data), which is where a clean hand off to iForm would be ideal passing in the Facility name.
This way you leverage the right software for the job at the appropriate time. That is not to say that we couldn't build this, but if it already exists in then we prefer to integrate as there is quicker turn around for everyone.
If your facility data lives in ESRI today, then you have a very interesting option to explore with the Collector to iForm integration through custom URL schemes. You would start in collector to refine your selection based on your current location, and then using the URL scheme pass some of the data into a new iForm record and off you go.
If you were at this years ESRI UC you may have witnessed the team showing this off. If you weren't, just sight tight and once iForm 6.4 hits the store in a few hours you would be able to leverage this.
-
Here is a video to show you how to get the distance between two geo points: https://www.youtube.com/watch?v=ounjNTZv8uA&feature=youtu.be Hope it helps!
One step further to that, you'll be able to get the distance between two positions directly and the idea is to parse the coordinates behind the position first and then calculate based on that. We will put together another video shortly!
-
Hi Jacob, what you described sounds like an application in itself which needs to be aware of all your facility names and their locations.
Once you have the facility name, this could easily be passed into iForm either using the custom URL scheme or creating and assigning records through the web API.
-
I suppose it could be, but I think most apps generally handle this internally, like using a map app to find the nearest hamburger joint or park (except they usually have to use routes, not just linear distance). I know it would be an incredibly powerful feature to sort a and pick list based on shortest distance from my occupied point (even if it only displayed the first 10 or so records in the pick list), as long as I provide a "geo" smart table loaded with lat/long coordinates. I imagine this could be a great selling point for field service, utility, oil/mineral companies, and field science/natural resource organizations etc. with hundreds or thousands of distributed sites, plants, facilities, etc. I would also expect that this would be a perfect fit with your current ESRI partnership.
-
Jacob we have seen a few requests for this type of scenario essentially a GeoFence around your current location. i have made a short video that runs through starting in collector and passing a value from Collector to iForm. https://www.dropbox.com/s/byqkbndjlm0wq6w/list%20of%20locations.mov
-
What about calculating the distance between 2 points using LatLong. Example, I want to know the distance from a property to the nearest fire hydrant. The inspector would use the location element at the front entry of the structure, and then use another location element standing at the fire hydrant. The difference between the 2 location points would be recorded in a read_only element in feet.
-
Hi Steve, can you please try below script for calculating bearing and let me know if it works?
bearing : function (lat1,lng1,lat2,lng2) { var dLon = (lng2-lng1); var y = Math.sin(dLon) * Math.cos(lat2); var x = Math.cos(lat1)*Math.sin(lat2) - Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon); var brng = this._toDeg(Math.atan2(y, x)); return 360 - ((brng + 360) % 360); }, _toRad : function(deg) { return deg * Math.PI / 180; }, _toDeg : function(rad) { return rad * 180 / Math.PI; }
-
Guys, check out this video about what you can do in the form using Google Map APIs: https://www.youtube.com/watch?v=7muO98h6eoE&feature=youtu.be
-
Hi Steve, do you want to share your form with me by exporting a form package and send it to my email plau@zerionsoftware.com? I'm happy to take a look for you.
Please sign in to leave a comment.
Comments
13 comments