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

Generating insane file sizes #634

Closed
m0ngr31 opened this issue Aug 22, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@m0ngr31
Copy link

commented Aug 22, 2018

I have a geojson that is 43MB, but I'm needing to get to at least zoom level 20, and so obviously the file it creates is just massive.

When running: tippecanoe -o test.mbtiles -z20 --coalesce-densest-as-needed test.geojson, I get a filesize of 108GB(!).

What would be the best option to get this smaller? I'm not super concerned about the sharpness of the polygon, I just need a reasonable small filesize.

Lowering the detail or changing the simplification (both?)?

Also is there a way to convert my geojson file so I can do parallel processing on it? It can take 2+ days to create the file on my server.

@ericfischer

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2018

Zoom level 20 is extremely deep. Each of those tiles, even if it is entirely covered by a polygon, still has to spell out the gzip header, the square geometry, and whatever attributes your feature has. Nothing you do with detail or simplification is going to change this very much.

So my main suggestion is to use -zg instead of -z20 and only tile to whatever depth the inherent detail of your geometry actually requires. Vector tiles are meant to be overzoomable, so they can be viewed at deeper zoom levels than the tileset goes by magnifying the deepest available tile.

If you can't change that, the best you're going to be able to do is to lower the detail and the buffer size so there is as little geometry as possible in each tile. But it's only going to make a tiny difference.

If you want to be able to parse the GeoJSON file in parallel with -P, the requirement is just that no feature can be split across multiple lines. If you can't generate that directly, you can use tippecanoe-json-tool to preprocess your GeoJSON into newline-delimited json:

tippecanoe-json-tool source.json > out.nd.json

The tiling stage of Tippecanoe will always use as many CPUs as are available, no matter how the GeoJSON was formatted.

@m0ngr31

This comment has been minimized.

Copy link
Author

commented Aug 22, 2018

Vector tiles are meant to be overzoomable, so they can be viewed at deeper zoom levels than the tileset goes by magnifying the deepest available tile.

Maybe that's what I'm doing wrong. I'm using leaflet to display everything, but after a certain zoom level it just disappears. If that's the case I should be able to configure something on that then?

@ericfischer

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2018

I didn't even know Leaflet supported vector tiles, but it yes, it probably has an overzooming setting somewhere.

@m0ngr31

This comment has been minimized.

Copy link
Author

commented Aug 22, 2018

Yeah, there is a plugin for it (https://github.com/Leaflet/Leaflet.VectorGrid)

And I was able to figure out overzooming on it pretty easily. Thanks for the help! I'm going to go back to all my layers and just do -zg to get the rest of them to normal sizes too.

@m0ngr31 m0ngr31 closed this Aug 22, 2018

@2803media

This comment has been minimized.

Copy link

commented May 18, 2019

@m0ngr31 how to you use the overzooming function in vectorgrid, I can't find the setting? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.