Archive for the ‘KML’ Category

Export multi-destination (or dragged) route to Google Earth

Thursday, December 27th, 2007

Love keep adding destinations to your route, or even dragging the route to refine perfectly to your needs in the directions feature on Google Maps? But frustrated that this feature isn’t available in Google Earth?

… No, not implemented this feature for Earth (wouldn’t that be something!), but as a stop gap its a way to export your newly created directions on Maps, and open them in Google Earth! You get a freshly created folder containing each section as a separate route, ready for use as ‘one.

Multi Destination routing in KML for Google Earth

Google Earth Version Stats (Dec’07)

Friday, December 14th, 2007

 Only a quick post as its late, but just noticed this report had finished generating, took rather a long time, as just found our stats package has been mangling GE’s useragent string – anyway enough rambling, I know you just want to view the stats:

 Dec 2007 :: Google Earth versions accessing links on nearby

… make of that what you will – haven’t really drawn any conclusions from this…

(last set)

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.

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 :)

Blue Marble NG – Google Earth (Rendered) SuperOverlays

Sunday, October 28th, 2007

Yes I know, its another way to view Blue Marble Next Generation imagery in Google Earth, but here Jonathan van Tuijl has taken the time to pre-process the full resolution 500m/pixel imagery into static files, meaning that hopefully the loading should be smother (at least when accessed from this side of the Atlantic!) and more refined as a its not relying on a server to dynamically generate the KML and images (even if it then caches it), as done here. We also hope to make available the full range of Blue Marble layers.

View the Blue Marble NG Overlays Homepage and download the Link

… doesn’t do any of the fancy fading out like the version here, which is designed to be left running :)

See the post in the KML group that started this little adventure, which I believe started as an exercise for Jonathan to find a way to slice up really large images, and generate a Google Earth SuperOverlay from that; as none of the ‘packages’ seemed to be able to manage it (I’ve tried it too!). So I joined in offering hosting – as think its a neat exercise in hosting really large datasets (7.4GB at last count) – now I have a powerful server. (famous last words…)

More Maps.Live.com inc KML2RSS

Tuesday, October 16th, 2007

The people at Live.com (Microsoft!) have been making some huge improvements to their map system of late, adding lots of data in both 2D and 3D. maps.live.com has long been good in the UK as it uses imagery from getmapping which is at least 2m resolution, but 25cm in many places. It’s now been backed up by lots of Birds Eye imagry which are static photos taken at an angle, which is great for visualising cities. How these are available in the 3D view (which is currently downloading so havent tried it…) ! Also now supported is visualling KML, GPX and GeoRSS files.
Anyway that was kinda rambley, the point of this post was to highlight small feature I found by accident and not sure it been highlighted on other blogs, namly you can subscribe to a RSS feed for many collections, including a KML or GPX file directly, effectively giving a KML to (Geo)RSS converter!

Example: Recent Geographs KML file as GeoRSS

(looks like we can input any KML/KMZ url in there!)

Google Earth Black Box Recorder

Saturday, September 1st, 2007

Purely as a prototype, here’s a little script that records your flight in Google Earth for later review. (Wondering how you fly in Google Earth? See (or) here!!!)

Go here for the details and to get started.

This is recording the flight back to on my server, as that’s way easier than creating a local application. However it does mean its dependent on the net connection and my server for smooth recording. If this works out will seek better hosting! As mentioned its only a technical preview so its nowhere near perfect, but should be useful in a fun way at least :)

… technically it could be used to record movement in any mode, however it only records the camera position, which is almost ideal for the flight simulator, but not so useful otherwise.

Google Earth 4.2 + FlashEarth equals…

Tuesday, August 28th, 2007

What if the current view in Google Earth was quickly viewable in other maps, such as those made accessible by FlashEarth? Well, now it is. As you move around the globe a little white arrow follows you around, simple click it to get an approximation of the current view in FlashEarth in a popup balloon.

Open in Google Earth

Total credit to Valery35, for the concept (including a screenshot) on the Google Earth Community. (and to all the people made all the bits that could be pieced together in this 15min hack)

New Earth

Wednesday, August 22nd, 2007

A next version of Google Earth is out! This in the one that implements the things we got a sneak preview of with KML2.2. Unfortunatly it would have to be today, the one day I cant actully play with it, so will have to hold off any try it out propelly another day :(

I’ll forward you over to Ogle Earth to get the lowdown on the new features.

I just hope that the 3DConnexion SpaceNavigator not working in Photo (or Sky!) mode is just a glitch…

The State of the Map…

Wednesday, July 18th, 2007

Over the weekend I attended OpenStreetMap‘s first conference “State of the Map“, all in all a very enjoyable time, great to to listen to all the talks, and also chat with various mappers, meet up with various people I’ve only met before in cyberspace.

Hopefully it will inspire me to actually contribute, esp as frequent two ‘holes’ in the current data…

An interesting little snippet from Ed Parsons talk, is this slide, which shows KML/GeoRSS publishing as indexed by Google, somehow I think I reconsise the British Isles hotspot; geograph, which publishes many KML feeds, (about 600k (the Superlayer, and also a file per photo), of which about 300k are reported to be indexed in Google’s main index, so show up well in ‘User Generated Content‘ in Google Maps!)

Everyone (nearly) – me third from left