Monday, 23 April 2018

Otago Central Railway [61M]: Cromwell-Alexandra 10

Last time I wrote about the process of fixing up overlap issues in the Linz aerial photography background tiles, specifically with relation to the Cromwell Gorge section of the maps, which is about half of the total distance from Cromwell to Alexandra. The work on that has comprised Steps 1 to 9 out of 10.

Step 10 is the optional, and more intensive, part of the work. Because all the retro aerial layers have been scaled to fit the 0.75 metres per pixel aerial photography layers that were used at the time. I have two choices. The harder one by a great many times is to rescale the aerial layers to fit the new tiles, although the tiles have the same number of pixels, 0.4 metre pixels are quite a bit smaller, and therefore each tile in the 0.4m resolution occupies less physical space when displayed on a map. This is all set out in the world file (.jgw) which I mentioned in a previous post, because this tells the map software the size of each pixel, and therefore how much area it needs to display the whole layer.

The other, much simpler, option, is to rescale the 0.4 m tiles to the same proportions as the 0.75 m tiles. This means each of the higher resolution tiles gets rescaled to 2560x3840 compared to the original resolution of 4800x7200. Once this has been done they can all be properly lined up and joined just as the regular tiles are. Given the size of the original tiles I have opted to merge the resized layers in side by side pairs into one layer, because it simplifies things like copying the masks. Copying a mask from one tile to another is fortunately quite straightforward, and just as it has been necessary to line up the first layer on the 0.75 metre layer underneath, the mask needs to be lined up on the original as well. So doing it this way although somewhat fiddly is probably a lot easier than realigning all the aerial photo layers that don't inherently line up, because the maps tiles do inherently line up and once I have the first ones aligned then I can just drop in the extra ones and line them up on the first ones. 

Once having got the 0.4 metre tiles all in place and the masks copied across then the next step is to export the tiles on the 0.75 m boundaries which lets us use their original world files to specify the placement and size of the layer. So the new layers will be 4800x7200 and will actually be the 0.75 m tiles with the 0.4 metre tiles overlaid on top of them, and using copies of the original masks in the new layers to ensure the retro aerial content is still visible exactly the same way.

If you look closely at the above image you can see the greenish original layer at the very top, with the brownish high resolution content most of the way down and some more of the green stuff at the bottom, that shows how the tiles are overlaid onto each other. A couple of gaps can be seen at the bottom where I have to fix some mask positioning issues but it should be OK.

Sunday, 22 April 2018

Otago Central Railway [61L]: Cromwell-Alexandra 9

So I am doing the tile merges in Gimp to fix up the tiles that are in two pieces with overlapping black borders so that I can use the latest and greatest quality Linz aerial photography of the entire line. This requires a number of different steps, these are as follows:
  1. Find two overlapping tiles in Qgis
  2. Line up the tile images in Gimp
  3. Add a mask to one of the images
  4. Use the Gimp select by colour function to select the black border on the masked image
  5. Edit the mask by filling in the selected area with black, this makes it transparent
  6. Line up the images so they overlap properly
  7. Merge the two layers so that the resulting layer is 4800x7200 pixels. It may be necessary to undo and realign if the result is slightly too tall or short.
  8. The next step after Gimping the tiles is to fix the .jgw world file for the merged layer. This involves combining values from the overlapped layers' .jgw files and probably also using the adjacent tiles' .jgw files for guidance. I have to find out just what the format of this file is to ensure I can put the right values into it.
  9. Once all the tiles are merged and aligned on the canvas I follow the usual procedure to export each merged tile to a new file. Then rename its sidecars to match.
  10. An optional final step to look at is re-rendering the historical layers over the 0.4 metre aerial imagery (they were originally done using the 0.75 metre imagery before I worked out how to fix the overlap issues with the 0.4 metre tiles). Since the different tiles don't magically line up, it will be a case of visual realignment between the 0.75 metre and 0.4 metre tiles in the same way as was used to line up the historical layers to the 0.75 metre aerials. Hopefully this will turn out to be a fairly routine step but I have left myself with an out of just putting the 0.75 metre tiles where used over the top of the 0.4 metre tiles if it gets too time consuming because fixing all the issues with the aerial photos for this section of the route has taken a lot more time and effort than originally expected.
Here is an example of what is completed so far in Gimp:

As can be seen here the overlap of the older (lighter) and newer (darker) imagery is on an angle rather than a straight line, for reasons best known to Linz. If you were to zoom in on the overlap boundary you would discover some bits of black still in there because removing all of these is not possible and I am finding even with some of the contiguous stuff I have downloaded there are small overlap gaps between adjacent tiles so the imagery is not perfectly aligned all of the time. It is, however, much better than Google Earth in this respect and I can tolerate these small errors as such.

Project Development: Aerial Photography Selection

Progress on the OCR maps has been slow this week because of other work. As far as the maps go, work on the Main South Line maps around Dunedin has been a greater priority. I had an enquiry for the maps around Dunedin Locomotive Depot and it was decided at the same time to download the full section of the 0.125 metre LDS coverage for the suburban area of Dunedin. This covers the MSL from about Owhiro at the south end, to as far north as Warrington at the north end, but inexplicably omits around 4 km in the Mihiwaka area. 

As usual after assembling together the areas covered by several different downloads totalling about 12 GB, selecting the images actually needed using Qgis has been the time consuming aspect. This time around instead of manually copying the files, which has always been a problem because some are always missed, I spent a bit of time extracting the filenames and running them through a simple PowerShell script to copy them to a new folder. Although there are several manual steps needed to get the list of filenames, with more work I hope to get to a stage of automating more of the process starting from saving the list of files as a layer definition file (*.qlr) as there is a lot of aerial photography I need for various aspects of the overall maps project and the selection of just the files needed for rail corridors will save a lot of disk space on MainPC where the files are stored for use in the maps. 

