Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/m-lab/bigquery-maptiles

A service that manages the conversion of M-Lab BigQuery results into static world map tiles
https://github.com/m-lab/bigquery-maptiles

Last synced: about 1 month ago
JSON representation

A service that manages the conversion of M-Lab BigQuery results into static world map tiles

Awesome Lists containing this project

README

        

# bigquery-maptiles

Build container:

```sh
docker build -t bigquery-maptiles .
```

Generate input data:

```sh
docker run -e PROJECT=mlab-sandbox -v $PWD:/maptiles \
-v ~/.config/gcloud:/root/.config/gcloud -it bigquery-maptiles \
./prep-geojson-input.sh mlab-sandbox
```

NOTE: if the html and tiles are served from different domains we'll need to
apply a CORS policy to GCS.

## CORS

NOTE: may not be needed if served from an iframe.

* create a GCS bucket for the tile data.
* set defacl on bucket:

```sh
gsutil defacl set public-read gs://bigquery-maptiles-mlab-sandbox/
```

* set cors policy on bucket, so requests evaluate `Access-Control-Allow-Origin`
headers correctly.

```sh
gsutil cors set cors.json gs://bigquery-maptiles-mlab-sandbox
```

`cors.json` contains, a project-specific origin (origin URLs are examples):
```
[
{
"origin": ["http://localhost:4000", "https://grafana.mlab-sandbox.measurementlab.net"],
"responseHeader": ["Content-Type"],
"method": ["GET", "HEAD", "DELETE"],
"maxAgeSeconds": 3600
}
]
```