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.
|
||||||||||||||
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.
Hello, tried to use your converter for converting FON POI’s from Google format to N95 landmark but failed. I’ve saved a kml-file at
http://goto.glocalnet.net/pryl-torget/drivrutiner/ . The filename is FON_SE.kml. Have I missunderstood something?
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.
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.
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.
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?
Hi,
I’ve tried to use your converter to create an LMX file but the form is only producing a PHP file.
The KML source file is http://www.econym.demon.co.uk/googlemaps/examples/example1.kml
Here’s a screenshot of the result: http://vraimbault.googlepages.com/screenshot.jpg
Am I missing something?
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
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.
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!
Hey, delete this post, this thing don’t work
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?
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
here is the real converter, enjoy (in spanish) http://www.davidmartinez.net/gm2lmx/
great!! After some fix to the mimes into my apache2, everuthings go well, under debian:
add the mime into /etc/mime.types
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!
thanks
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…
Hi,
nice web application. However, somtimes it is nice to have a independent converter on the own computer:
http://www.gpsbabel.org/
cheers
Martin
Hi,
Over at http://www.yourpinpoints.com you can search for an address on your computer and then send it to your Nokia ( N95 N82 N78 6210 etc) phone. The site sends the address in a format which is compatible with Nokia maps and Google maps.
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!!
ive used http://www.poieditor.com/poi_convert/kml-to-lmx/ and it works like a charm
you can find or create landmarks at http://socialect.com and click on “send to nokia” which will download landmarks on lmx format.
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
If somebody needs till now. There’s an official solution. )
http://thenokiablog.com/2008/07/12/how-to-send-locations-from-google-maps-on-computer-to-nokia-maps-on-phone/