The process for the files for Dunedin is a typical example as the selection and copying process reduced this from nearly 1200 individual rasters down to about 250 saving about 10 GB of disk space on this small area. Whilst most of the areas being covered will not be at such a high resolution, it is to be appreciated that there is a great deal of aerial photography now required for the entire country and this does use an appreciable amount of disk space on the computers so anything which can be done to reduce this disk usage is very valuable.

Whilst I have spent a lot of time optimising the disk usage for this project, some of the other projects also need this work and after Otago-Southland project there is also the CWNM project for the rest of the South Island that I worked on recently with the Addington coverage. There is a large volume for the Main North Line that currently totals some 5000 individual rasters occupying 53 GB of disk space. Another example is the coverage needed for the Napier-Gisborne Line, a future aerial project example I have done some preliminary work on where I have obtained Retrolens aerials for many stations and LDS coverage for Napier-Waikokopu which is around 1000 layers gross and needs to be graded down to just the corridor which will be much less hopefully. As time goes on naturally there will be further usage around the country which will keep things happening.

I have also recently had an enquiry about the coverage of parts of Southland and I think there will not be a lot of the area covered. Once the Central line maps have been completed the other section required for Volume 12 is the Kingston Branch and it is natural I will want to look at maps of this line because I would want to proceed to assemble the complete volume for the PDF. 

The Kingston Branch started originally at Invercargill and ran to Kingston over a total length of 140 km. There is good Retrolens aerial coverage of only a few stations. It is possible I will do mosaics for Invercargill, Makarewa Junction, Winton Junction and Lumsden Junction, and as this line also has a few branches then there is the possibility of adding in Mararoa and Mossburn from the Mossburn Branch, Gore Junction from the Waimea Plains Railway, Thornbury Junction  and Tuatapere from the Tuatapere Branch and Wairio from the Wairio Branch. 

Since I have been asked about Southland in general the other areas for mosaics (subject to availability) could include Bluff, McNab Junction and Edendale Junction. These fall under the MSL which is Volume 11.

After all that, I will carry on with the Otago Central in the coming week with the Gimp editing of the coverage for Alexandra to Cromwell being the high priority so that the maps for that section can be generated, and as previously mentioned I just need to add in some detail of Alexandra itself. There are not any new aerial images presently available around Alexandra. It seems the scanning of the Otago region is very slow as they have not yet added the survey that I used of the Cromwell Gorge, although other surveys are available.

Thursday, 12 April 2018

Otago Central Railway [61K]: Cromwell-Alexandra 8

Well this series of posts [61] is turning into a series about Cromwell-Alexandra really. There is still a surprising amount of work needed just to finish this first section of the maps as they correspond to the article series. It is being pushed ahead as fast as I can go but I have to admit it is a lot of work and has taken longer than expected. I have been surprised at the number of issues to be resolved. Fortunately it is coming together but it would not surprise me if it takes the rest of this year to complete those maps, which originally, optimistically, I had planned would all be completed with the articles.

The work still to be done is a mixture of aerial photos and map data. If I had stuck to just plain maps (diagrams as I now call them) then everything would be completed by now. Bringing in the aerial photos has added complexity and time delays, but I would not have it any other way now, because having the aerial data makes it possible to draw the track and structure layout in a yard accurately and other historical information can be viewed as well. In other words, the maps have gained immeasurably through having the aerial photo background available. The detail there means we don't need to use Google Earth as an alternative or anything to do with Google Earth at all, with all its limitations and complexities of its own. 

Anyhow, the past few days have been focused on collecting all of the aerial photos for the entire Otago Central Railway from Wingatui to Cromwell. It looks like this data set will be 2-3 GB in total, which is a far cry from the total space taken up for all the aerial photo layers I have, by only copying the images corresponding to the actual corridor back to mainpc. Right now I am working on Wingatui-Middlemarch as the aerials are broken into four groups corresponding to the article parts (Wingatui-Middlemarch and Middlemarch-Ranfurly are two distinct aerial photo sections whilst they were both covered in one article part in the NZRO series). 

This gives me an idea of how much work I need to do to get all the aerials fixed up as there are several instances where there are overlap problems. Basically there are in each case two different aerial series that overlap, usually from different years, sometimes from different resolutions, and for some reason the chosen boundary is not along the edge of the aerial tile, so extra black bits are added. If the black pieces are cut off in Gimp then I can actually align the tiles so there is no unsightly gap, and then render out custom versions of each tile to go back into the maps. I expect to start doing this in the Omakau-Cromwell section today, but I need to use the full map in Qgis to guide this, and so getting the map fully there with all the aerial photos will enable this work of editing specific tiles to get underway properly. Doing this means all the maps can use the higher resolution imagery of 0.4 metres minimum, or in some cases 0.125 metres (all of Middlemarch-Wingatui section) instead of the 0.75 metre stuff I used during some of the earlier mapping stages.

Tuesday, 10 April 2018

Otago Central Railway [61J]: Cromwell-Alexandra 7

The following are what the maps for Alexandra will now look like.

However the completion will take a few days as the following tasks have to be finished:

  • Review all the plans and data I researched for Alexandra last year.
  • There will not be a historic aerial photo for Fulton Hogan because it is a lot of work for one small area where the aerial photo is low resolution.
  • A few issues have to be fixed in Gimp with some of the aerial imagery obtained from Linz where two series overlap. For some reason the boundaries of these series are not aligned exactly north-south or east-west so their server adds black edges. The solution is to pair the images either side of this border up in Gimp and overlap them properly then re-render the two images.

Sunday, 8 April 2018

Otago Central Railway [61I]: Finishing Maps - Cromwell-Alexandra 6

