I use OpenStreetMap in order to generate maps and add some cool stuff in it. Actually I have good results but I seem to have a problem with reporting a good image ratio when I create my generated file.
I put OpenStreetMap data in a PostgreSQL and I use PostGis to work with it in the EPSG:4326 projection. Everything is fine except this ratio problem.
In my program I use the min lon & min lat (as origin of the selection) ans max lon & max lat (as selection max coordinates). I thought a correct ratio would have been given by something like that (using N as size factor):
N = 10000
x_size = maxlon - minlon
y_size = maxlat - minlat
file_width = x_size * N
file_height = y_size * N
The most intriguing part is that this computation works for some parts of the world. In my examples below, the three cities use this ratio computation, but even if Montreal and Lyon don't work, Stockholm seems to work pretty well... The two others seem stretched.