Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to render tiles with shp2img tool from Mapserver suite and my tiles aren't matching. Tiles are numbered like in This is an attempt to draw tile (level 1, x=1, y=0) which has extent [xmin=0, ymin=0, xmax=180, ymax=90]:

This picture is rendered with extent [xmin=0, ymin=0, xmax=180, ymax=90]. See the problem? Ymin is clearly not zero here.
And this one with extent [xmin=0, ymin=0, xmax=90, ymax=90]:

Now ymin looks zero as it should. It seems like Mapserver tries to keep aspect ratio and is extending rendered area to do that. But this ruins my tile service.
How do I setup projection in my MAP file to get matching tiles? Or what else to do to get tiles right.

Update: this is how tile z=1, x=1, y=0 looks in, I guess I need reproject my map in such projection?

Some details:
ogrinfo output:

Layer SRS WKT:
    DATUM["MIF 0",

Projection section from MAP file:

share|improve this question
up vote 2 down vote accepted

Resolved, I just set projection in MAP file to Mercator:

END # btw, is there a way to declare it shorter? "init=epsg:900913" is unknown to my Mapserver.

and in each layer object its own coordinate system is declared:


After that, my map started to use meters as units and projection changed to Mercator, now tiles are good.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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