A view of Alexandra in 1958:

Facilities like the works depot and the fruit loading shelter did not exist then. The APB site which they had just about taken over from the freezing works, was much less developed. There were still four houses in the precinct, and a trolley shed was located at the Cromwell end of the yard.

In 1965 the main change was in the APB area and also buildings in the lower left corner which was leased to the Electric Refrigeration Co.

By 1983 we have the Way and Works depot completed and a different building at lower left, perhaps a transport company, we have the fruit loading shelter (by then disused) and the bigger area of the APB site being used with stacked pallets clearly visible.

Unlike Ranfurly, in the post rail era, much of the Alexandra yard has been built on. There were opportunities for the local community to have sought to conserve a greater amount of the historic infrastructure, but to their later regret, none of the buildings still stand, only a couple of houses, some foundations and the main platform are to be found today.

Friday, 6 April 2018

Project Development: Site Styles

This is a very small note about map styles. I have used fills to mark out specific sites of premises which are being served by rail.

The issue is that marking the boundaries produces visual clutter on the maps and this has to be weighed against the value of marking it.

My feeling at this moment is against marking out a site's boundaries as opposed to putting a marker in the middle of the site or marking a specific building and leaving it at that. I think that is what the updated Otago Central maps will show. The maps I did of Addington Workshops didn't have a marked site boundary. I think that is what they will all look like.

I will also be limiting the number of non rail buildings I draw on sites in future. These changes collectively will reduce the amount of time I spend on drawing maps. 

Otago Central Railway [61H]: Finishing Maps - Cromwell-Alexandra 5

Having moved on to Alexandra, here is a screenshot with the 1983 aerial displayed.

The aerials for Alexandra done so far do not need major work done. All that is needed is to adjust the masks to show the oil company sidings and Vacuum Oil on the historic imagery.

The other thing is to try to find if there are any new higher quality aerials of the area where Fulton Hogan's site is, further north on Dunstan Road. The diagram of the siding was done using a fairly low quality aerial and a plan from Archives NZ. I can't release the plan on the same license as the rest of the maps without ANZ consent, so I may just use that low quality aerial if there is nothing better in Retrolens as of now.

Otago Central Railway [61G]: Finishing Maps - Cromwell-Alexandra 4

Having completed the revision of Clyde the focus will now shift to Alexandra. Once this is complete then the full set of maps for Alexandra-Cromwell can be republished on Google Photos via the NZ Rail Maps Volume 12 collection on Google Plus.

Here are three views of the second Clyde yard: 1977, 1981 and 2013.

 While here are two views of the first yard: 1962 and 2013.

Thursday, 5 April 2018

Otago Central Railway [61F]: Finishing Maps Cromwell-Alexandra 3

Last time I wrote there were some problems with the aerial photo layer I used to do the Clyde stations. This is a particular hazard with the use of the old aerial photos that are not orthorectified. It was more productive for me to create a completely new aerial photo layer project for Clyde than try to fix the existing ones but it still took most of two days, but that is just a learning curve for this type of thing, as these were some of the very early photo mosaics I have done. The net outcome after a couple of false starts is good, but there are some alignment issues in less critical places that are still visible but not relevant directly to the rail lines, because it's impossible to completely eliminate all of these. 

Here are three views of the new Clyde station and surrounds:

 1977, NZED siding, no station.
 1981, station, MOWD depot and siding
2013, as it is today.

Tuesday, 3 April 2018

Otago Central Railway [61E], Main North Line [11L]

So this is what is finalised for the fill styles.

These two of Addington show the styles for buildings and structures.

This one of the second Clyde station shows the site border styles which are dash-dot patterns. I am working on fixing up the aerial photos which turn out to be correct for 1977 (shown above) and just need some adjustment for the 1981 period, so that I can finish the maps for Clyde and move down the line to Alexandra. I don't actually use sites all that much on maps as it is, and may well look at ditching them for smaller areas as the visual clutter from the extra lines is something I want to reduce, especially at smaller scales.

Sunday, 1 April 2018

Otago Central Railway [61D]: Finishing Maps - Cromwell-Alexandra 2 / Polygonal Styles 2

Below are two samples of Cromwell and Clyde which show the type of styles I am adopting for buildings, structures and sites.

These samples show how the new styles are applied to fills such as sites, buildings and structures. This has come about because whilst I already worked out how to apply a white border to markers and path styles, making them more visible on dark or diverse backgrounds such as aerial photos, it is only just in the last couple of days that I worked out how to do this with fills.

The idea of changing from solid fills (black, grey or white) to transparent fills with a solid border, is to enable whatever is underneath that fill to be visible, which often is what we want with aerial photography whether historic or current. The solid fills blocked out too much of the detail and that was one deterrent to making more widespread use of aerial photography as a map background. In the styles you can see above, I still need to do some experimentation with different line thicknesses and dash/dot patterns to see what works best.

This means that a "rail map" by default will have the aerial photography background whether current or historic, so that is the definition to be used. A "rail diagram" will be the same map data but with a plain or faint background, usually a terrain relief layer. This high contrast option will enable more topographical data such as contours, heights, waterways, property boundaries and so on that doesn't display well against aerial photography, to be viewed, because I am not changing the styles of every piece of this data to make it visible against all backgrounds - because I want to reduce the clutter on "rail map" tiles.

As I have all but finished Addington I will be again focusing on the Central line to complete the maps which still have a lot of work needed. So far I have got from Cromwell to Clyde. The more complex stations like Clyde and Alexandra which both need a lot of tidying up will take a bit of work. Most of the other detail back to and including Ranfurly is completed. From Ranfurly down to Wingatui still needs a lot of detail and will probably take a month or three depending on what else I am working on at the same time, as I also want to push ahead more or less simultaneously with MNL, or alternating bits of both.

