Archive for the ‘KML’ Category

Tweaking the number of the MGRS layer

Monday, June 25th, 2007

Ever since releasing the MGRS layer for Google Earth, I’ve been asked a number of times (well about 10) about tweaking the numbers on the gridlines, to be more ‘MGRS like’. To be honest havent had a clue what this means, but a recent email made me twig whats going on.

Basically the numbers included the hundreds of KM, but in fact that number is already represented in the Grid Letters so doesnt make sence to include again (it was there because the layer was an almost direct port of the UTM code, which of course needs it).

So the server hosted version has been updated, and also the file inside the zip for the offline version (which are in fact identical code!), and if really interested heres the diff.

Enjoy!

MGRS Layer for Google Earth – Offline!

Tuesday, June 19th, 2007

Thanks to help from Mark Ferneau, have finally the MGRS layer packaged up ready for use off-line (and GPL licenced!), an often requested feature.

These instructions assume Windows, and that you don’t have a local webserver running. The zip file should be usable to set it up on any local server capable of running PHP, just don’t forget to edit the link in the network link to the path of your webserver.

Without further ado, the instructions:

  1. Download Appweb web server from: http://www.appwebserver.org/ (Tested with 2.2.0)
  2. Install with the general default options
  3. Save AppWeb.conf file in C:\program files\MBedthis Appweb\, overwriting the default (this just sets up the minimum needed for PHP to run, removing some of the extra stuff)
  4. Copy php5ts.dll from C:\Program Files\Mbedthis Appweb\lib\modules\ to C:\Program Files\Mbedthis Appweb\bin\ (not sure why this step is required but Appweb seems to need it)
  5. Extract grid_mgrs.zip into directory C:\appweb\web\offline_nearby\
  6. Start up the appweb server, using Icon in Start Menu. (if it’s already running, icon in System Tray, exit it)
  7. Open the network link – save it to your My Places :)

If there is interest could possible package up some of the other layers run on a local webserver in a similar fashion.

Finally, use at your own risk, it works for us, but your mileage may vary. We welcome any and all feedback (esp. patches!)

GoogleDevelDay: part 2

Thursday, May 31st, 2007

