I'm attempting to import a shapefile (along with .prj file) to MySQL using Ogr2ogr and using the t_srs option set to EPSG:3857 (the default for Leaflet and Google Maps) but I'm getting odd results, eg:

POLYGON((-11368056.30134075 7311108.362629404,-11373244.15325952 7311276.412255973,-11372957.24394724 7313966.399114295,-11367933.92414896 7312806.137997068,-11368056.30134075 7311108.362629404)),1

the command I'm using is:

ogr2ogr -f MySQL MySQL:db,host=host,user=user,password=pass sourceDir -nln destTable -t_srs EPSG:3857 -update -overwrite -lco engine=MYISAM

the .prj in the sourceDir is


Any suggestions as to the problem?

  • I would try to find an EPSG code for the source SRS and give it as -s_srs and see if it has some effect. – user30184 Mar 25 '15 at 22:54
  • Doesn't make a difference I'm afraid, it's the first thing I tried but shouldn't be necessary anyway with the .prj file. It's EPSG:26913. – Fo. Mar 25 '15 at 23:09

I discovered my error. I was expecting to see lat/lng pairs from EPSG:3857, but it's actually EPSG:4326 I should have been converting to.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.