hi, josm and rails port have different world parts. 65535 and 65536.
testing at bounds
for eg. at lon=180 we get different results, namely 65535 or 65536.
am I right?
look at this in quad_tile.rb
def self.tiles_for_area(bbox)
minx = ((bbox.min_lon + 180) * 65535 / 360).round
maxx = ((bbox.max_lon + 180) * 65535 / 360).round
miny = ((bbox.min_lat + 90) * 65535 / 180).round
maxy = ((bbox.max_lat + 90) * 65535 / 180).round
tiles = []
minx.upto(maxx) do |x|
miny.upto(maxy) do |y|
tiles << tile_for_xy(x, y)
end
end
return tiles
end
and this in josm QuadTiling.java
double WORLD_PARTS = 65536.0;
public static long lon2x(double lon)
{
//return Math.round((lon + 180.0) * QuadBuckets.WORLD_PARTS /
360.0)-1;
long ret = (long)((lon + 180.0) * WORLD_PARTS / 360.0);
if (ret == WORLD_PARTS) {
ret--;
}
return ret;
}
martin
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/dev