After playing with the styles a bit more this is the best compromise I can come up with.

Obviously we want the lines to be as undominating as possible but if they are too thin then it is too hard to tell the difference between a black line and a grey line so the thickness of the lines is the minimum as shown here and this map is another which illustrates the key reason why changing these styles has been desirable in the first place. This has been a very difficult issue to resolve over many months so I am quite pleased to have got a workable solution that now allows me to get the best possible result with the use of aerial photography backgrounds on maps. The single lines (solid or dashed) are used for buildings and structures, while double lines (solid or dashed) are used for sites.

What you can see in the image of the modern Clyde yard further up this post is noticeable misalignment in the 1977 aerial photography. The mosaics for the second Clyde station area were produced as separate Gimp projects for each generation, which is not now I would do things today as I would have put all the images into one project and just turn different layers on and off to get the required results for each rendering. This means the next stage is to do another Gimp project this time using all the aerial stuff in one project and rendering the different generations out of that one project. So work has to start on that right away as the Otago Central Railway maps have to be finished ASAP.

Main North Line [11K]: Addington 11 / Polygonal Styles 1

Some samples of the workshops site. The styles still have to be finalised before these are released on the website.

The main style that needs to be finalised here is the building outlines, because the styles have been previously designed for diagram use with a plain white background and therefore have a solid black or grey fill, now I need to decide if I just use a solid border and transparent fill as shown here. I have just worked out how to style fills with an outlined border with a white edge so the border can clearly be seen, so that is about the last style element that needs to be outlined to make sure it shows up on an aerial photography background.

Having solved this technical issue with fill styles, I can now determine that the maps will be called "rail diagrams" and "rail maps" and the former will be the plain white background, the latter will be on aerial photography. So every map will be produced with an aerial photography background because of the free reuse of the Linz aerial photography being possible. I think it is likely I will come up with a thinner border style for buildings if I decide to use a style similar to the above instead of a solid filled rectangle style. The thicker style will continue to be used as now for sites.

The below is the likely building/structure style to be used. I like the open circles for turntables.

Saturday, 31 March 2018

Main North Line [11J]: Addington 10

As of now here is what has been drawn excluding Plant Zone and the workshops. Apart from adding those areas, generationalising all the track (checking to see how much still exists today) is another task to be completed.

I have decided to draw all the yards from scratch (compared to the stuff I did in GE not that long ago) but won't be doing multiple generation aerial photos unlike the way I did it previously. If multiple aerial photos exist they will be used to help draw in extra tracks but there won't be multiple backgrounds the way they have been done in Otago Central and one or two other areas as putting them together takes a lot of work. So the MSL from Lyttelton to Templeton will all be done from scratch because the mosaics give me much more accurate placement of track if they are done properly, and therefore saves me from having to line up all the previously drawn track to the Linz aerial photos.

Friday, 30 March 2018

Main North Line [11I]: Addington 9

I have now refactored and re-rendered all the geojpegs for Addington and have started working on the maps. Along the way some issues have been found with the masking on the composite mosaics requiring some further refactoring and re-rendering. However this isn't serious enough to affect maps, it just affects the background when they are printed out, so with a second computer available for the editing it means I can work on mapping at the same time without slowing that down.

Working with two screens side by side to get the views of historic and current aerial imagery simultaneously.

Tuesday, 27 March 2018

Main North Line [11H]: Addington 8

Selwyn Street, Christchurch.

Main North Line [11G]: Addington 7

This is just a quick progress update. The refactoring is progressing well but the week is busy (week before Easter) with other things so not much is going to be done over the next few days. As my goal is to have all three pieces of Addington completed before doing any maps, it could be another week before any maps start to be produced.

Sunday, 25 March 2018

Main North Line [11F]: Addington 6; Otago Central Railway [62B]: Km Pegs 2

So Addington is being more or less recreated from scratch. Doing the adjustment in the middle part (Addington North as it is called in my computer) covering the Main North Line going north to Riccarton was actually relatively quick and easy to fix, as with all the linked layers, moving one moved all the others, and no scaling was needed as the amount of movement needed was relatively small. The problem is, the other two extremities going east and west on the MSL have to, in effect, be hung on each side, as everything has to line up and be as smooth as possible joining up on the edges. So I have been working since then on the western side, starting with the middle part and adding things onto the left hand side of it, the base imagery and followed by the aerials that are needed to do this. 

The first aerial, 2345-B-3, is actually needed for the middle part at the extreme left hand edge, just a little tiny sliver on the side of 2345-B-5 because it doesn't quite reach the boundary of the geojpeg for that part. The rest of B-3 will make up the West project, as soon as I finish getting it set up for the North part, I then save the North project as West and then add in the rest of the stuff for West. It takes time because even on my main computer with 24 GB of RAM, these are big files for Gimp to handle, and so moving stuff around is slow work. The biggest advantage has been to be able to copy in layers from the previous versions of Gimp projects which saves a lot of time rescaling and rotating the layers from scratch. So it will come together a lot quicker than the projects last week, and I can use my second computer with 16 GB of RAM to do the rendering at the same time as working on the main computer to move the layers around. But it will still take until sometime next week to have it all back together again.

The rest of today has been working out the issues with the published articles in the NZ Railway Observer to write a complete list of them, which is currently being assembled as another post, and to inform the actual letter that will be sent to the the editor of NZRO; and doing a km peg list for the rail trail, using their street view imagery and marking the pegs on a Google MyMap. Right now I have discovered two 70 km pegs at Ngapuna. This raises the question that the rail trail trust has been putting in missing pegs and if so how accurate can they be assumed to be. The reason for doing these km pegs on a map is mainly to inform the discussion about the editing of my articles in NZRO. It does look like the rail trail trust could be taking pegs out and putting them in because I have not yet found one single half kilometre peg anywhere along the trail to date, but in a few locations I have spotted half km pegs with numbers attached to them. If the rail trail trust are putting in pegs the question is just how accurate their measurements are and perhaps they would like to explain the two pegs at Ngapuna.

