Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ustroetz
ustroetz / index.html
Created July 12, 2017 11:23
Spike to use custom Mapbox Vector Tiles
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.38.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.38.0/mapbox-gl.css' rel='stylesheet' />
<style>
@ustroetz
ustroetz / service.py
Last active November 5, 2023 21:30
Lambda function to trigger dependent AWS Batch jobs
def handler(event, context):
client = boto3.client('batch', 'us-east-1')
analyzer_job = client.submit_job(
jobName='ma-analyzer',
jobQueue='ma',
jobDefinition='ma-analyzer:1',
containerOverrides={
'command': ['python', 'service.py']
})
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import mapbox_vector_tile
import requests
tile_id = 'allryder.ama_districts-staging'
url = 'https://a.tiles.mapbox.com/v4/' + tile_id + '/10/531/341.vector.pbf'
querystring = {"access_token":"pk.eyJ1IjoiYWxscnlkZXIiLCJhIjoidWs5cUFfRSJ9.t8kxvO3nIhCaAl07-4lkNw"}
response = requests.request("GET", url, params=querystring)
import mapbox_vector_tile
import requests
tile_id = 'allryder.ama_districts-staging'
url = 'https://a.tiles.mapbox.com/v4/' + tile_id + '/10/531/341.vector.pbf'
querystring = {"access_token":"pk.eyJ1IjoiYWxscnlkZXIiLCJhIjoidWs5cUFfRSJ9.t8kxvO3nIhCaAl07-4lkNw"}
response = requests.request("GET", url, params=querystring)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.