0

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

PROJCS["NAD_1983_UTM_Zone_13N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-105.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

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
2

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.