Woking Liberal Democrats

Magic Sort

This web application is intended to fill a gap in the functionality offered by Connect when sorting address lists for target mail shots. Particular difficulty is experienced when attempting to sort addresses in walk order. The Walk Manager tool built in to Connect is cumbersome to use except in the simplest of cases.

In the Woking party we have found that it is more efficient to export lists using one of the standard walk orders and then to produce the target mail off-line using Excel and Word. This application offers a more powerful alternative to Connect's Walk Manager, in that it has the capability of sorting address lists for any walk accurately using geographic coordinates, that are almost universally available through use of the Post Office Address File (PAF).

This is an interactive tool that operates independently from Connect by providing a universal mechanism for sorting address lists by automatically discovering a "walk order" for each road using the geographical coordinates of the road and the houses along it. This process is not effective in all cases so a default sort algorithm is available which sorts address lists alpha-numerically with intelligent parsing of house numbers (where present).

The tool can be used on an as needed basis. Each walk that is defined using the tool is stored in a database, so that once a walk order has been discovered it can be downloaded any number of times without further work or incurring further look-up charges. This approach has the advantage that a "library" of sorted walks can be built up over time and recognises that in the baroque world of postal addresses there will always be exceptions to catch you out!

The tool allows walks to be defined or modified using a map assisted mechanism. Download options can be adjusted for each walk to take account of where the walk starts and whether it is completed in a round-trip (up one side down the other!) or in parallel (each side covered by a different person!). Walks that involve a backbone with roads off can be downloaded (optionally) as if it were a single continuous path.

  1. Create Walk
    On Walks Index page, click the Create New link. Select the Polling District. Note: Pre-requisite for Admin to seed the database with a list of Polling District names. Enter a Walk Number (helps to make this match the equivalent Connect Walks Manager number). The combination of Polling District and Walk Number uniquely identifies the walk. Enter the name of a road which belongs to the walk. A walk can be made up of any number of roads. In the From and To fields specify a range of house numbers (optional). This feature is provided because some roads encompass more than one walk. Post Town is important for looking up house addresses (see later). For example the Woking constituency comprises several "towns" which have historic postal significance like West Byfleet, Knaphill etc. Post Code is essential to localise postal address file look ups. Leave the DownloadStart and DownloadPath fields in their default for now - they can be edited later - more info in Download Sorted Lists.
  2. Define or Modify Route

    On the Walks Index page, select the Polling District that the walk belongs to and click Apply Filter. Note: if one or more walks exist then this list will be populated. Look for the walk whose route you want to define or modify, identified by Road Name. Click the "Binoculars" icon. If no route has been defined you will see a button in the section Walk Locations labelled Create Route. Click this button. A Google map pops up, centred on the specified road.

    Use the navigator to zoom in a bit. Notice the check box at the top of the map which is set by default to Automatic Route Mode. In the Automatic mode, points added to the map will be used by Google Maps to automatically calculate a route. This is usually as simple as clicking on the map in two places - the first click specifies the origin of the route and the second click specifies the destination of the route. Sometimes you need to add additional points to remove ambiguity (for example in circular roads or crescents) but the best results are obtained by keeping the number of points to a minimum. Each time the map is clicked another point is laid down. They are numbered consecutively as you go. Points can be adjusted by dragging them. To delete a point, click on the pin and then click Remove Location. The point will be removed from the map and intermediate points renumbered automatically. When you are happy with the route, click Save and Close. You are returned to the Walk Details page, where you will now see the list of points along the route that have been created automatically by Google Maps. Click Display Route to check the result on the map.

    If you want to change the route at this stage it is necessary to close the map and click Delete(All) and then start again.

    In some cases, the automatically generated route is not good enough. This is typically because the actual walking route extends beyond the geographic bounds of the road (as defined in Google maps anyway). Also the road way may not represent the actual route you would take if walking along - such as in a close or cul-de-sac with a bell end. In these cases, discovered by trial and error, it is better to change to Manual Route mode by deselecting the check box at the top of the map. You can now define points along the route that you would actually walk - again keeping the number of points to the minimum for best results.

  3. Add Houses
    Usually this follows on from the previous step when defining a route. Alternatively, on Walks Index page, select the Polling District that the walk belongs to, click Apply Filter, find the road name in the filtered list and click the "Binoculars" icon. Expand the Houses section. If no houses have so far been defined, click the link Create List of Houses. On the next page, enter any houses you want to exclude - sometimes necessary. Click Create. Expand the Houses section again. This time you should see the list of houses, in the address range defined in the Walk (From ... To) and exluding any that you filtered out in the previous step. To view the houses along the walk on the map, click Display Houses. Note that the houses are already sorted alpha-numerically, with intelligent parsing of house numbers. You are now ready to download sorted lists.
  4. Sort Preview
    On Walks Index page, select the Polling District that the walk belongs to, click Apply Filter, find the road name in the filtered list. Click the "Houses" icon to see the list of houses organised in sort order. If a route has been defined, the sort order shown will be a geographic sort organised into three lists: Left Hand Side, Right Hand Side and Orphans. Note that in this context left and right are relative to the route when walking from origin to destination. The final direction of sort on each side will be established when the walk is downloaded using the download options - see Download Sorted lists.

    The Orphans list contains any houses which cannot be related to the route - usually because they are beyond the ends of the route that has been defined. You can correct this by editing the route to extend beyond the orphaned houses. This may require the route to be defined in the manual mode. If a route has not been defined at all, the Sort Preview will show a single list sorted alpha-numerically.

    The Unused Links list contains any links which were found to be beyond the limits of the route defined for a particular walk. These links will not be taken into account when the parent walk is downloaded and will have no effect. They should be removed manually to keep things tidy. The walk that the link refers to should be changed to a "Primary" walk manually by using the walk Edit button on the Index page.

  5. Download Sorted Lists
    For a given walk, if a route has been defined, then the houses will be sorted using their geographical coordinates. Otherwise, the houses will be sorted in alpha-numeric order. In the case where the sort is geographical, the actual order of download is determined by the Download options for each walk. There are two parameters: DownloadStart which can be set to Left Bottom, Right Bottom, Left Top or Right Top. This option determines where the walk starts. Note that left and right are themselves deifined relative to the route path. The second option is DownloadPath which can be either Round Trip (up one side and down the other from the start point) or Parallel (both sides start at the same end). The current settings are indicated by the icon associated with the download link as follows:
    • Parallel-Bottom  
    • Parallel-Top  
    • Round-Trip-Left-Bottom  
    • Round-Trip-Right-Bottom  
    • Round-Trip-Left-Top  
    • Round-Trip-Right-Top  
    • Alpha-Numeric  
    Click on the download button to download an Excel file for the selected road (together with any "linked" roads - see Insert Road Links). The file will be in csv format compatible with Excel. Each download file contains a Seq column which contains the sequence number of each house in the list. To use this file to sort a target mail list downloaded from Connect, it is necessary to add a column to target mail list file which contains a VLookup on the address column of the sorted house list downloaded from this tool. The VLookup formula will return the number in the Seq column as its value. This can then be used by Excel Data Sort to put the target mail list in the required sort order.
  6. Many walks comprise a set of roads linked together and it can be an advantage to download all the houses in this linked system a single sorted entity that can be walked end to end without a break. This can be achieved by adding road links to the lists of houses so that the links occur in the right place in the sort order for the "parent" road.

    Select the Polling District that the walk belongs to, click Apply Filter, find the road name in the filtered list and click Details. Expand the Houses section and click the Display Houses button. The map will be displayed centred on the selected road.

    Locate a side road that you want to link to this road and click on the map on the side road near to the junction with the road in question. You may need to zoom in a bit. A marker will be placed to indicate the road that you have chosen to link in. Repeat for other side roads as required. To delete a link, just click on a pin and click Remove Link on the pop-up menu. Click Save and Close. At this point you will be returned to the Details page. Expand the Houses section and you will see that links have been added.

    Now return to the Details page and click the Sort Preview link. On the Sorted Houses page you should see the links placed in the correct positions relative to the sort order and you can click on the links to navigate to the Details pages for the linked roads. Returning to the Details page for the "back-bone" road, click the Download button and examine the downloaded file. You will see that the houses on the linked roads are inserted (and sorted) into the back-bone road in the correct places to make a continuous walkable route.