Using OpenLayers to Convert Data
OpenLayers has the ability to read and write geographic data in several different formats: KML, GML, GeoRSS (Simple and GML), GeoJSON, WKT. One of the things that hasn’t thus far been exploited as a result of this is the use of OpenLayers as a format conversion tool… until today.
OpenLayers Data Conversion is a new service that allows easy conversion from any of the formats that OpenLayers supports to any of the formats that OpenLayers supports. Simply paste your data, choose your format, and hit convert. Additionally, this tool supports reprojection to and from Spherical Mercator, the internal coordinate system used in Google Maps.
This code isn’t quite in trunk of OpenLayers yet, but in the meantime, you can grab the example from an svn sandbox, including the prebuilt lightweight OpenLayers build for format conversion.
December 15th, 2007 at 2:57 pm
Hi Chris,
I like your enthusiasm and appreciate what open layers is- but isn’t what you are proposing here just a web front-end to GDAL and PROJ ?
maybe I am missing something
Cheers,
Dylan
December 15th, 2007 at 3:33 pm
Dylan:
Nope. This is entirely clientside Javascript: No OGR, Proj, or server side dependancies involved. (Just watch your network connection, if you don’t believe me: playing around with the demo will cause no network traffic.)
Note that I’m not ‘proposing’ anything — these are just bits that are going to need to go into OpenLayers for other reasons. I just thought it was fun to be able to pull them together like this — and demonstrate that OpenLayers is more than just a map drawing library.
December 15th, 2007 at 5:48 pm
Chris:
The client-side WGS84 GMap/VE projection functionality is very tasty, I’m sure thanks from Google and Microsoft will be coming forthwith….
Brian
May 8th, 2008 at 12:11 am
Hii Chris
The converter u explained above is a very useful tool.
I am also working on this these days as i want my application to be able to load and show any kind of data supported.like if i give the path of a file it is able to load it and show me the maps.
But the data conversions example urls u have mentioned above dont work
may be its removed from that place.
Pls check and update the urls
It would be real nice of You
Regards
Kusum
February 10th, 2009 at 9:39 am
Hiya – great post, thanks. Unfortunately the link you’ve posted is now dead . Is that file hosted anywhere else?
Regards
June 10th, 2010 at 2:11 pm
*BUMPING* the request for the content of those old links… or an update… or something!
Cheers!
June 10th, 2010 at 2:30 pm
svn co -r 6060 http://svn.openlayers.org/sandbox/crschmidt/projection
This will get you the code.
August 26th, 2011 at 10:26 am
Hi. That svn repo doesn’t seem to exist any more either. Do you have the code somewhere else, please? I’d love to see how you converted from KML to GeoJSON.
October 5th, 2011 at 5:28 am
Yep, can’t find the repo but would need this resource ! Is it possible to get the code please ? (for those who are interested, they may check this converter too http://blog.renevier.net/index.php?post/2010/05/27/gisconverter.php%3A-un-convertisseur-kml-geojson-wkt – unfortunately it’s too restrictive too mee)
October 5th, 2011 at 5:29 am
Argh…. maybe here finally http://trac.osgeo.org/openlayers/browser/sandbox/crschmidt/projection?rev=5427 ?