tilery / pianoforte

Generic purpose map rendering in two flavours.
http://tiles.quaidorsay.fr/
Creative Commons Zero v1.0 Universal
28 stars 8 forks source link

Use Mapnik simplify algorithm instead of a dedicated file #33

Closed yohanboniface closed 6 years ago

yohanboniface commented 6 years ago

It's a bit (not that much) slower, but given it's all pregenerated tiles, it's harmless. And it makes the workflow much simpler.

@kent1D can you have a check, given it's a sensible topic? :)

I've already deployed on the preprod site so you can check it with other data (only in Africa):

https://carte-mae.enix.org/#4/-3.25/25.66

kent1D commented 6 years ago

What I see is that it a bit less precise of the older way to do that

And it leaves some holes.

Is there a big performance issue playing with line-simplify ?

yohanboniface commented 6 years ago

And it leaves some holes.

Oops. Can you point me to one? :) It may just be a matter of finding the right tolerance.

Is there a big performance issue playing with line-simplify

Nope, not big.

kent1D commented 6 years ago

Where it's quite visible is where there is not concrete other datas because no sub admin level boundaries.

Some polygons appear.

At zoom 4 the most, some examples :

kent1D commented 6 years ago

Or maybe there is an option to clip them?

yohanboniface commented 6 years ago

Seems I'm totally missing something here :( May be related to screen resolution or something.

Here is what I see (feint: after is on the left, before in on the right):

screenshot from 2018-03-09 08-55-23

I detect no hole nor lack of precision :s

kent1D commented 6 years ago

hmmm quite strange, here is what I see on carte-mae.enix capture d ecran 2018-03-09 a 09 14 52

Look around Belgium / Netherland, Moldavia / Romania

kent1D commented 6 years ago

Ok yours is @2x and mine is @1x

I have two screens on my computer, one retina and the other not, and effectively it's not the same ;)

capture d ecran 2018-03-09 a 09 18 07
kent1D commented 6 years ago

I will try your branch this afternoon and try to play with the simplification option and tell you

yohanboniface commented 6 years ago

Ok yours is @2x and mine is @1x

Bah, makes sense, "my" images are twice bigger, so simplification is twice lower, so I've adjusted a bit high for the normal images.

I will try your branch this afternoon and try to play with the simplification option and tell you

Cool, thanks. I'll make a try with half the simplification in the meantime :)

yohanboniface commented 6 years ago

I'll make a try with half the simplification in the meantime

Sounds better for normal tiles with 5, and of course it's less simplified with the retina one, but it's more acceptable that way. One option may be to use pixel_width/height to adapt the tolerance. Given the pixel_height changes either with zoom, map scale and latitude, it's certainly too much of an alchemy to play with it. AFAIK, pixel_width should only change with zoom and scale (not with latitude), so it may worth a try.

But at the end I'm not even sure if it's a bug or a feature that the line-simplify algorithm does not seems to take into account the map scale. @springmeyer any hint from the top of your head on this?

kent1D commented 6 years ago

Oups? j'ai fermé, désolé... je ne sais pas comment, il ne faut pas me donner trop de droits :D

C'est beaucoup mieux sur la version actuelle

springmeyer commented 6 years ago

@springmeyer any hint from the top of your head on this?

No, not looked at that code for a long time now.