Sunday 20 April 2014

Somerset Post Offices - interactive map

I've just finished creating an interactive map of the Post Offices in Somerset, with data taken from Ken Smith's list of the post offices in the county (all the UK lists are available here).

My website is available here - it may take a little while to load as it has to perform a fair amount of processing !

What I've done is to take Ken Smith's list in free form text, such as:

Abbots Leigh (Avon) 1837: PP.BRISTOL.  UDC 9-1-1852.  Rubber 1888.  T.O.5-11-1895(ALH).  MO-SB 1-6-1897. Closed 31-7-1974.  Re-open 16-2-1976.  Closed 10-10-1980.
Aisholt                          1835: PP.BRIDGWATER.  UDC 4/1853.  Rubber 1893.  T.O.20-12-1933(AIZ)(discont.2/2/1938). Closed Dec.1947.
Alford                           6-8-1850: UDC: BATH.  By 1883 CASTLE CARY RSO.  T.O.22-8-1893(AOD).  17-2-1920 BATH. 6-1-1941 CASTLE CARY.  Closed 1958/60.

converted it to a structured XML file and inserted the approximate latitude and longitude of each post office (as best I can, some locations are guesses):
  <PLACE>
     <NAME>Abbots Leigh</NAME>
     <LAT>51.462568</LAT><LNG>-2.657652</LNG>
     <TYPE>SO</TYPE><PT>BRISTOL</PT><SD>1837</SD><ED>1974</ED>
     <TYPE>SO</TYPE><PT>BRISTOL</PT><SD>1976</SD><ED>1980</ED>
     <DESC>1837: PP.BRISTOL.  UDC 9-1-1852.  Rubber 1888.  T.O.5-11-1895(ALH).  MO-SB 1-6-1897. Closed 31-7-1974. Re-open 16-2-1976.  Closed 10-10-1980.</DESC>
  </PLACE>
  <PLACE>
     <NAME>Aisholt</NAME>
     <LAT>51.122174</LAT><LNG>-3.122697</LNG>
     <TYPE>SO</TYPE><PT>BRIDGWATER</PT><SD>1835</SD><ED>1947</ED>
     <DESC>1835: PP.BRIDGWATER.  UDC 4/1853.  Rubber 1893.  T.O.20-12-1933(AIZ)(discont.2/2/1938) Closed Dec.1947.        </DESC>
  </PLACE>  
  <PLACE>
     <NAME>Alford</NAME>
     <LAT>51.086187</LAT><LNG>-2.558724</LNG>
     <TYPE>SO</TYPE><PT>BATH</PT><SD>1850</SD><ED>1883</ED>
     <TYPE>SO-R</TYPE><PT>CASTLE CARY</PT><SD>1883</SD><ED>1905</ED>
     <TYPE>SO</TYPE><PT>CASTLE CARY</PT><SD>1905</SD><ED>1920</ED>
     <TYPE>SO</TYPE><PT>BATH</PT><SD>1920</SD><ED>1941</ED>
     <TYPE>SO</TYPE><PT>CASTLE CARY</PT><SD>1941</SD><ED>1960</ED>
     <DESC>6-8-1850: UDC: BATH.  By 1883 CASTLE CARY RSO.  T.O.22-8-1893(AOD).  17-2-1920 BATH. 6-1-1941 CASTLE CARY.  Closed 1958/60.</DESC>
  </PLACE>

and then written some javascript to display markers using Google maps, a brief extract below:

       map = new google.maps.Map(document.getElementById('map'), {
         zoom: 10,
         center: new google.maps.LatLng((51.2, -2.7)),
         mapTypeId: google.maps.MapTypeId.ROADMAP
         });

      for (i = 0; i < offices.length; i++) { 
         // Create marker and hide it
         marker = new google.maps.Marker({
             map: map,
             title: offices[i].name,
             visible: false,
             icon: iconurls[offices[i].iconum],
             position: new google.maps.LatLng(offices[i].lat,offices[i].lng)
             });

Definitely back to my roots as a systems programmer in the 1980s !

The web page has three different types of filters to show just a subset of the offices:
  1. By Date:  specify a Start date and/or an End date and click the "Apply Dates" button.  To reset, blank the date fields and click the button again. Either date may be specified by itself or in combination.  When a Start date is specified, only offices that were in existence after that date are displayed.  When an End date is specified only offices that were in existence before that date are displayed.
  2. By Type:  check or uncheck the "Select Types" check boxes to display or not display offices of that type (the key below the map describes the types).  If an office is of the selected type within whatever date range is specified then it will be displayed.
  3. By Post Town or RSO:  Expand the lists in the right-hand side bar to see the Post Towns, Railway Sub-Offices and Post Towns external to the County.  RSOs that were also Post Towns are listed under Post Towns.  Check the check box next to a Post Town/RSO to just see the offices under it - filtered by date range and/or type if specified.  Check multiple Post Towns/RSOs to see offices under any of the offices checked.  Uncheck the Post Town/RSO(s) to revert back to the whole county display.
The display will automatically zoom to show whatever offices need to be displayed - check the "Static Zoom" check box to freeze the zoom level.  Uncheck it to allow automatic zoom.

Click on any of the markers, or on the underlined links in the right-hand side-bar, to display details on an office in an info-window.

What is it for ?    I don't know yet !   But it is interesting, for example to put in different date ranges for a Post Town like Bath and see the extent of its "patch", for example up to 1840, 1840-1905, 1905-1950, and more recently.  Also interesting to see where the Railway Sub-Offices were (select RSO and SO-R by type).

The webpage would work for any County if someone creates the XML file - I've created a mainly empty one for Dorset with data for just a few Post Towns (all the other offices in Dorset are there, under "External Towns" / "undefined" but haven't had their data created).





No comments:

Post a Comment