| | Order Processing Shipment planning and order processing - including data requirements, line items, ship units, order bases and order releases. |  | 
July 2nd, 2009, 12:24
| | Junior Member | | Join Date: May 2009
Posts: 8
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0 | | | 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? | 
July 3rd, 2009, 05:37
| | Member | | Join Date: May 2007
Posts: 43
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 4
Thanked 4 Times in 4 Posts
Rep Power: 0 | | | 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 | 
July 3rd, 2009, 12:33
| | Senior Member | | Join Date: May 2007
Posts: 146
Groans: 0
Groaned at 1 Time in 1 Post
Thanks: 16
Thanked 5 Times in 5 Posts
Rep Power: 3 | | | Re: Has anyone worked on location based shipment search? not found on the buy shipments > actions ... where have you seen this ...
rgds-- | 
July 3rd, 2009, 12:58
| | Junior Member | | Join Date: Oct 2008
Posts: 12
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 2
Thanked 3 Times in 2 Posts
Rep Power: 0 | | | Re: Has anyone worked on location based shipment search? The action gets listed when event (agent event) is not given. | 
July 3rd, 2009, 16:06
| | Senior Member | | Join Date: May 2007
Posts: 146
Groans: 0
Groaned at 1 Time in 1 Post
Thanks: 16
Thanked 5 Times in 5 Posts
Rep Power: 3 | | | Re: Has anyone worked on location based shipment search? not clear what you are conveying here .....can you explain the navigation to this .......
rgds-- | 
July 4th, 2009, 14:20
| | Member | | Join Date: May 2007
Posts: 43
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 4
Thanked 4 Times in 4 Posts
Rep Power: 0 | | | 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 | 
July 14th, 2009, 10:48
| | Member and Blogger | | Join Date: Oct 2007 Location: Netherlands
Posts: 203
Groans: 0
Groaned at 2 Times in 1 Post
Thanks: 18
Thanked 31 Times in 28 Posts
Rep Power: 3 | | | 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. | 
July 14th, 2009, 15:14
| | Member and Blogger | | Join Date: Oct 2007 Location: Netherlands
Posts: 203
Groans: 0
Groaned at 2 Times in 1 Post
Thanks: 18
Thanked 31 Times in 28 Posts
Rep Power: 3 | | | 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.29578)*sin(l.lat/57.29578)+cos(#LAT#/57.29578)*cos(l.lat/57.29578)*cos((l.lon-#LON#)/57.29578))*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 14th, 2009 at 15:20.
| | The Following 2 Users Say Thank You to LourensGlog For This Useful Post: | |  | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| | | | |