So I've got a shapefile that has polygons of countries, with coordinates in decimal degrees:

 Country (String) = Algeria
 POLYGON ((6.928073999999953 36.88360652,
           6.949973999999969 36.883306519999991, ...

gdalsrsinfo on the .prj file outputs:

PROJ.4 : '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m +no_defs '

    GEOGCS["GCS_unnamed ellipse",

To my untrained eye, the GEOGCS[] bit looks like it's defining the coordinate system in degrees, so this should work. However, if I include the .prj file, Google Maps Engine thinks the coordinates are in meters and renders everything as a tiny blob around (0,0). If I drop the .prj file, it defaults to degrees and returns a much more sensible rendering.

What's wrong, and how do I fix it? (Note the the shapefile is from a third party and produced with an unknown toolset.)

  • It's in Mercator projection but with no parameters. That definitely doesn't match the coordinates in the polygon. I say ignore the projection file. – Michael Stimson Jul 30 '14 at 4:17
  • Thanks, but could you expand on that a bit? Why would Mercator default to meters, and what parameters are missing? – jpatokal Jul 30 '14 at 4:23
  • Here is an article on the Mercator projection en.wikipedia.org/wiki/Mercator_projection. The first parameter is PROJGCS which instructs that this is a projected (UNIT["Meter",1]) coordinate system but central meridian, false easting and northing and lattitude of origin are missing, usually they would have values. Here the first word is important, PROJCS for projected and GEOGCS for geographic. – Michael Stimson Jul 30 '14 at 4:33

The projection part of the .prj file declares units as meters, so that is what you get.

If your data is in degrees, you have to use a .prj file for EPSG:4326:


without any projection information.

Looking at the coordinates you supplied, the .prj file is definitely wrong. Just delete it, and create a new one with the data I included.

  • 2
    Assuming that the data is in WGS84. Otherwise you might need to do some digging to find out what coordinate system it really is. Compare against known-accurate features like basemaps/google and decide if WGS84 is correct or close enough or whether to delve further. – Michael Stimson Jul 30 '14 at 4:37
  • The coordinates fit quite good to WGS84 for the Algerian coastline. – AndreJ Jul 30 '14 at 4:47

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.