Skip to content

Commit

Permalink
show: version 2 detection [#27]
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Oct 27, 2022
1 parent ae94ae3 commit 5a1aad4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pmtiles/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func Show(logger *log.Logger, args []string) error {
header, err := deserialize_header(b[0:HEADERV3_LEN_BYTES])
if err != nil {
// check to see if it's a V2 file
if string(b[0:2]) == "PM" {
spec_version := b[2]
return fmt.Errorf("PMTiles version %d detected; please use 'pmtiles convert' to upgrade to version 3.", spec_version)
}

return fmt.Errorf("Failed to read %s, %w", file, err)
}
Expand Down

0 comments on commit 5a1aad4

Please sign in to comment.