Bulk Route Uploader – Command-Line Automation Tool
Route4Me’s Bulk Route Uploader is a command-line app that allows you to automate the process of optimizing routes with hundreds of thousands of addresses using the Terminal on your Windows, macOS, or Linux computer. To start using the Bulk Route Uploader, first, download the app to your computer and place it into the same folder with the following files:
- The Route4Me Bulk Route Uploader application file;
- Optimization files in the JSON file format;
- Route data file(s) (CSV spreadsheet(s) with addresses that you want to optimize).
Optimization files (in the JSON file format) contain the optimization parameters that are applied to the route data file(s) (CSV spreadsheet(s) with addresses) that you want to optimize. To find more Route4Me JSON optimization code samples, visit this Route4Me GitHub page.
Route data spreadsheets must be in the CSV file format only. For a spreadsheet to be successfully optimized, it must contain a header row and data rows. The header row defines the type of information you are optimizing, while the corresponding data rows contain the actual data that is being optimized. To learn more about Route4Me’s spreadsheet requirements, visit this page. NOTE: In addition to the obligatory “Address” column, when using the Route4Me Bulk Route Uploader, the spreadsheet you want to optimize must also contain an obligatory column that groups all addresses in the spreadsheet into one or multiple routes. In the example below, the “Route” column groups all addresses with the same ID (“Los Angeles Route 0001”) into the same single route.
To optimize a CSV route data file using the Route4Me Bulk Route Uploader, after placing all the necessary files into the same folder, open the Terminal on your Windows, macOS, or Linux computer and then insert the following snippet of code into the Terminal:
Parameter/Argument | Example Value | Description |
---|---|---|
-f | Route_0001.csv | The name of the CSV route data file you want to optimize. |
-p | optimize-existing-routes-8hrs.json | The name of the optimization (JSON) file that contains the optimization parameters. |
-g | Route | The name of the grouping column in your CSV route data file. |
-k | 11111111111111111111111111111111 | Your Route4Me API key |
- The name of the directory/folder with the Bulk Route Uploader, optimization (JSON) file(s), and CSV route data file(s) that you want to optimize (path to the directory/folder);
- The name of the route data file with the addresses that you want to optimize;
- The name of the optimization (JSON) file that contains the optimization parameters that will be applied to the selected route data file;
- Your Route4Me account API key. When you are optimizing routes using the Route4Me Bulk Route Uploader, all optimized routes are automatically synchronized with the Route4Me account, the API key of which was inserted into the corresponding code.
To find and copy your Route4Me API key, first, log into your Route4Me account, go to “My Account” from the navigation menu and then select “API” from the list (learn more). After that, you can copy your Route4Me API key accordingly.
5. The grouping column from the CSV route data file which is used for grouping the addresses in the route data file into one or multiple routes. In the example below, the “Route” column groups all addresses with the same ID (“Los Angeles Route 0001”) into the same single route.
After inserting the code with all the necessary arguments and values into the Terminal, hit enter/return to execute the code. After that, the Bulk Route Uploader will geocode all addresses in the corresponding CSV route data file and plan/optimize one or multiple routes (depending on the number of unique IDs in the grouping column) based on the parameters defined in the used optimization (JSON) file.
Once the CSV route data file is optimized, the Bulk Route Uploader will automatically create two folders in the parent folder of the Route4Me Bulk Route Uploader:
- The “Log” folder contains the log file(s) of the entire optimization process;
- The “Output” folder contains the file(s) with the optimized route(s).
Once the route is optimized using the Route4Me Bulk Route Uploader, this route is automatically synchronized/uploaded into the Route4Me account, the API key of which was used for the optimization. To view and open the optimized route(s), log into your Route4Me account and then go to “Routes List” from the navigation menu.
The planned and optimized route inherits the same name as the ID value that was used for grouping addresses for this route in the optimized CSV route data file.
To plan multiple routes from a single route data file, you need to distribute all addresses in this route data file to different routes using unique IDs in the grouping column. To do so, in the grouping column, define a unique ID for each address, where the addresses with the same ID will go to the same route. In the example below, all addresses with the ID “Route 0001” will be added to the same single route. In the example below, there are 4 different address IDs defined in the grouping column, meaning that 4 routes will be created from this spreadsheet and the addresses with the same IDs will go to the same routes.
Once the routes are optimized using the Bulk Route Uploader, these routes are automatically synchronized/uploaded to the Route4Me account, the API key of which was used for the optimization. Each planned and optimized route inherits the same name as the ID value that was used for grouping addresses for this route in the optimized route data file.
Visit Route4Me's Marketplace to Check Out More Add-Ons and Modules:
- Route Optimization
Address Book and Territories Planning
- Operations
Custom Data Add-On