GithubHelp home page GithubHelp logo

tilezen / go-tilepacks Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 2.0 5.79 MB

A Go-based tile downloader that saves to deduplicated mbtiles files.

License: MIT License

Go 94.76% HTML 4.85% Makefile 0.39%

go-tilepacks's Introduction

go-tilepacks

A Go-based tile downloader that saves to deduplicated files.

Tools

build

./bin/build -h
Usage of ./bin/build:
  -bounds string
    	Comma-separated bounding box in south,west,north,east format. Defaults to the whole world. (default "-90.0,-180.0,90.0,180.0")
  -bucket string
    	(For metatile, tapalcatl2 generator) The name of the S3 bucket to request t2 archives from.
  -cpuprofile string
    	Enables CPU profiling. Saves the dump to the given path.
  -dsn string
    	Path, or DSN string, to output files.
  -ensure-gzip
    	Ensure tile data is gzipped. Only applies to XYZ tiles. (default true)
  -file-transport-root string
    	The root directory for tiles if -url-template defines a file:// URL scheme
  -generator string
    	Which tile fetcher to use. Options are xyz, metatile, tapalcatl2. (default "xyz")
  -inverted-y
    	Invert the Y-value of tiles to match the TMS (as opposed to ZXY) tile format.
  -layer-name string
    	(For metatile, tapalcatl2 generator) The layer name to use for hash building.
  -materialized-zooms string
    	(For tapalcatl2 generator) Specifies the materialized zooms for t2 archives.
  -output-mode string
    	Valid modes are: disk, mbtiles. (default "mbtiles")
  -path-template string
    	(For metatile, tapalcatl2 generator) The template to use for the path part of the S3 path to the t2 archive.
  -timeout int
    	HTTP client timeout for tile requests. (default 60)
  -url-template string
    	(For xyz generator) URL template to make tile requests with.
  -workers int
    	Number of tile fetch workers to use. (default 25)
  -zooms string
    	Comma-separated list of zoom levels. (default "0,1,2,3,4,5,6,7,8,9,10")

Job Creators

HTTP

Required arguments:

  • -url-template: template for an HTTP request per tile. Use {z} for zoom, {x} for x or column, and {y} for y or row.

Metatile

Required arguments:

  • -bucket: specify the S3 bucket to fetch from
  • -layer-name: a string name for the layer part of the path template.
  • -path-template: template for the path part of the request to S3. Use {z} for zoom, {x} for x or column, {y} for y or row, {l} for layer name, and {h} for the hash prefix (see below).

Hash Prefix

The "hash prefix" is used by the Tilezen tiler to spread the load of tile fetches across S3 shards. In practice, it is the first 5 characters of the MD5 sum of the evaluated template string {zoom}/{x}/{y}.zip (e.g. 12/242/533.zip).

Tapalcatl 2

Outputters

The following tile "outputter" are supported, as defined by the -mode flag:

disk

Clone tiles to a local directory. Valid -dsn strings must be in the form of:

-dsn 'root={PATH_TO_DIRECTORY_ROOT} format={TILE_FORMAT}'

mbtiles

Clone tiles to a MBTiles (SQLite) database. Valid -dsn strings must be in the form of:

-dsn '{PATH_TO_MBTILES_DATABASE}'

go-tilepacks's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-tilepacks's Issues

build/serve question

I am trying to build an MBTiles database using the build tool:

$> go run -mod vendor cmd/build/main.go  -dsn sf.db -bounds '37.63983,-123.173825,37.929824,-122.28178' -zooms 0-16 -url-template 'https://tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt?api_key=***'
2021/06/01 11:16:28 Created mbtiles output
2021/06/01 11:17:38 Saved 10k tiles (143.8 tiles per second)
2021/06/01 11:17:55 Job queue closed
2021/06/01 11:18:07 Finished making tile requests
2021/06/01 11:18:07 Saved 15080 tiles
2021/06/01 11:18:07 Finished processing tiles

And then serving it using the serve tool:

$> go run -mod vendor cmd/serve/main.go -input sf.db

But when I try to see the tiles in a web browser by visiting:

http://localhost:8080/preview.html#lat=37.6073&lng=-123.1311&z=13

I just see an empty map and a lot of 404 errors for the individual tiles requests. I feel like I am forgetting to do something obvious here but I am having trouble figuring out what...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.