Skip to content

Instantly share code, notes, and snippets.

View elijahzarlin's full-sized avatar

Elijah Zarlin elijahzarlin

View GitHub Profile
<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;
@elijahzarlin
elijahzarlin / sheet-mapper-template.html
Created April 3, 2020 17:31
Sheet Mapper Template Code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Replace with your title</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://api.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.js"></script>
map.addSource('radar-data', {
type: 'vector',
url: 'mapbox://examples.dwtmhwpu'
});
map.addLayer({
"id": "radarpolygon",
"type": "fill",
"source": "raddar-data",
"source-layer": "0",
"filter": ["==", "idx", 0],
let theinterval = setInterval(function() {
map.setFilter('radarpolygon', ['==', 'idx', currentidx]);
}, 500);
let current_data = [...];//An h * w array from current step of radar image
let next_data = [...];//An h * w array from next step of radar image
let new_data = [];
for (let i = 0; i < h; i++) {
for (let j = 0; j < w; j++) {
new_data[i * w + j] = parseInt((current_data[i * w + j] + next_data[i * w + j]) / 2);
}
}
let polygons = contours()
const proj4 = require('proj4');
let pixel_position = [10, 20];
let geo_position = proj4('EPSG:3857', 'EPSG:4326',[
minLng + (maxLng - minLng) * (p[0] / w),
maxLat - (maxLat - minLat) * (p[1] / h)
]);
LambdaErrorAlarm: {
Type: 'AWS::CloudWatch::Alarm',
Properties: {
AlarmActions: [cf.importValue(cf.sub('on-call-production-${AlarmTeam}'))],
AlarmDescription: 'The Lambda errored more than once in the past 5 minutes.',
AlarmName: cf.join('-', [cf.stackName, cf.region]),
Period: 60,
EvaluationPeriods: 5,
Statistic: 'Sum',
Threshold: 0,
@elijahzarlin
elijahzarlin / upside-down-3.js
Created July 2, 2019 23:39
upside-down-3.js
[
"interpolate",
["linear"],
["zoom"],
0,
0,
1.84,
0,
1.85,
1,
@elijahzarlin
elijahzarlin / upside-down-1.js
Last active July 2, 2019 23:39
upside-down-1
[
"interpolate",
["linear"],
["zoom"],
0,
0,
1,
0,
1.31,
0.01,
@elijahzarlin
elijahzarlin / upside-down-2.js
Last active July 2, 2019 23:38
upside-down-2.js
[
"interpolate",
["linear"],
["zoom"],
0,
["literal", [-42, -40]],
2.01,
["literal", [0, 0]],
3.01,
["literal", [-20, -20]]