I run gdal2tiles.py on a vrt (EPSG:4326) file and gives good results when overlay over OSM. Openlayers projection is EPSG:900913. The output is a set of directory/files (z/x/y). I used ms4w.
However, when I use slippy map calculations to find x/y tiles using equations here (lon/lat to tile numbers) it gives wrong y tiles (14730 in equations 17876 in gdal2tiles) (x tiles are the same as gdal2tiles).
When I reverse sign y coordinates I get right tile numbers, but the reverse equation (tile number to lat/lon) gives negative lat coordinates.
Is this related to coordinates transformation?