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

Improved Documentation #80

Closed
KoalaGeo opened this issue Sep 14, 2023 · 4 comments
Closed

Improved Documentation #80

KoalaGeo opened this issue Sep 14, 2023 · 4 comments

Comments

@KoalaGeo
Copy link

KoalaGeo commented Sep 14, 2023

Hi,

Please could you add examples of how to use pmtiles via docker to build or upload pmtiles

Beleive it something like docker run -v $(pwd)/data:/var/ ghcr.io/protomaps/go-pmtiles:main convert radon.pmtiles radon.mbtiles, however this doesn't work for me.

Please could you also provide more detailed instructions to install on linux - I can see the binary but don't know how to install

I'll happily add to the readme and submit a PR once I know how.

Kind regards,

Edd

@bdon
Copy link
Member

bdon commented Sep 14, 2023

The linux binary does not need installation, you simply run the binary with ./pmtiles. This should also obviate the need for Docker.

@daniel-j-h
Copy link

I'm also running the pmtiles binary through docker and can give some input here in case that helps:

docker run -v $(pwd)/data:/var/ ghcr.io/protomaps/go-pmtiles:main convert radon.pmtiles radon.mbtiles

In your command here you mount your ./data directory into the container at /var/ and because convert runs inside the container you have to prefix your input and output paths with /var/, too.

Below is an example of how I run it. I noticed I also had to change the TMPDIR env var because otherwise the creation of temporary files does not seem to work with the scratch image by default, resulting in

2024/05/09 10:39:36 main.go:177: Failed to create temp file, open /tmp/pmtiles2186268370: no such file or directory

This runs the latest go-pmtiles to convert a .mbtiles file to a .pmtiles file; pretty neat!

$ docker run -it --rm --pull always -e TMPDIR=/data -v $(pwd):/data ghcr.io/protomaps/go-pmtiles:main convert /data/monaco-latest.mbtiles /data/monaco-latest.pmtiles
main: Pulling from protomaps/go-pmtiles
Digest: sha256:9627edcd10eed2936c63602333f13270644d659d823d2478fa60c1dac99d60b1
Status: Image is up to date for ghcr.io/protomaps/go-pmtiles:main
2024/05/09 10:39:46 convert.go:260: Pass 1: Assembling TileID set
2024/05/09 10:39:46 convert.go:291: Pass 2: writing tiles
 100% |███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (22/22, 10100 it/s)
2024/05/09 10:39:46 convert.go:345: # of addressed tiles:  22
2024/05/09 10:39:46 convert.go:346: # of tile entries (after RLE):  22
2024/05/09 10:39:46 convert.go:347: # of tile contents:  22
2024/05/09 10:39:46 convert.go:369: Total dir bytes:  123
2024/05/09 10:39:46 convert.go:370: Average bytes per addressed tile: 5.59
2024/05/09 10:39:46 convert.go:340: Finished in  12.034584ms

@bdon
Copy link
Member

bdon commented Sep 12, 2024

New docs for CLI here: https://docs.protomaps.com/pmtiles/cli

@bdon
Copy link
Member

bdon commented Sep 12, 2024

added Docker example here: https://docs.protomaps.com/pmtiles/cli#convert

TMPDIR in Docker was resolved by #171

@bdon bdon closed this as completed Sep 12, 2024
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

3 participants