Epilogue: Introducing GEOrgET 1.0

Georget_large
GEOrgET 1.0, new 3D logo

By now the maps and charts derived from the GPS tracks that I’ve recorded have become part and parcel of the blog. The software responsible for this is GEOrgET (GoogleEarth Organiser, Editor & Toolkit). However, with the gradual publication of 1 arc second elevation data, it was time to have another look at the program to see if the greater resolution was worth accommodating.

Three areas needed reviewing: The first was cosmetic – the logos and how the program looked and felt; the second was introducing the 1 arc second data and adapting the program accordingly; and the third was the under-the-hood question of the coding.

The cosmetic improvements included the new 3D logos which were fun to design and implement. Then the program handling had to be addressed. Directory and file selection are now achieved with a single click which automatically reloads the page; and to avoid clutter the latest version of multi-version files is only ever shown, and non-editable files are never shown.

WRJ 2-5_00_dts
Whanganui River Journey, speed distribution by time, days 2-5
A status monitor was implemented for those tasks which take a longer time (such as map drawing, which on a slow machine can take several minutes to complete) – a monitor showing real progress and warnings, not just a Rube Goldberg placebo device. This all meant that I have come close to making my peace with JavaScript, and although that has not yet come about I am a bit more confident about the workings of it than I was before.

An extra pair of graphs was introduced – the speed distribution as a function of time and distance, with percentiles for 10%, 25%, 50%, 75% and 90%. The multi-day speed v time graphs now map onto one very wide graph.

WRJ 2-5_00_svt
One long journey: Speed v time for the Whanganui River Journey, Days 2-5
The technical implementation of the 1 arc second data was complicated by the fact that the data is not currently void-free, and so it had to be processed to eliminate the voids. This is implemented as a new feature by converting the data to a void-free hgt format. Since there was no reason to make the change to the new data resolution backwards compatible, the super-sampling factors were modified, leading to larger maps (up to about 20%). But the detail now borders on the exquisite. Check out the slide show of the before and after maps. The less detailed, 3 arc second maps look like melting ice cream.

WRJ_shadow
Pretty crinkly picture: Whanganui River Journey, shadows map
As a result of using the new data, the shading question had to be answered. The previous implementation was baroque to say the least, so I adopted a method which now works with the same shading strength at all map resolutions – simply take the difference between the data to the north and the south and multiply by the sampling factor – this gives a constant slope regardless of the resolution. And for the effect, this shadow map is simply layered with the “overlay” mode which gives the desired amount of shading. Voilà!

The positioning and size of place names was improved, as was the contouring to give less prominent but almost complete contours.

Finally, some technical tidying up. This version now has to work in PHP 5.4-5.6 and PHP 7.0, with its novel foreach () implementation. These versions of PHP introduce a number of new functions that were put to good use, and the code was tidied up significantly, resulting in a complete length of just under 118 kb (up from 108 kb for the last version) despite new functionality. And while doing some spring cleaning I noticed that it probably wasn’t such a good idea to unpack all of the geodata at once, especially if only two lines were needed at any one time, so I was able to put an end to this unnecessary memory loading and still have a modestly dimensioned machine produce the largest maps. Download here.

Earth Explorer Feedback
Feedback, welcome! Yeah, right. Like this. (Someone took “feedback” too literally.)
This project relies on “contributions” from two major sources: The 1 arc second geodata source, and the graphics software. As the for the first, this is the USGS’s EarthExplorer, and their website is a thorough disgrace. Particularly refreshing is the Page The Does Not Load, which will be encountered at least once when trying to download data from their server. I don’t know who tests their stuff, but anyhows, the internet was only invented yesterday, right?
Earth Explorer Never Ending Search
The Page That Never Loads, USGS
If you ever get caught with the Page That Does Not Load, the trick is to reload the page and stop the page from loading completely – a quick F5 – ESC, and that should do it. If enough of the page has loaded so that the link you want to click on to continue is there, then it’s your lucky day. But really, USGS, since your data is public domain, I think I’ll save everybody else the trouble of trying to download it from your site, and just put it up here.

A brighter note on the graphics side. PHP’s Imagick project seems to have received a fresh lease of life, and I’ve been trying to get a few bugs fixed, with a degree of success. Good news, too, that on the official site a number of useful downloads can be found, e.g. compiled Windows binaries of current ImageMagick versions that Imagick needs, and compiled DLLs (and a whole lot of totally unnecessary stuff to boot) of the PHP extension. And one further tip: The documentation (especially the wonderful page of constants which constantly explains what an integer is) is not quite up to date, and since I believe neither in Karma nor in banishing “prepositions” from the ends of sentences I won’t be bringing it there. But a number of newly introduced and thus otherwise undocumented constants can be found from around line 950 here.

So now I look forward to the next part of the project: Mapping the water bodies. Up to now this has been done by hand (tracing), but a better solution would be, of course, being able to interpret the USGS data. And that’s the aim for GEOrgET 1.3, the next major step.