Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunky rivers when generalizing water areas #2087

Open
pnorman opened this issue Sep 30, 2023 · 2 comments
Open

Chunky rivers when generalizing water areas #2087

pnorman opened this issue Sep 30, 2023 · 2 comments

Comments

@pnorman
Copy link
Collaborator

pnorman commented Sep 30, 2023

What version of osm2pgsql are you using?

1.9.2-29-g374eca48

What did you do exactly?

I am generalizing water tables with themepark and osm2pgsql-gen

osm2pgsql.run_gen('raster-union', {
    schema = themepark.options.schema,
    name = 'water_z12',
    dest_table = 'water_z12',
    src_table = 'water',
    zoom = level
})
osm2pgsql.run_gen('raster-union', {
    schema = themepark.options.schema,
    name = 'water_z8',
    dest_table = 'water_z8',
    src_table = 'water',
    zoom = level
})

What did you expect to happen?

I expected generalized tables that would be useful at z8 and z12.

What did happen instead?

At z8, the water areas are "chunky" when using the z8 table
image

This is rendered at 1 z8 tile = 512 device independent pixels

It's not really any better at z7
image

Loading it in QGIs shows large chunks of rivers missing

image

I found a smaller river and looked at at z12, and similar problems are observed but they're not as severe

image

What did you do to try analyzing the problem?

I could see needing to adjust the zoom levels where the generalized tables start to be used by one, because the defaults could have been set for 256px tiles. But I tried that by looking at z7, and it was still a problem.

I tried a 25% buffer_size, and a 4096px image_extent. The latter helped slightly, but it was still a problem.

@joto
Copy link
Collaborator

joto commented Sep 30, 2023

You have to play around with zoom levels and extent to get this right. The zoom levels mentioned in the generalizer config are not necessarily the same zoom levels you generate the generalization for. They are merely used to decide how to cut the world for the generalization process.

@pnorman
Copy link
Collaborator Author

pnorman commented Oct 2, 2023

We should aim for the defaults to generally be a good starting place. I'm working my way through the different types of polygons, but at least for water, I don't think they are.

I've had some success with adjusting the buffer_size, and I think this is why the different image_extent worked - instead of being a buffer of 10/2048 of a tile, it was 10/4096.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants