Skip to content

Instantly share code, notes, and snippets.

{
"version": 8,
"name": "Positron",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"carto": {
"type": "vector",
"url": "https://tiles.basemaps.cartocdn.com/vector/carto.streets/v1/tiles.json"
}
},
{
"version": 8,
"name": "Dark Matter",
"metadata": {
"maputnik:renderer": "mbgljs"
},
"sources": {
"carto": {
"type": "vector",
"url": "https://tiles.basemaps.cartocdn.com/vector/carto.streets/v1/tiles.json"
SELECT ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((-74.0020467871555 40.5700553733006,-74.0020845385496 40.5700656208815,-74.0024508655297 40.5722222586738,-74.0003034247082 40.5717119120673,-73.9969138511398 40.5713285807228,-73.9958192537108 40.5713011944326,-73.9934662094552 40.5715054776904,-73.9922946182143 40.5714444854396,-73.990364146684 40.5716261917419,-73.9873245341628 40.5723684709521,-73.9851553103799 40.5724063087494,-73.9807324470762 40.5729060231137,-73.9804767208744 40.5714997029641,-73.9804803510792 40.5714994268247,-73.9805150770012 40.57149430696,-73.9805531647583 40.5714900440247,-73.9805890095912 40.5714866307939,-73.9806237362088 40.5714832209613,-73.980657340773 40.5714798100078,-73.9806898254228 40.571478107166,-73.9807178297958 40.5714755517078,-73.9807469536963 40.5714729927512,-73.9807783188139 40.5714712888591,-73.9808074439144 40.5714687326464,-73.9808444089656 40.5714670305093,-73.9808892145631 40.5714644750494,-73.9809295401266 40.5714602106051,-73.9809709873828 40.5714568017817,-73.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"version": 8,
"name": "Dark Matter",
"metadata": {
"mapbox:autocomposite": false,
"mapbox:groups": {
"101da9f13b64a08fa4b6ac1168e89e5f": {
"collapsed": false,
"name": "Places"
},
{
"version": 8,
"name": "Dark Matter",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"carto": {
"type": "vector",
"url": "https://tiles.basemaps.cartocdn.com/vector/carto.streets/v1/tiles.json"
},
"carto_data": {
@jatorre
jatorre / geo2bq.sh
Created April 12, 2021 08:17
Script to upload GEO files to bigQuery using GDAL
#!/bin/bash
if [ -f "$1" ]; then
for fullpath in "$1"
do
filename="${fullpath##*/}" # Strip longest match of */ from start
dir="${fullpath:0:${#fullpath} - ${#filename}}" # Substring from 0 thru pos of filename
base="${filename%.[^.]*}" # Strip shortest match of . plus at least one non-dot char from end
ext="${filename:${#base} + 1}" # Substring from len of base thru end
if [[ -z "$base" && -n "$ext" ]]; then # If we have an extension and no base, it's really the base
--We create some fake isochrones
with pois AS (
SELECT ST_GEOGFROMGEOJSON('{"type":"MultiPolygon","coordinates":[[[[-3.9519882,40.262146],[-3.9358521,40.262146],[-3.9337921,40.2614594],[-3.9324188,40.2600861],[-3.9303589,40.2593994],[-3.9276123,40.2593994],[-3.9255524,40.2587128],[-3.9241791,40.2573395],[-3.9221191,40.2566528],[-3.9193726,40.2566528],[-3.9173126,40.2573395],[-3.9131927,40.2614594],[-3.9090729,40.2628326],[-3.9076996,40.2642059],[-3.9035797,40.2655792],[-3.8967133,40.2724457],[-3.8925934,40.273819],[-3.8912201,40.2751923],[-3.8871002,40.2765656],[-3.8857269,40.2779388],[-3.883667,40.2786255],[-3.8781738,40.2786255],[-3.8761139,40.2793121],[-3.8747406,40.2806854],[-3.8706207,40.2820587],[-3.8665009,40.2861786],[-3.862381,40.2875519],[-3.8610077,40.2916718],[-3.8568878,40.2957916],[-3.8562012,40.2978516],[-3.8562012,40.3033447],[-3.8568878,40.3054047],[-3.8610077,40.306778],[-3.8637543,40.3095245],[-3.8651276,40.3136444],[-3.8665009,40.3150177],[-3.8678741,40.3191376],[-3.8692474,40.3205109],[-
CREATE TEMP FUNCTION calculate_mapbox_price(num_tiles INT64, max_zoom INT64, min_zoom INT64)
RETURNS FLOAT64
DETERMINISTIC
LANGUAGE js
AS """
var sku;
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>team-ricky.suk_sandbox.openaq_wildfire | CARTO BigQuery Tiler</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://storage.googleapis.com/bqtilerjslibs/mbgl1.12.0.js'></script>
<link href='https://storage.googleapis.com/bqtilerjslibs/mbgl1.12.0.css' rel='stylesheet' />
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">