Importing Google Maps to your Nokia N95

In May, I went to Oregon on vacation, and in preparation for the trip I put together a custom map of restaurants and locations using Google Maps. This was pretty easy, and certainly helped me visualize where all the restaurants were in relation to each other, however, this wasn’t going to help me when actually walking around town. What I really needed was a way to get this Google Map onto my N95. That way I could look up the locations and directions using my mobile’s built-in mapping features.

Luckily, this wasn’t hard to do. Google Maps uses the KML format for all of its custom maps and the Nokia N95 uses the LMX format for landmarks, so all I had to do was come up with a converter from one format to the other. Both formats are just XML files, so I figured the easiest, most portable way to do the conversion was using XSLT.

And here’s the result.
(download also in the sidebar with a GeoRSS version too)..

Of course, you can’t really expect most people to download a KML file, download an XSL file, run them through an XSL processor, then upload the result to your device. So I created a simple web form that makes things a little easier for testing and development.

Just enter the URL for your KML or GeoRSS feed, and then select the type. Once you click the update button, it will generate a link where you can download the LMX file. If you want to download the LMX file straight to your N95, then you can do that using the generated DataMatrix code.

Enter your information here:
URL for data feed
Feed Type
 

 

Import this LMX file to your N95
Full URL:
http://wubbahed.com/

DataMatrix

This is definitely something developed in about an hour, and it’s only had limited testing, so there are no guarantees this will work for everyone, and I’m interested in any bugs you find or enhancements you’d like to see in the future.

24 thoughts on “Importing Google Maps to your Nokia N95

  1. wubbahed Post author

    Jerry-

    Thanks for the note. I downloaded the KML file you mentioned, and I noticed a few things.

    - The file itself wasn’t valid XML, it had been truncated at the end, so that was a problem.
    - The file was over 3 MB, and I haven’t done much testing with my online converter when using very large files, so that might be problematic as well.

    But the biggest thing is that your KML file only represents points using GroundOverlays, and right now my converter only handles PlaceMarks in KML files. GroundOverlays represent a square region on a map, and the Landmarks on N95s require a specific point. If I were to implement support for GroundOverlays, should the corresponding N95 location be calculated so that it’s always in the middle of the overlay? Or should I not tamper with the coordinates and just use the lat/long provided in the KML.

    Reply
  2. Jerry

    Thanks for Your response!
    Since FON coordinates are to be used with my actual position when travelling around it is enough to just have the lat/long provided.

    Reply
  3. DaveH

    Will, Very cool you’ve saved everyone a lot of effort. Do you plan to support google earth folders with placemarks. I think i recall lmx supporting multiple land marks in a file. If i export a folder to kml and convert using TestXSLT on mac (Sablotron processor) it gives me a blank lmx. Either way, nice work.

    Reply
  4. wubbahed Post author

    Dave-

    Yeah, I’ll definitely continue to upgrade this as I get more knowledgeable about the ins and outs of the KML format. My original reason for developing this was actually to integrate with the desktop version of Google Maps, but it seems that most of the interest is coming from users of Google Earth. Which do people end up using more?

    Reply
  5. Willem

    I have done it but I get an error on your php…

    I did make a xlm file by hand, but don’t know how to get it to my phone.. The browser opens the XML file. It doesn’t save the locations :-(

    Reply
  6. wubbahed Post author

    Someone just had this same question on another post here yesterday.

    The solution is that if you’re going to offer LMX files from your own server, you need to make sure that you have the correct MIME type for LMX files. Specifically:
    .lmx extension requires this MIME type
    application/vnd.nokia.landmarkcollection+xml

    add that to you server and then the phone will recognize the locations.

    Reply
  7. Jorge

    Do you have a procedure for doing it the other way round (LMX to KML)? I have some points I’ve recorded with my phone and now i want to see them on Google earth.

    Thanks!

    Reply
  8. Suat

    maybe this converter don’t work. Error message:
    Warning: Sablotron error on line 3: XML parser error 4: not well-formed (invalid token) in /home/wubbahe/public_html/lmx.php on line 23
    There was an error with your data feed.n
    nURL: http://www.mytempdir.com/2030883n
    nError: 2n
    nDetail: XML parser error 4: not well-formed (invalid token)Text: n
    n

    What’s the problem?

    Reply
  9. pedram

    hi
    is there any program to convert kml to lxm ?
    i have some kml file (they are map of my country) and i want to convert them.
    regards

    Reply
  10. fabio

    great!! After some fix to the mimes into my apache2, everuthings go well, under debian:
    add the mime into /etc/mime.types

    Reply
  11. N95-user

    Mini Tutorial

    In the beginning I encountered the same problem like Suat.
    It took me a lot of time to find out that this is not an application but a handling error.
    To save people with the same problems this time I wrote a mini tutorial. It is based on the example wubbahed gave in his introduction.

    1. Open the link to wubbaheds “custom map of restaurants and locations” in your browser –> Google maps opens up
    2. Click the link “Link to this page” in Google Maps
    3. Copy the link into the clipboard. In this example: http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=105131228954528113132.0000011282baf4e8057cf&om=1&z=9
    4. Paste the link into the field “URL for date feed” of wubbaheds form
    5. DO NOT CLICK THE “UPDATE DATA MATRIX and URL” button yet!
    6. Append “&output=kml” at the end of the URL. The result for this example is: http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=105131228954528113132.0000011282baf4e8057cf&om=1&z=9&output=kml
    7. Select “KML” as Feed Type
    8. Click the “UPDATE DATA MATRIXand URL” button.
    9. Now either cklick the link to download the LMX file to your PC or use your N95 camera to direcly get the landmarks into you phone

    Thanks wubbahed for this innovative tool!

    Reply
  12. Wazza

    This looks great but I have the same problem as others that the file downloaded is a “.php”. Could someone explain what I specifically need to do to fix this. I have this problem whether I click on the download file link OR scan the datamatrix using my N95…

    Reply
  13. Tim

    I have an update: newer versions of Google Earth save out waypoints with xmlns:kml=”http://earth.google.com/kml/2.2″ , incremented from 2.1.

    Additionally, you should search for //kml:Placemark as they do not always fall immediately below the kml:Document tag.

    Otherwise, I have taken your kml_to_lmx.xsl and, with those minor modifications, used it to convert kml fresh from Google Earth into N95 waypoints with great success. Thanks for saving me a tonne of work!!

    Reply
  14. Rainer

    Maybe it is a stupid question but how did you manage to process the PHP on your webserver and have the content type of the output (I guess in .htaccess) set to “application/vnd.nokia.landmarkcollection+xml” so the Nokia phone can determine its type?

    Cheers Rainer

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>