[Tilesathome] Lowzoom Place Labels displaced

Knut Arne Bjørndal bob+osm at cakebox.net
Fri Sep 19 15:49:11 BST 2008


On Fri, Sep 19, 2008 at 09:28:37AM +0200, Knut Arne Bjørndal wrote:
> On Fri, Sep 19, 2008 at 09:20:57AM +0200, Sebastian Spaeth wrote:
> > Knut Arne Bjørndal wrote:
> > > On Fri, Sep 19, 2008 at 07:25:04AM +0200, Sebastian Spaeth wrote:
> > >> This is still the case. The lower zoom, the worse. That is why I turned 
> > >> of lowzoom captions on z0-6 again. Continent captions, country captions 
> > >> were far (extremely far) out of place. I think the place where Oslo is 
> > >> located was labeled "Italy" :-).
> > ...
> > > I had a look at that patch, and couldn't really wrap my head around
> > > why it would work. I discussed the projection stuff with 80n a while
> > > ago, and iirc he had tried making those calculations more accurate
> > > without seeing any improvements in the output, so I'm not sure that's
> > > the way to go to fix the problem.
> > 
> > Perhaps it makes no different on z12 (I think deelkar once calculated 
> > that it's half a pixel in z12 or so) and then we can skip this on osma. 
> > But fixing this in orp so we can do lowzoom captions would still be great.
> 
> The context was lowzoom, so definitely lower than z12.

16:09 < bobkare> _80n: Have you seen the tah list thread about lowzoom
labels btw? could you perhaps expand on what osma projection stuff you
had already tested?
16:10 < _80n> First, I tried calculating the projection for each point
rather than just the mid point in the tile
16:10 < bobkare> surely that must help a lot
16:10 < _80n> ...that  made no noticeable difference
16:11 < bobkare> at what zoomlevel?
16:11 < _80n> I was testing with z8 through z11, I think
16:12 < _80n> Second I tried adding more precision to the trig
function
16:12 < _80n> ...again no noticable difference
16:12 < bobkare> hm, i guess the issues we saw when spaetz did
ultra-lowzoom captions were at z0-z6
16:13 < bobkare> Did you try anything with the log thing?
16:13 < _80n> So what was fixed to make it work for z8 then?
16:14 < _80n> No, never got to try the log thing
16:14 < spaetz> bobkare: no issues appeared at z11 and became weirder
towards z0
16:14 < bobkare> right, the issue might be there then
16:14 < spaetz> I think it's an orp issue in addition to projection
16:15 < bobkare> you didn't try with osma xslt at all?
16:15 < spaetz> bobkare: no, I didn't, I think

So, I guess some things to try are:
1) Test spaetz's lowzoom stuff with osma xsl
2) Try repeating some of these improvements with even lower zooms,
where errors should be more apparent

The projection algorithm somebody threw in somewhere else in this
thread seemed quite different from what is currently in osma, which is
roughly like this:
lat_rad = middleLatitude * pi / 180
projection = 1/cos(lat_rad)

x = $width - (($topRightLongitude - @lon) * 10000 * $scale)
y = $height + (($bottomLeftLatitude - @lat) * 10000 * $scale * $projection)

Could this be the difference between proper mercator and spherical
mercator or something? (I'm guessing wildly here, feel free to
disregard if I'm writing nonsense)

If the entire projection algorithm is plain wrong and we can find some
way of doing a better one in xslt that's bound to help...

Oh, and whoever tests this should probably not use the tiles at home
client since it moves things around with it's slice trick.

-- 
Knut Arne Bjørndal
aka Bob Kåre
bob+osm at cakebox.net
bobkare at irc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4167 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20080919/9e28d847/attachment.bin>


More information about the Tilesathome mailing list