Saturday, 24 March 2018

Otago Central Railway [62A]: Kilometre Posts on the Rail Trail

The Otago Central Railway maps incorporate full mile post indications for the entire length. The positions have been derived from various information in the chainage books for the line and by estimation these positions could have an error of plus or minus 100 metres.

Recently I have obtained additional information from Geoff Mackley that has enabled me to locate all of the kilometre and half kilometre pegs on the Taieri Gorge Railway up to 45 km.

The kilometre pegs for the rail trail are visible in the Google Maps Streetview data for the line. Due the onerous terms of Google Maps I believe I cannot release these locations under the Creative Commons license for the maps project. I therefore am creating two separate resources to show the locations of these kilometre pegs:

2. A separate layer in my maps which can be turned on and off as required. I will use this for internal purposes but it cannot be published under the same license as the rest of the maps.

Currently in order to get this aspect of the project started I have added a few km pegs from the first section of the trail from 64 km at Middlemarch as far as Ngapuna at 70 km. The remaining posts will be added at the same time as the overall map revision, which is currently (starting from Cromwell) up to Clyde.

Main North Line [11E]: Addington 5

Well, Friday has been a whole lot more mucking around to make various adjustments to all of the Addington stuff, mainly in the area of adjusting the masking for the partial images. This has resulted in needing to re-render all the partial map tiles which is a relatively slow process. Hence the maps have not been ready in time as expected. There are still more adjustments needed where some of the tracks don't line up, so it will be several more days before mapmaking can really get underway. Here are a couple of sample images that many readers will appreciate for their historical context.

The familiar present day view of Addington with a few extra things drawn in for context.

The historical context with present day roads and tracks.

Main North Line [11F]: Addington 6

Today's not-news is of yet another hold up in mapping.

Because I made the stupendous discovery that some of the tracks aren't lined up between the old and new aerial images.

Unfortunately the nature of historical aerial imagery means that this is a risk. It's my regret that the process I used did not pick up that alignment issues were possible with the tracks in more than one or two places (the edges of the east and west ends of Addington).

Since this affects the middle part and every other part is aligned off it, this means I virtually have to start again from scratch with the middle part and then realign everything else off it.

I hope this won't take too long but the reality is that it could take another week. I will try to see if I can speed things up with two computers at once but I am not at all sure this could happen. 

Letter to the Editor of the New Zealand Railway Observer

Concerning editorial changes made to submitted articles to the New Zealand Railway Observer.

During the last three editions of the New Zealand Railway Observer (No.346-348) I have had published a series of articles entitled "The Geography of the Otago Central Railway". I enjoyed writing these articles and sought in the process of this to provide another look at this railway line and the present day relevance of it. The research behind these articles has been a part of the NZ Rail Maps project, and the maps produced by this project are a key part of the information process that has been used to produce the article series.

I regret however that I must put on record at this point my concern at certain editorial changes that were made to these articles after they were submitted for publication. These changes were made without consultation with me, and in the main are preoccupied with an obvious editorial prejudice against imperial measurements of distance such as miles. There is no legal requirement to use metric measurements of distance in the context of publications such as these, and overzealous conversion of imperial measurements results in many absurdities in written work that I have read from a variety of authors and publishers over many years. In this case the simple metrication of imperial distances fails to understand the historical differences between these measurements as they were used on the railway system of New Zealand.

The articles which I submitted used metric measurements where appropriate, and imperial measurements where appropriate. The following are the key objections I have to the metrication of the entire article:

1. It is impossible to describe a milepost as a "1.6 km post". There is no such thing as a physical post that was put into the ground alongside a railway at 1.6 km intervals. Thus, the line of my article reading for example "Between 38 and 39 miles" which has been changed into "Between 59 and 62 km" refers to actual different locations than the 38 and 39 mile pegs. I can't quite make up my mind whether "59 to 62 km" is better than the direct equivalents of 61.14 and 62.75 km which some publications would have used. Note that "59 to 62 km" in the above appear to be factually wrong. This makes about as much sense as changing the names of official publications that have "1 mile" or similar in their title.

2. The measurements of mileposts and kilometre posts were done at different times, and in the cases of many railway lines, measured actual different distances. These changes have occurred because many railway lines have been deviated or realigned. Historically when deviations or realignments have been made, the original mile or km posts do not get relocated to reflect the change in distance. Instead the engineers have historically made use of a device called a "short" or a "long" mile [1].  For many lines in NZ, "short" and "long" miles persisted until such a time as metrication in 1974 when the lines were remeasured from scratch and the kilometre and half-kilometre pegs put in. It therefore cannot be assumed that distances measured in kilometres will always correspond exactly to distances measured in miles on the same line.

3. The distances shown in the article are official distances from official NZR and its successors' publications. Chiefly these publications are the Working Timetable, and lesser publications include the chainage books which are held by Archives New Zealand. The first metric WT for the Otago Central Railway omitted distances for stations which had closed. For these stations, therefore, the only available and appropriate official distance measurement is the one from a preceding WT measured in miles and chains. Chainage books are all in miles and chains and all distances derived from them have appropriately been expressed in decimal miles. 

Researchers in this area who have made use of the New Zealand Railway and Tramway Atlas, a popular publication which includes distance measurements for the vast majority of railway stations across New Zealand, are aware of discrepancies between these measurements and those found in many of the metric era Working Timetables. We can only assume that the publishers chose to hand convert the imperial distances to metric rather than obtaining new measurements from the metric WTs. For the same reason I have not used the metric distances shown in other publications about the Otago Central Railway for station locations that are not shown in the metric WT. 

