I am trying to convert a Google Map KML file to a csv, to map the longitude and latitude points on Leaflet. But the coordinates keep mis-projecting and some end up off the land mass.

The steps I have done are: - Download KML file - Import into a GIS package (both MapInfo 12 and QGIS), and used the projections of WGS84 EPSG 3857, WGS84 EPSG 4326 and Google Mercator EPSG 900913, to create long/lat points - Save this table as csv - Upload to Leaflet using the Recline.js in DKAN to allow users to preview the map data.

Screenshot 1 is the original google map, and then screenshot 2 is the csv on Leaflet

enter image description here enter image description here

Have looked around the rest of the forum and cannot find an answer. Any help?

  • which of the the projections of WGS84 EPSG 3857, WGS84 EPSG 4326 and Google Mercator EPSG 900913 did you use? – Ian Turton May 11 '16 at 16:09
  • 4
    Any reason why not directly importing the KML into Leaflet, using plugins like leaflet-omnivore or Leaflet.FileLayer? – ghybs May 11 '16 at 17:00
  • Thanks @iant we tried this a few times and used all 3, WGS84 EPSG 3857 initially and then tried the other 2. WGS84 EPSG 3857: We just extracted the raw lat/long from the kml file and used them in leaflet WGS84 EPSG 4326 and Google Mercator EPSG 90091: We used the MapInfo and QGIS coordinate extraction tools to change the projection to WGS84 EPSG 4326 and Google Mercator EPSG 90091. Any suggestions? – Cambs.Insight May 12 '16 at 13:37
  • Hi @ghybs Not really, except we're relataive newbies to this and was hoping of developing a simple methodology for some users to transfer their data from kml to Leaflet in DKAN with lat/long. Use of plugins, to be honest think we'd struggle at this stagea, may be a tech step too far for us. Something to definitely follow up though. – Cambs.Insight May 12 '16 at 13:37
  • the original KML should be in 4326 (otherwise it's not really KML) so that may be where the issue occurs – Ian Turton May 12 '16 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.