e-n-f / datamaps

Indexes points and lines and generates map tiles to display them
BSD 2-Clause "Simplified" License
341 stars 53 forks source link

Tile count estimate #18

Closed umaar closed 8 years ago

umaar commented 8 years ago

I was generating a tileset for a single zoom level (15) and actually ran out of inodes!

Command: enumerate -z15 -Z15 dirname | xargs -L1 -P8 ./render -o tiles/dirname

To ensure the machine I'm using is suitable, how can I figure out the total file count (not size) for zoom level 15?

e-n-f commented 8 years ago

You can do enumerate -z15 -Z15 dirname | wc -l to count the tiles in advance.

e-n-f commented 8 years ago

This is one of the problems that has led me to write https://github.com/mapbox/tippecanoe as a replacement. Using vector tiles, and writing those tiles to an mbtiles container rather than to individual files, avoids the massive number of tile files at high zoom levels.

umaar commented 8 years ago

Heh, so quick and to the point! Thanks, that's exactly what I needed.

I ran the command, for everything up to zoom level 15, it's around 14 million files! I think I will check out your tippecanoe project. Just wondering, with your datamaps project, I'd do something like:

# Encode location data
cat file | ./encode -o directoryname -z 16

# Produce a one-off static map
./render -A -- directoryname zoom minlat minlon maxlat maxlon > foo.png

# Produce a tileset for a detailed + interactive map
enumerate -z14 dirname | xargs -L1 -P8 ./render -o tiles/dirname

For each of those commands (encode, render & enumerate), are there corresponding equivalents in tippecanoe? I'll have to read more on the documentation and more about mbtiles, but not having to create so many files sounds great.

All the work you do is fascinating and inspiring, thanks!