Archive for the ‘network-link’ Category

Where in the world are people looking? part 1

Friday, February 29th, 2008

As some may know this site serves a number of Network Links for Google Earth, for a long time I have thought it would be fun to map the data from that, but finally got round to trying it. This is still work in progress, so the current images are very much easly tests, but shows promise, hopefully can make some better visualizations – maybe even as KMZ :)

‘Lookat’ point v1: (click for 145k version)

View In Google Earth (don’t forget to try adjusting the tranparency slider!)

Shows some interesting patterns, there are a number of lines on the map, and definitily appears to be flight lines, I suspect this is from people leaving tours on loop, and a fudging a networklink to refresh periodically. Not sure how else to explain such repeatable loops – can a large number of visitors really be all following the same route? I’ll investigate this more in follow up map(s).

But WHAT is that point in the middle of the Atlantic?

Update: this is from about 900k hits from aug-nov ’07 – still processing the rest of the data!

Update 2: More maps here, all maps seem to to show the same overall pattern which is slightly puzzling, eg the IPs graph suggests that many users are following these flight lines.

(static) Google Maps in Google Earth…

Thursday, February 21st, 2008

Now that Google have just announced a brand spanking new NON JS Maps API, to be able to display maps with a simple img tag, similar to the Chart API. Well I thought it would be fun to re-purpose the
FlashEarth code to create a network link to display Google Maps in a popup balloon on Google Earth. Not totally sure the utility, but sure is fun (until the novelty wears off!)

Open in Google Earth

Hopefully needless to say the map inside the balloon is static and non draggable.

Update to clarify: You get to draw 1,000 maps daily, which is probably plenty, but go over that and the maps will stop working for you.

Update: as alluded to in the official post, you can use the static API to load a quick map, while the rest of the page loads, then at the last minute change it into a dynamic map. A series of demos showing various ways of lazy loading!

ViewFlip for Google Earth

Thursday, January 24th, 2008

Remembering back to the good ol’ pre SpaceNavigator days, when Google Earth was stuck in ‘Earth Based’ mode, and I created ViewFrom, have created a new version that uses the <Camera> functionality to do it more accurately, but at the same wrapping it in a networklink for ease of use…

Google Earth LayerViewFlip (recent GE 4.2+ required)

… open opening this you should get an arrow in the middle of view. Click it and choose to either Flip! (swap position*) or Look Around (which gives you a folder of viewpoints to look out from the point of the arrow). So a sort of basic ‘User Based’ movements, which really (IMHO) should be part of part of the default GE installation – without needed addons.

*There is a few oddities with this – but mostly works. Also you will get a bunch of features in your Temporally Places – GE doesn’t seem to be able to load a KML that just changes the view (which there is no need to show in the Places there are no features)

Update: 25th Jan, Thanks to a suggestion from Frank Taylor the “lookaround” groups are now available at multiple altitudes, nothing new to download, its all done by magic. (let me know if other heights would be useful)

Export all MyMaps to Google Earth

Monday, January 7th, 2008

====================

Update, 2nd August 2008

Suddenly it seems that the KML export from My Maps no longer pages like it used to, basically making this script redundant – which was always the intention!

So if your file has under 1000 features, then just use the link ‘View in Google Earth’ to get all the data. If you want the
actual data you can change the ‘output=nl’ to ‘output=kml’ to get the KML data rather than a Network Link to it.

====================

Oh dear, I think I should stay away from the Google Maps Group, following a post (about saving directions to MyMaps) on there a few days ago, realised the KML export is paginated, but there doesnt seem to be a way to get at the following pages directly. It flummoxed me for a while until guessed at the params to get the additional pages, success.

Then a post on there today, made me realise others are coming against this problem, so in traditional hackers** style, here is a little utility to create a multi page network link wrapper…

Export all MyMaps to KML

** follow the link for the definition I mean

Update: 18th Apr, we now download the first page of the map, 1) to get the number of items per page, it seems the link itself is no longer reliable, and 2) it means we can grab the title automatically :)
(note the download is discarded so I dont keep a copy of the data itself)

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

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.