4. The maps drawn of the line are marked using the imperial mileposts obtained from chainage charts and in many cases measured from easily verifiable geographical locations shown in the same charts. Whilst there may be some minor discrepancies in actual milepost positions, these measurements offer a reasonable degree of accuracy in the placement of the mileposts on physical positions on the map. The same information is not available for most kilometre posts on the line, a number of which have been removed from the line in any case. Those metric measurements shown are mostly station locations that are in the metric WT. The measurements on the map are those which can be obtained from official railway publications according to the preceding principles and quoting a measurement that has been converted makes no sense in this context because there won't be a corresponding measurement marked on the map itself. 

Reference: [1] NZR DEO’s Office (c.1930-c.1956). Chainage O C B [Otago Central Branch] 0 Miles 00 Chains to 25 Miles 60 Chains. Archives New Zealand, R18524763.

Friday, 23 March 2018

Main North Line [11D]: Addington 4

Welcome to our Facebook Group readers (NZRailMapz) as this will be the first entirely automated blog post sent to you, courtesy of IFTTT and the Buffer service. I already use IFTTT to syndicate  my posts on the NZRM Facebook page, but now they are expected to automagically feed to the group as well.

Latest progress to report is having laid out and masked off the retros for the east side of Addington. Tomorrow (Friday) the rendering of the eight geojpegs can be carried out and that will give me everything I need for the whole of Addington. I also made some adjustments to West and North and as a result some of those geojpegs need to be re-rendered as well.

Addington was many things: several important NZR industrial sites, the junction between the MNL and MSL, a passenger station, a freight yard, and many industrial sidings. These days it is much altered but still hosts a rolling stock repair depot, the main passenger station for all long distance rail passenger services, and the altered MNL junction. All the sidings however have now disappeared.

So Addington will be a very interesting site to detail. I expect to cover all of the major sites in Christchurch this way. I did most of them previously using Canterbury Maps and Google Earth but I am doing them again because of being able to use the historic Retrolens imagery as the background for many maps.

I may as well look at other sites I can use Retrolens coverage for. One has to be circumspect because of the amount of time it takes to assemble these mosaics. Certainly the production of them for almost every station on the Otago Central Railway is unlikely to be repeated everywhere. Depending on what is available I would expect to see them for almost every station from Christchurch to Waipara and Christchurch to Rolleston. Further south or north will be more limited. Obviously Picton has been done already. I may possibly do every station on the Waiau Branch, but I am unsure about other branch lines. 

MNL going north from Christchurch will be selected from: Papanui, Belfast, Kaiapoi, Eyreton Junction, Rangiora, Ashley, Balcairn, Amberley, Waipara, Scargill, Tormore, Nonoti, Mina, Spotswood, Parnassus, Ferniehurst, Claverley, Oaro, Kaikoura, Hapuku, Clarence, Parikawa, Kekerengu, Wharanui, Mirza, Ward, Taimate, Grassmere, Blind River, Seddon, Dashwood, Vernon, Riverlands, Blenheim, Spring Creek, Tuamarina. A few smaller locations in this list are connected with track realignments.

MSL: Every station to Rolleston then selected from Burnham, Dunsandel, Bankside, Rakaia, Fairfield, Ashburton, Tinwald, Hinds, Rangitata, Orari, Temuka, Seadown, Washdyke, Timaru, Pareora, Studholme, Glenavy, Waitaki, Pukeuri, Oamaru, Waiareka, Hillgrove, Bushey, Palmerston, Merton, Puketeraki, Waitati. The whole Dunedin-Mosgiel area, and then carrying on further south, Owhiro, Allanton, Milburn, Milton, Clarksville, Stirling, Balclutha, Kuriwao, Clinton, Waipahi, McNab, Gore, Mataura, Edendale, and Invercargill.

Midland Line: Selected from Darfield, Sheffield, Springfield, Staircase, Avoca, Craigieburn, Cass, Waimak Bridge, Cora Lynn, Arthurs Pass, Otira, Jacksons, Rotomanu, Ruru, Moana, Kokiri, Stillwater etc. However Retrolens imagery is not available outside Canterbury limiting us to what can be gained from existing Linz coverage. As it happens I have already traced much of what currently exists on the West Coast lines, and also done most of Christchurch-Timaru the same way.

Wednesday, 21 March 2018

Main North Line [11C]: Addington 3

So as of last night I have finished laying out the Addington North mosaics in Gimp. Today's job is to mask off the relevant bits of the retro images, and then render the part and full images for Qgis. Whilst I have enough now to start mapping Addington, I have determined to do only two tasks simultaneously, one of which is for the Otago Central Maps and one is for the MNL maps, so I will not start mapping Addington until I have finished laying out all the maps, and at this stage there is still East to be done as this area includes the actual MNL junction. To do this post I have had to render one additional area of West which doesn't contain any railway sidings, so as to display a full view of the area.

(Our group members should hopefully see this post automatically forwarded to the group by Buffer and if so, welcome to automated posting)

West side of Addington, present day.

