Announcement

Collapse
No announcement yet.

Has anyone worked on location based shipment search?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Has anyone worked on location based shipment search?

    Hi, we are working on a scenario to list all shipments originating within a preset distance radius from a location. i.e., All shipments origination 50 miles from location A has to be listed.

    Has anyone worked on this scenario?

  • #2
    Re: Has anyone worked on location based shipment search?

    Hi,

    If your Location A is fixed,you can make use of an shipment agent to populate a refnum in all the qualifying shipments and make use of that refnum while searching for these shipments.There is a seeded shipment agent action "EVALUATE PROXIMITY TO LOCATION".
    I have not personally evaluated this option so far though.
    Warm Regards,
    Srivathsana

    Comment


    • #3
      Re: Has anyone worked on location based shipment search?

      not found on the buy shipments > actions ... where have you seen this ...

      rgds--

      Comment


      • #4
        Re: Has anyone worked on location based shipment search?

        The action gets listed when event (agent event) is not given.

        Comment


        • #5
          Re: Has anyone worked on location based shipment search?

          not clear what you are conveying here .....can you explain the navigation to this .......

          rgds--

          Comment


          • #6
            Re: Has anyone worked on location based shipment search?

            Hi rj,

            This can be seen as part of the seeded actions present with buy shipment agent.
            Warm Regards,
            Srivathsana

            Comment


            • #7
              Re: Has anyone worked on location based shipment search?

              Assuming you have the long/lats for all your locations in OTM, and you don't mind if the 50 mi is a crow flight distance, then you can take the mathematical route using the Spherical Law of Cosines: d = acos(sin(lat1).sin(lat2)+cos(lat1).cos(lat2).cos(l ong2−long1)).R.
              It may be difficult though to convert this formula to sql within the 801 characters limit OTM allows for Saved Queries, but it's worth a try.

              Comment


              • #8
                Re: Has anyone worked on location based shipment search?

                I took a shot and found out it wasn't that bad after all:

                Create a Shipment Saved Query and put this in Find All:

                select s.shipment_gid from shipment s, location l where s.source_location_gid=l.location_gid and acos(sin(#LAT#/57.2957*sin(l.lat/57.2957+cos(#LAT#/57.2957*cos(l.lat/57.2957*cos((l.lon-#LON#)/57.2957)*3962<50

                Notes:
                - Just replace #LAT# (twice!) and #LON# with the lat/long of your location A.
                - The 50 at the end represents the maximum distance (crow flight) - change this if needed.
                - The 3962 at the end is the radius of the earth in miles
                - The 57.29578 stands for 180/pi and is used to convert degrees to radians. A more accurate statement would have been 180/acos(-1), but if I used this I got 'out of range' errors.
                Last edited by LourensGlog; July 14, 2009, 15:20.

                Comment

                Working...
                X