Closed mikeocool closed 8 months ago
I guess I imagined the main use case here is doing something like:
pmtiles show --tilejson foo.pmtiles > foo.json
The TileJSON spec unfortunately requires absolute and not relative URLs for the tiles endpoint. Options I see are:
--public-hostname
just like with pmtiles serve
https://example.com/{z}/{x}/{y}.mvt
and a warning on stderr
if the public hostname is not passedI think it's ok to have that flag be there and only be relevant for --tilejson
, I think it's cleaner than making a whole new subcommand.
Is the context you will use this different from the above?
@bdon Yeah, that's pretty much exactly the use case I had in mind.
Went ahead and added a --public-url
arg -- that allows you to specify the full url for the tiles -- in case you aren't just hosting the tiles at https://whatever.com/key/{z}/{x}/{y}.mvt
-- and added the warning and the placeholder if you don't specify that arg.
So you should now be able to do: pmtiles show --tilejson test.pmtiles
or pmtiles show --tilejson --public-url https://example.com/test.pmtiles/{z}/{x}/{y} test.pmtiles
Thanks! I have some small additions I'll add in a followup PR
And arg to the show command that will output the full tile json -- reusing the code that generates the tilejson from the serve command:
pmtiles show --tilejson test.pmtiles
One part of this that's currently lacking is specifying the URL used in
tiles
-- currently it just outputs/{z}/{x}/{y}.mvt
. Was thinking either:pmtiles tilejson --tiles-url http://example.com/tiles.pmtiles/ tiles.pmtiles