West side, composite view.
West side, full 1970 aerials, with modern street layout for reference. A breakdown of this map into four areas is below.
At the Matipo St end of Addington, the designated purpose of these sidings is presently unknown. They are immediately adjacent to Addington Raceway, and by 1970 were full of withdrawn stock wagons. At the north side of the main line, we can see a siding going into premises at the rear of the P&N (Patience & Nicholson) factory.
North of the mains and east of Barry Hogan Place we have these as yet unidentified premises in Princess Street with a rail siding. A stub of this siding still exists on the railways side of the fence. The rearmost building with a sawtooth roof has been demolished but the gable roofed buildings north of it still exist and today are used for warehousing. The street frontage is occupied by the modern premises of the Ministry of Education. On the east is the Princess Street electricity substation, which still exists today but doesn't have any rail sidings into it.
Immediately to the south side of the previous photo here is a view of, upper right, Addington Plant Zone at its western end, where the Way and Works Department of the Railways stored their plant and equipment. South of the tracks appears to be the siding that was used to load and unload horses for Addington Raceway. Which at the time of this picture is full of disused stock wagons.
The last photo of this western segment of Addington shows the bulk of the Plant Zone area to the north of the mainline corridor. All of this area today is office blocks and industrial premises. Whiteleigh Avenue was pushed through this area in the late 1980s following the closing and demolition of the Plant Zone site. At the south side we can see the raceway siding alongside a platform which may have been used for passenger trains at some stage, this platform still existed for many years afterwards. At lower right is the railway Signals depot which again was a casualty of the Whiteleight Avenue road extension.

Otago Central Railway [61C]: Finishing Maps - Cromwell-Alexandra 1

Well I decided that I needed to check everything starting from Cromwell so that is where I have been busy for the last few days. As it happens I had two sets of aerial photo mosaics from Cromwell, and they didn't match up, so I re-rendered both the full and part sets of retro images from the Gimp project file. A full image is displaying all of the retro aerial photo (1962 in this case) and a part image is displaying only what has been masked out of the base image (the present day coverage). So that has been going on in parallel with the Addington stuff, using a 2nd computer. And then I have got the aerials loaded into the map project to start checking them. So far I have worked my way down to the original Clyde station, using the originals to recheck detail. 

The next step is to get the Clyde data ready for rendering the multi-generational maps. This means running filters on all the data tables and checking that they display the correct details, for each generation that I have the background images available for. After that it is a case of working down the line to Alexandra and doing the same thing there, in both cases the aerial photos for these areas were done some time ago and are assumed to be correct.

After that it will be a case of updating the photo album for Alexandra-Cromwell with the maps so that it is up to date, and the albums for major and minor stations as well. From there it is a case of working down from Alexandra to Ranfurly, and from Ranfurly to Wingatui. Alexandra to Ranfurly is mostly done already, except for Auripo station which I still have to finish off, so it will be mainly a case of checking the aerial photos are all complete. Except for the stations which nearly all have retros available, the imagery will be the recent/current LINZ stuff. Ranfurly to Wingatui is the part that needs the most work, as the only stations completed are the ones that were used to illustrate the Observer article. 

That article has just been published and the magazine released. I am certainly pleased to have completed that series. Part 3 was the hardest to write, and this will be obvious in the style of writing, which is a bit more technical and less creative. I am planning to republish all three articles on this blog in due course,  probably when the maps are complete or in about a year, and will exploit the ability to include much more illustrations in a blog than in the original magazine articles. Part 3 also includes a lot of detail about private sidings at Alexandra as this information was obtained when I visited Dunedin at Christmas 2017.

Sunday, 18 March 2018

Otago Central Railway [61B]: Finishing Maps - Clyde 1

So while I am working on the Addington mosaic, that is a pretty slow process with a lot of downtime waiting for Gimp to resize images, the best part is with another computer doing only that and nothing else, I can carry on with maps on my main computer. And in actuality that is a dedicated VM which is where I do most of my mapping on different computers, because I can use multiple versions of the software, which I need to at the moment because of a serious bug in Qgis 3.0 affecting aerial photos. I need to use 2.18 to do most editing but I need 2.14 to do filtered layers editing because 2.18 deprecates that capability. 

So back into Central Otago and starting with Clyde and here is the 1976 aerial photography with everything else over the top of it.

Now this is a multi generational map that covers 1962, 1976, 1981 and later up to the present day. To make such maps work we have to be able to filter what is being displayed so that only the features like tracks, buildings, stations and so on for that timeframe are displayed. To achieve that I have extra fields for dates added to a lot of layers and run the same filter query on multiple layers at once and at the same time select the background aerial photography layers to be displayed and that is how we get to multi generational maps.

So Clyde is the westernmost area that is set up as multi generational, now I have to tidy all that up and push out the generations of maps for Clyde and then work my way eastward doing the same all the way along and just make sure all the stuff on the Google Plus collections is all nicely up to date and that we have maps up there for the entire line.

That will go on at the same time as Addington mosaics simply because it is an efficient use of time with the delays for making the mosaics while the computer does the hard work on those huge Gimp projects to make the aerial images for that part of Christchurch. I have almost completed Addington West now, I just have to mask off the area that I want from the Retrolens aerials and then save back the geojpegs for Qgis, probably finish that tonight. Then Addington North and Addington East to start on.

Saturday, 17 March 2018

Main North Line [11B]: Addington 2

The Addington mosaic has been a lot of fun. Working with so many large layers in one image is taxing on computer resources, and one relatively fast PC (its CPU is a Pentium G with 2 cores but no hyperthreading) with nothing else open and 16 GB of RAM is still quite slow working with what is now a 10 GB Gimp project and which keeps growing as the historic aerial layers have to be scaled up in size. Since I ended up with two large layers (scaled from around 9000 to around 15000 width) on the west side of Addington with a small slice in the middle where another layer has to be pasted in to fill the gap, I resorted as in the past to cropping the required piece out of the gap layer, otherwise it takes all day to get it scaled to the right size.

