Archive for November, 2007

MGRS fix for < 1km gratitules

Thursday, November 29th, 2007

Following the update in July for hiding the 100km numbers from the gridline labels, it seems the same fix broke the sub KM lines, thanks to a comment on the original post for letting me know.

Anyway, the online hosted version has been updated (and checked at all scales as best I can!), and the same file pushed into the downloadable zip for the offline version, so can download the latest code from the file. And just for completeness the diff.

36 Blue Globes for your viewing pleasure.

Tuesday, November 13th, 2007

I notice Jonathan has finished uploading all 36 layers of the Blue Marble Next Generation imagery, that he has been processing for viewing in Google Earth. These are the full resolution imagery available, at an impressive 500m per pixel I believe, and preprocessed for reasonably quick loading – shouldn’t be *that* much slower than GE’s built in imagery.

This is a full set of 12 month variations for each of the original, topographic shading, and topographic & bathymetric shading variations of the original data.

If you haven’t already done so, load the layer now! Or if you already have it simply right click the top most ‘reference’ item and click Refresh.

… could be wrong, but think this is the first time that all layers are available for easy viewing in Google Earth.

Serving Google Earth static content with Apache

Tuesday, November 6th, 2007

This could probably be classed as technical post (gosh!), and is probably only of interest if involved in hosting content to be displayed in Google Earth or Maps etc.

I’ve been meaning to write this up for a while, basically a set of tips for setting up Apache 2.X for hosting content for Google Earth. The same tips can probably be used for other webservers but won’t begin to look at the various ways it could be configured… Also these could easily be placed in httpd.conf, but using .htaccess as the example as thats probably easier, and not all hosting providers allow access to the file. Much of the stuff here originates from YSlow, but adopted for what I know about Google Earth.

These settings assume you not going to change the content much, so is good for serving up large static content, or the ‘chrome’ for a large layer. Regally updated content is likely up be output from a script anyway so that can setup its own headers, I’ve also done quite a bit of work on getting PHP to output good headers, so will post that in a follow up post.
First and foremost is setting up the MIME type, to ensure the Google Earth is launched when a user clicks a link, so these lines are added to the .htaccess file:

AddType application/vnd.google-earth.kml+xml kml
AddType application/vnd.google-earth.kmz kmz
AddType application/xml dae

Next is the Expires header, which tells a UserAgent how long it can cache the content, we set nice future dates, which mean in the main the content will stay cached for a while, potentially saving quite a bit of bandwidth.

ExpiresActive On
ExpiresByType application/vnd.google-earth.kml+xml "access plus 30 days"
ExpiresByType application/vnd.google-earth.kmz "access plus 30 days"
ExpiresByType application/xml "access plus 30 days"
ExpiresByType image/jpeg "access plus 180 days"

I’ve included JPG here, as it’s often used with GE, esp. how with the introduction of PhotoOverlay. The same idea can of course be extended if you use png files for example.
Now Apache out of the box supports sending Last-Modified headers, which means conditional GETs can be made later, which will only return 304 Not Modified. I’ve seen suggestion to turn off Last Modifed headers (if you have far future Expires as above) – but after testing, I would NOT recommend this.

Next is Etags, now YSlow recommends disabling these in most cases, and Apache useually comes with them on, and can easily be misconfigured, esp. on clustered hosting, so they need to be turned off. I’ve dithered on this one for a while, it seems silly to disable a feature that could potentially be useful, however the clincher here is that I don’t think GE will use them, and besides we can save a few bytes be not sending them in the first place.

FileETag none

I’ve no evidence if it helps, but if you have enabled on the fly GZip compression, then you might get a small boost by turning if off. As GE doesnt support HTTP-GZip compression, and KMZ and JPG are both well compressed. The only small benefit might be if you have a KML based loader, that might get downloaded by the browser in which case it can GZip’ed. So turn it off globally in this folder, but turn it back on for KML:

AddOutputFilterByType DEFLATE application/vnd.google-earth.kml+xml

As a final tip, the following allows you to upload a index.kml file and it will be served as the index for a directory, doesn’t help performance, but useful in a few cases,

DirectoryIndex index.kml index.html index.php

Get all of the above in one file ‘ere, use or don’t use at will :)

The British Isles is burning!

Sunday, November 4th, 2007

It has to be said that when we started the Geograph British Isles project we certainly didn’t think it would grow quite a quickly as it has, nor that we could get such a submission rate, particulaly in adding depth – adding photos to a square once it was turned red on the map. Well to this end we recently introduced depth maps which colour the map based on the number of photos in the square. A preview is available here, but click the image for the normal Geograph map viewer in this new mode. Just goes to show how well photographed some areas are, but also a lot of the country only has the first geograph in the square, so much more depth to go!

Update: View as a time-based animation.
(includes raw frames as would like someone to make a better presentantion of this!)

btw, as I am colour-blind and unable to come up with the colour scheme, can only thank who ever created the colour scheme for CIS. (A very interesting package – worth playing with just for the data it has – I can provide a file to load geograph depth into it if interest!)

(yes the title is a tribute to this)