Use device location services to automatically pick nearest facility/site record

Comments

13 comments

  • Avatar
    Tony Ruth

    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.

    0
    Comment actions Permalink
  • Avatar
    Jacob Shapley

    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.

    0
    Comment actions Permalink
  • Avatar
    Tony Ruth

    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.

    1
    Comment actions Permalink
  • Avatar
    Permanently deleted user

    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

    0
    Comment actions Permalink
  • Avatar
    Darius Grimes

    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.

    0
    Comment actions Permalink
  • Avatar
    Penny Lau

    Darius, you'll be able to do that. I actually have a video about the same thing. I'll send it over to you.

    1
    Comment actions Permalink
  • Avatar
    Penny Lau

    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! 

    1
    Comment actions Permalink
  • Avatar
    Steve VanderPloeg

    Hey Penny, Thanks for putting that together for us.  Very cool and helpful!!

    From what I've tested, this works awesome, and very accurate with iPads!  Now, can you provide a page-level script and example for calculating Bearing?

    0
    Comment actions Permalink
  • Avatar
    Penny Lau

    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;
        }
    0
    Comment actions Permalink
  • Avatar
    Penny Lau

    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

    0
    Comment actions Permalink
  • Avatar
    Steve VanderPloeg

    Hi Penny,

    I finally got some time to test this and couldn't get it to work.  I'm trying to figure it out now, but if you had any updated information on this, I'd really appreciate it.  Thanks.

    1
    Comment actions Permalink
  • Avatar
    Penny Lau

    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.

    0
    Comment actions Permalink
  • Avatar
    Patrick Moss

    Hi guys, just wondering if you ever got this to work?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk