mapbox / abaculus

Library for creating static maps from tiles based on center or corner lng,lat coordinates. Uses node-blend.
ISC License
127 stars 38 forks source link

Scale > 1 causes rendering errors in resulting image #23

Closed Mariusio closed 8 years ago

Mariusio commented 8 years ago

Every time I use scale = 1, everything is fine. However when I use scale > 1, I get rendering errors, see: https://gist.github.com/Maarius/a5969257ff46a9dbf38509386237b9e0

I use abacus 1.3.0 on a ubuntu machine.

springmeyer commented 8 years ago

Not sure why this is happening. Just a wild guess: you are setting the bbox parameter rather than the center? /cc @camilleanne

Mariusio commented 8 years ago

It happens for bbox and center. Also happens if I use the function for getTile that is described in the "we need an example" issue.

Mariusio commented 8 years ago

I can also upload a complete repo with reproduction steps if that helps?

Mariusio commented 8 years ago

This issue can easily be reproduced by changing this https://github.com/mapbox/abaculus/blob/master/test/test.js#L163 from 1 to 2, running the tests and reviewing the created image.

samwillis commented 8 years ago

I'm experiencing the same problem, it seems to be a regression introduced in version 2 when using bbox (I haven't tried center).

An interesting thing to note. If you render an image of the UK at scale 1 it works, when I change it to 2 the map moves to New Zealand... which is almost exactly 180deg out. Could it be that something odd is happening when the cords are calculated?

Also, if you slowly increment the scale from 1 to 2, say 1.1, 1.2 etc. the map will step across the earth in a south easterly direction until it lands on NZ at scale 2.

raphsibille commented 8 years ago

I'm having the same issue too. I've tried a bunch of different settings and map sources. All work fine except when either scale or tilesize is changed from 1 or 256 respectively.

jingsam commented 8 years ago

@Maarius When you set scale = 2, abaculus expects the size of tiles should be 512. However, your tilejson always request tiles with the size of 256.

Mariusio commented 8 years ago

@jingsam Thanks for pointing that out. I guess then this issue can be closed.

raphsibille commented 8 years ago

@Maarius has this been closed because this issue has been resolved? How do I increase scale without the render errors? @jingsam do I need to make changes to tilejson?