Have how been to the two ‘Geo’ sessions, nothing new to report I don’t think that can’t be got from gearthblog.com and the Google Maps API Group (where I had already heard of these), but anyway a quick round up of the main announcements (in no particular order)

  • Maps API – Can now do Directions :) – don’t yet know how flexible the API is tho, or if it even supports UK
  • Maps API – hint that the Geocoder might work (or soon) in the UK, but this could just be the questionee doesnt know yet.
  • Google Maps – Mapplets – porting a mashup to Google Maps
  • Google Earth – New KML 2.2 – as far as I gather its the KML spec only, the viewer is not released yet – but will check.
    • Support for Photo Placemarks – of particular interest to Geograph – tried something like this with models but never got it nice enough to release.
    • Add ‘atom’esque, link and author tags to Placemark
    • Update: just found the Camera tag, YAY!
    • http://code.google.com/apis/kml/documentation/kml_tags_beta1.html

    More as I find it out (I think I am missing some anyway…), I’ll also verify the facts and flesh out the features with links to more information.

    Update: forgot to mention Ed Parsons also used the Geograph Mapplet demo in his Keynote speech this morning. (see previous posts)

    Google Maps – Mapplets; a quick Geograph demo…

    Tuesday, May 29th, 2007

    Wow, Google have again gone and introduced an almost draw-dropping new feature to Google Maps – Mapplets. Put simply they allow you to create mini-map-mashups, but as they run on maps.google.com, visitors can view your content along side the normal content of Google Maps – but even more interestingly visitors can load more than one Mapplet at a time, combining the data from each mashup onto ONE map!!!

    And it turns out they are really easy to code for been based on Google Gadgets (which I haven’t used before) and Google Maps API (which I have :) ), but I also congratulate Google on including in the package ‘Developer’ mapplets that make developing relatively painless.

    Anyway onto the demos, just visit http://maps.google.com/preview (it’s a Developer orientated demo for the moment), click the ‘Mapplets’ tab, goto ‘Add Content’ and see what takes your fancy. To try out my (very humble!) demo, use the ‘Add by URL’ and paste in the following URL: http://www.geograph.org.uk/stuff/gmapplet0.xml

    (more about maplets in the post linked in the first paragraph!)

    RSS & GeoRSS to KML

    Monday, April 30th, 2007

    Spured on by comments on Stefan’s Ogle Earth blog, have created this little page as a wrapper to the excellent service provided by geonames.org to automatically convert a RSS feed to KML. It also does RSS->GeoRSS and GeoRSS->KML.

    http://www.nearby.org.uk/rss-to-kml.php

    Hopefully should make it a bit easier to load a (Geo)RSS feed into Google Earth in the style of a RSS feed – it auto updates.

    … really need more to talk about, been kinda quiet of late…

    Feeding GeoRSS and KML content to your Google Maps API based Map!

    Thursday, March 22nd, 2007

    All hail the new GGeoXml class, just introduced into the Google Maps API! Now you can easily (usually 1 or 2 lines!) add content that you have in KML/Z or GeoRSS to a Google Map in your API page.

    This is the same functionality that has been on the main Maps site (well the GeoRSS support is new!) for a while: nice for this to migrate to the API.

    TIP: to try it don’t forget to use &v=2.x in your api loader to get the latest version that includes the GGeoXml.

    To celebrate here is a Geograph Demo – following some testing will make it an official feature.

    Geograph SuperLayer for Google Earth

    Monday, March 12th, 2007

    If you have Google Earth version 4 and broadband then you might be interested in clicking this link:

    · Geograph SuperLayer · Geograph Superlayer - click to load into Google Earth

    By opening the above link you should be able to view the whole Geograph image collection directly in Google Earth. This has been possible in a number of ways for a while, but this does so in a much more compelling way (i.e. a single small download!).

    This exploits the new Region functionality of GE4 to only fetch and load detail as you zoom in, in this way the view starts depicting a course overview of the current coverage, zooming in reveals more detail until pictures themselves become visible. (the ‘Super’ is adopted from Google’s term of SuperOverlays – overlays that load via nested regions)

    In particular this is all pre-compiled and compressed, so should be fairly quick to download and is friendly as possible on bandwidth. Overall the layer consists of 102,965 files at 450MB compressed so there is a lot of data available, however you will download a lot less than this, probably on the region of a couple hundred files totalling about 2MB in a typical session.

    As a small refinement, when a icon represents a single photo (a camera icon) if a view direction is stored the icon will have the top point in the appropriate direction. Also once the thumbnail is visible you can double click the thumb and the View will rotate to orientate the photo correctly!

    Also this is only the first version, hot off the presses, so it not perfect yet, in particular would like to use Geograph specific icons (any Graphic Designers reading???), for example to give more feedback to the user on squares with many images, and view direction – also GE sometimes gets confused at the amount of detail available – plan to experiment to see if something can do about that.

    … Hopefully users of GE3 should degrade nicely to use the View-based refresh method of viewing the dataset.

    Oh and yes this is the little kml project I mentioned, see also other ways of loading geograph data into Google Earth or Google Maps via KML files.

    KML writing PHP Class

    Tuesday, March 6th, 2007

    For a little project working on for Geograph (btw Second Birthday today!), that will end up producing quite complex (and repetitive) KML, I decided to take the plunge and create my own abstraction class.

    There are already a few of these about, but I wanted something with just enough abstraction so don’t need xml in the php code, but without too much complexity, or a whole new syntax to learn. So the final output is basically a generic XML creation system, but tailored to KML generation, with a number of convenience methods for common bits of KML, (like outputting the right headers). This don’t do any schema enforcement, and assumes a good working knowledge of kml.

    Anyway as the code is already GPL, thought would mention it here in case it useful to someone else.

    Get the base class here (from the Geograph SVN repository)

    There is also another file here, which extends basic the functionality, this is more specific to Geograph, but could still be useful.

    And a few demo’s/tests used during development:

    Demo1 – (view running demo – by default displays the KML, option to open in GE)
    Demo2 – (view running demo)

    And for a real world use of the code (been in active use for a week now)

    Eagle eyed viewers might notice it claims kml2.0 but then goes on to allow use of 2.1 features. Yes I know this is ‘bad’ but is with reason. I have found to my expense that using 2.1 as the version actually has a few undesirable effects, eg making the Document visible in My Places tree, can’t mix and match styleUrl and style (to have common style but with a unique icon), and a few other subtle things. Whereas GE seems to allow the new features in a 2.0 kml file, I guess this is the GE equivalent to quirks and strict mode. (disclaimer: it’s a while since I tested this, so might be old news, I really should run some real world tests to confirm this is still the case)