The idea of running Gimp side by side on two computers in order to get the smallest number of steps to maximise quality has been useful but the scanned images in this case are so sharp (the original scale is 1:3400) that it's been unnecessary to continue with this. At the same time it is hard to get much memory available on MainPC for this kind of thing because browsers and other stuff I do a lot of on it just seem to gobble up all the available memory. Because of this I put Qgis 2.18 onto mediapc as well and have been using that because the media player stuff doesn't use much RAM. This shows the great benefits of an OS like Linux which is designed to work with resource limited hardware, being resource efficient on good hardware that you might be using do do resource intensive tasks. 

As it turned out my strategy outlined above did not work and I have changed to using two big layers next to each other with a small slice at one end instead of in the middle, this is because the usual skewings and distortion are better seen at one end rather than in the middle of a critical area of the railway depot. However this means a lot of yesterday's work has had to be redone. This sort of outlines why only a few areas are going to get this aerial photography coverage - it takes a huge amount of time to create these mosaics especially for big areas like a major railway yard or depot. The small stations on the Otago Central line which usually only involve one or two base images and maybe the same number of aerials are child's play by comparison. In this case having a slice on the end is much simpler because it can simply be cropped off when the mosaic georeferenced copies of the original base images are saved, so the full size image can be used instead of cropping a piece of it. We will have to see if Gimp copes with all the historic images once they are being displayed and it may well prove necessary to split the project into two or three pieces.

Thursday, 15 March 2018

Main North Line [11A]: Addington, etc

Having completed sorting through aerial photos of the MNL and now having a complete set, the next task is to start doing stuff with the photos. The first thing that will happen is I will do a set of historical maps for Addington, as that is where the MNL starts. When I first started looking at Christchurch yards about three years or so ago I had Canterbury Maps coverage and I used to overlay it in Google Earth and then import the lines and shapes into Qgis. Even though those old layers still exist, I am going to redo it all from scratch and create mosaics for all the stations on top of current Linz coverage, because I can use the mosaic aerials when I publish the maps.

So for part of today I will have two computers both running Gimp to create the mosaics of Addington, which is both a MSL and a MNL station, being a junction. It is a very interesting location that like many other areas of Christchurch has seen huge change over the past 40 years. Doing two Gimps side by side is basically having one of them resizing and rotating as quickly and roughly as possible, and then the second doing the absolute minimum number of these operations to get a result that is as sharp and clear as possible, because every such operation reduces the final quality. 

I haven't forgotten the Otago Central Line but have just needed a break from it over the past few weeks but I will be pushing on with it today as well. I have to reorganise the aerial photography resources for it as well, and that will take some time to complete. But most of it is just editing the project files to find the new folder paths where the aerial photo collections have been moved onto a different server, and shouldn't actually take too long. 

The optimisation / VRT preparation script is going to be started fairly soon, maybe at the weekend, because I need to get on to the task of both making my life easier with fewer layers in VRTs, and reducing the number of images I need to keep copies of on the computer, because they are using up so much disk space. The Volume 10 resources are using 200 GB, Volume 11 we are only just starting on is 70 GB, and Volume 12 is 90 GB. However, an earlier series, Volume 7, is well optimised and only uses 3 GB. Volume 10 and 11 are expected to use a lot of space because the MNL and MSL both cover a lot of territory in Canterbury and pass through major urban areas. But I can't sustain the amount of space that some of these volumes are taking up because it fills up the disk and makes the backups too big as well. So this rationalisation improvement really has to happen, but it means more delays that will take me off mapmaking for a while.

Friday, 9 March 2018

Main North Line [10]: Aerial Photography

Most of the mapwork over the past few days has been with MNL aerial photography which has to be downloaded and then sorted through to pick up just the photos I want. This is a slow process because of the download limit of 3.5 GB per download from the Linz website and the number of tiles in each download being much greater than what is needed for the rail corridor. So there has been a lot of work to get full aerial coverage for this line.

The other thing that has to be done at the moment is to amalgamate aerial photos and remove the ones that are not actually used because it takes up a lot of disk space and I have had to reorganise the storage between between different computers. I am looking at writing a script to process the Qgis layer definition files that I am putting aerial photos into. I should learn how to script on Linux with Python but to speed things up, in this instance I will use Windows Powershell to process the QLR files and copy the photos listed in them to a specific folder path that the script will create. What happens after this is to use a Qgis library function to process the aerial images into something called a VRT (Virtual Raster Transform) which is supposed to make it easier to handle all the many aerial photos I am working with.

The aerial photo downloads are now more or less finished and just need a bit of extra little bits added on here and there to make them complete. I need to get on also and finish the Otago Central maps because I haven't done any work on them for the last week or two. I think I just did some mosaics of Auripo and haven't actually drawn any of the maps; nor have I worked on any of the other maps. However reorganising the resources on the computers has taken a bit of my time up lately.

I have been getting Retrolens coverage for the major deviations on the MNL as well as the current stuff and have got enough to map all of these accurately. Apart from Nonoti mentioned last time there were major ones done at Stewarts Gully, Ashley, Balcairn and Phoebe, and all of these will be addressed over further posts in the MNL series in coming weeks.

Tuesday, 6 March 2018

Main North Line [9]: Nonoti

Nonoti is a weirdly named little station in North Canterbury between Tormore and Mina. The exact distance is not recorded in the NZ Railway and Tramway Atlas, but it is between 116 and 117 km. The station closed in 1958. Around Nonoti a deviation was put in during the 1950s, apparently commissioned around 1961 (Don Spicer). 

1955 Aerial photo showing the earthworks underway.

1965: the deviation is in use and, of note, the original overhead bridge at Nonoti was replaced with another one on a slightly easier alignment and because the rail route at this area also changed. Nonoti station still had some track in place despite having shut some seven years earlier.

Complete map view.

Although drivers (e.g. Don Spicer) say the new route is much easier to work, eliminating gradients and sharp curves, the new route still requires speed reduction to 65 km/h for the curves. It is interesting that more effort was not made to ease these.