-
Notifications
You must be signed in to change notification settings - Fork 2
Single Driver Route 10 Stops
Maciej Mionskowski edited this page Oct 28, 2016
·
2 revisions
import (
"github.com/route4me/route4me-go-sdk"
"github.com/route4me/route4me-go-sdk/routing"
)
func main() {
client := &route4me.NewClient("11111111111111111111111111111111")
service := &routing.Service{Client: client}
addresses := []*routing.Address{&routing.Address{AddressString: "151 Arbor Way Milledgeville GA 31061",
//indicate that this is a departure stop
//single depot routes can only have one departure depot
IsDepot: true,
//required coordinates for every departure and stop on the route
Latitude: 33.132675170898,
Longitude: -83.244743347168,
//the expected time on site, in seconds. this value is incorporated into the optimization engine
//it also adjusts the estimated and dynamic eta's for a route
Time: 0,
//input as many custom fields as needed, custom data is passed through to mobile devices and to the manifest
CustomFields: map[string]string{{"color", "red"}, {"size", "huge"}},
},
&routing.Address{AddressString: "230 Arbor Way Milledgeville GA 31061",
Latitude: 33.129695892334,
Longitude: -83.24577331543,
Time: 0},
&routing.Address{AddressString: "148 Bass Rd NE Milledgeville GA 31061",
Latitude: 33.143497,
Longitude: -83.224487,
Time: 0},
&routing.Address{AddressString: "117 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude: 33.141784667969,
Longitude: -83.237518310547,
Time: 0},
&routing.Address{AddressString: "119 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude: 33.141086578369,
Longitude: -83.238258361816,
Time: 0},
&routing.Address{AddressString: "131 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude: 33.142036437988,
Longitude: -83.238845825195,
Time: 0},
&routing.Address{AddressString: "138 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude: 33.14307,
Longitude: -83.239334,
Time: 0},
&routing.Address{AddressString: "139 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude: 33.142734527588,
Longitude: -83.237442016602,
Time: 0},
&routing.Address{AddressString: "145 Bill Johnson Rd NE Milledgeville GA 31061",
Latitude: 33.143871307373,
Longitude: -83.237342834473,
Time: 0},
&routing.Address{AddressString: "221 Blake Cir Milledgeville GA 31061",
Latitude: 33.081462860107,
Longitude: -83.208511352539,
Time: 0},
}
routeParams := &routing.RouteParameters{
AlgorithmType: routing.TSP,
StoreRoute: false,
Name: "Single Driver Route 10 Stops",
RouteDate: time.Now().Unix(),
RouteTime: 60 * 60 * 7,
Optimize: routing.Distance,
DistanceUnit: routing.Miles,
DeviceType: routing.Web,
TravelMode: routing.Driving,
}
optParams := &routing.OptimizationParameters{
Addresses: addresses,
Parameters: routeParams,
}
_, err := service.RunOptimization(optParams)
}
- Activity
- Addressbook
- Routing
- Single Driver Route 10 Stops
- Single Driver Round Trip
- Single Depot Multiple Driver No Time Windows
- Single Depot Multiple Driver Time Windows
- Multiple Depot Multiple Driver
- Multiple Depot Multiple Driver With Time Windows
- Multiple Depot Multiple Driver With Time Windows (24 Stops)
- Tracking
- Geocoding
- Users
- Territories
- Orders
- Vehicles
- Telematics