OSGeo / tilecache

Tilecache
35 stars 18 forks source link

TypeError: range() integer end argument expected, got float. #13

Open seidlmic opened 9 years ago

seidlmic commented 9 years ago

This BUG is already mentioned in Pull Requests.

File "/var/www/dev/3data/minemap/map-layer/cgi-bin/tilecache-github/tilecache/TileCache/Client.py", line 117, in seed for y in range(startY, endY, stepY): TypeError: range() integer end argument expected, got float.

It is caused by commit from 2011 where a change in Layer.py was made

    x = int(x0)
    y = int(y0)

   -->

    x = round(x0)
    y = round(y0)

` I think better solution then change line #117 in Client.py is to fix Layer.py by

    x = int(round(x0))
    y = int(round(y0))
winkey commented 9 years ago

a lillte history,

the change from round to cast a long time ago broke the server. I changed it back in 2011, I am hesatant to mess with that

this is also why i asked for clarification and a bug report on that pull request.

winkey commented 9 years ago

is this related to your other bug? https://github.com/OSGeo/tilecache/issues/14

the change from cast to round would cause that number to change perhaps seed should be using its own logic here?

it does no good to break the server to fix the client

winkey commented 9 years ago

link to that pull request on seed https://github.com/OSGeo/tilecache/pull/8

seidlmic commented 9 years ago

Acually I have no knowledge about TileCache. I just start to dig for reason why tilecache_seed.py creates strange protocols that does not reflect what is actually created.

Strange:

It look that all of this is also connected with my "crazy" settings. metatile=yes metasize=1,1 metabuffer=100 that I use as workaround of label problem at edges of tiles.

The #14 an #13 issues are just side efects.

Despite this i guess the x,y,z should be integers not floats.

winkey commented 9 years ago

metabuffer should be 2 ints, other than that you set it however big you need it, nothing crazy about that

seidlmic commented 9 years ago

Thanks for hint. Maybe will help.

from tilecache.cfg

# metaBuffer=10 *** size of metatile buffer in px ***