This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```ts | |
"use strict"; | |
const pulumi = require("@pulumi/pulumi"); | |
const aws = require("@pulumi/aws"); | |
const awsx = require("@pulumi/awsx"); | |
//* Create Kinesis stream for ingestion | |
const ingestStream = new aws.kinesis.Stream("ingestAssets", { | |
shardCount: 1, | |
retentionPeriod: 72 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```bash | |
$ brew install pulumi | |
$ mkdir asset-tracking && cd asset-tracking | |
$ pulumi new aws-javascript | |
$ yarn install | |
$ ls | |
Pulumi.dev.yaml Pulumi.yaml index.js node_modules package-lock.json package.json | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Deckgl RGB PointCloud + Mapbox</title> | |
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script> | |
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js"></script> | |
<link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css"> | |
<style> | |
body { | |
background-color: #000000; | |
margin: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"interpolate", | |
["linear"], | |
["zoom"], | |
2, | |
[ | |
"/", | |
[ | |
"max", | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"interpolate", | |
["linear"], | |
["get", "WindSpeed.Kph"], | |
55, | |
"hsl(47, 100%, 90%)", | |
120, | |
"hsl(340, 100%, 82%)", | |
220, | |
"#ff0040" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bearing = ruler.bearing(firstPoint, nextPoint); | |
let p1 = ruler.destination(nextPoint, errorRadius, bearing + 90); | |
let p2 = ruler.destination(firstPoint, acc.prevPoint.errorRadius, bearing + 90); | |
let p3 = ruler.destination(firstPoint, acc.prevPoint.errorRadius, bearing - 90); | |
let p4 = ruler.destination(nextPoint, errorRadius, bearing - 90); | |
const polygon = turf.polygon([[p1, p2, p3, p4, p1]]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const errorRadiusKm = ruler.distance([item.lon, item.lat], [item.lon + errorRadiusDeg, item.lat]); | |
const circle = turf.circle([item.lon, item.lat], errorRadiusKm, {steps: 32, units: 'kilometers'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const map = new mapboxgl.Map({ | |
container: "map", | |
style: "mapbox://styles/mapbox/light-v9", | |
center: [-122.398, 37.788], | |
zoom: 12, | |
pitch: 60 | |
}); | |
map.on("style.load", () => { | |
// Get data for the arc map from SFMTA origin/destination routes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nearest = turf.nearestPoint(user, locations); | |
var bearing = turf.bearingToAzimuth(turf.bearing(user, nearest)); | |
var distance = turf.distance(user, nearest, { units: meters }); | |
if (distance < 50) { | |
// Unlock Emerald Star | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var locations = turf.featureCollection([ | |
turf.point([latitude, longitude]), | |
turf.point([latitude, longitude]) | |
]); | |
var user = turf.point([latitude, longitude]); |