Skip to content

Conversation

roblabs
Copy link
Contributor

@roblabs roblabs commented Apr 24, 2025

Minor feature enhancement to pmtiles show

  • pmtiles show now generates an encoded URL that will quickly take you to PMTiles.io with your archive passed in.
  • Perfect for 1-click links for inspecting PMTiles.
  • Easily clickable from Visual Studio code or on macOS use open -a <browser_name>
  • Future ideas below.

Test on S3 compatible PMTile

# log an element "xray:"
pmtiles show https://demo-bucket.protomaps.com/v4.pmtiles

Result


Test on local PMTile

For the case of a local file, the "xray: " log element is disabled.

# Show works as before
pmtiles show pmtiles/fixtures/test_fixture_1.pmtiles

Future ideas with other pmtiles commands:

tile
local file + serve
  • pmtiles show for a local file: "Maybe provide a hint that the Go tool can also serve a folder":
    • pmtiles serve pmtiles/fixtures
  • pmtiles serve could also log a link to the locally servedTileJSON: https://pmtiles.io/#url=http%3A%2F%2Flocalhost%3A8080%2Ftest_fixture_1.json
    • Works with: pmtiles serve pmtiles/fixtures --public-url=http://localhost:8080

@@ -109,6 +111,10 @@ func Show(_ *log.Logger, output io.Writer, bucketURL string, key string, showHea
fmt.Println(k, "<object...>")
}
}

if strings.HasPrefix(bucketURL, "https://") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in Safari & Firefox for macOS

@bdon bdon merged commit 771432f into protomaps:main Apr 30, 2025
3 of 4 checks passed
@bdon
Copy link
Member

bdon commented Apr 30, 2025

Released in https://github.com/protomaps/go-pmtiles/releases/tag/v1.28.0

@roblabs roblabs deleted the feature/xray_from_cli branch April 30, 2025 14:47
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

Successfully merging this pull request may close these issues.

2 participants