Skip to content

Instantly share code, notes, and snippets.

View TimMcCauley's full-sized avatar
🌏
Browsing around.

Timothy Ellersiek TimMcCauley

🌏
Browsing around.
  • Bonn, Germany
View GitHub Profile
@TimMcCauley
TimMcCauley / eslint_prettier_airbnb.md
Created June 17, 2022 10:47 — forked from geordyjames/eslint_prettier_airbnb.md
VSCode - ESLint, Prettier & Airbnb Setup for Node.js Projects

VSCode - ESLint, Prettier & Airbnb Setup for Node.js Projects

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-node eslint-config-node
import subprocess
from osgeo import gdal
unreferenced_pdf = '851724.603697945_6734206.62182539_852044.603697945_6734631.62182539.pdf'
a_ullr = unreferenced_pdf.replace('.pdf', '').split('_')
#Open your Unreferenced PDF
src = gdal.Open(unreferenced_pdf)
ulx = a_ullr[2]
package vector_tile;
option optimize_for = SPEED;
message Tile {
enum GeomType {
UNKNOWN = 0;
POINT = 1;
LINESTRING = 2;
POLYGON = 3;
}
message Value {
1aa9 050a 0c54 7261 6666 6963 2066 6c6f
7712 3512 0800 0001 0102 0203 0318 0222
2709 bc12 fc1b 4a8c 0307 9c06 f002 8c06
bc02 f003 c001 b404 a801 b803 60b0 0358
e00d 9002 d807 8c01 1235 1208 0000 0104
0202 0305 1802 2227 09b4 46f6 2b4a f708
69d3 0fff 01e7 0137 eb01 2bbb 079f 02b7
03bb 018b 03d3 01b3 08df 04a3 019b 0212
1c12 0800 0001 0102 0603 0718 0222 0e09
b306 e40d 12ec 0480 0384 1498 0b12 1c12
EXPLAIN ANALYZE
WITH poly AS (
--SELECT ST_GeomFromText('POLYGON((25.390624999999982 23.62298461759423,18.183593749999982 19.371888927008566,7.812499999999982 17.87273879517762,5.878906249999982 24.90497143578641,9.570312499999982 25.223427998254586,12.734374999999982 25.064303191014304,15.195312499999982 30.048744443788348,22.578124999999982 30.352588399664125,24.687499999999982 25.857838723065772,25.390624999999982 23.62298461759423))') AS geom
--SELECT ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[8.407297932191138,55.043952286536452],[8.442500114441145,55.015972137451399],[8.353609085083235,54.967361450195654],[8.366944313049544,54.902362823486442],[8.429720878601302,54.877639770507869],[8.812039375305233,54.916736602783203],[9.224779129028263,54.855953216552791],[9.282591819763411,54.802234649658317],[9.408679962158317,54.841171264648494],[9.435277938842773,54.788471221923885],[9.613611221313704,54.875972747802962],[9.603055953979776,54.831527709961051],[9.84305572509794,54.7562484
import shapely.wkt
from shapely.geometry import box
def generate_tiles():
# width and height of the tiles to generate
WIDTH, HEIGHT = 1000, 1000
# from user arbitrary polygon, could be buffered
all_bbox = shapely.wkt.loads('POLYGON ((531371.13571106398012489 5658034.45453725103288889, 544256.06067719822749496 5658034.45453725103288889, 544256.06067719822749496 5670266.97823927644640207, 531371.13571106398012489 5670266.97823927644640207, 531371.13571106398012489 5658034.45453725103288889))')
@TimMcCauley
TimMcCauley / make_buffers.sql
Last active January 11, 2021 16:44
Groups parallel lines using DBScan into clusters and unions their buffers
-- This set of queries derives a perpendicular line through all input lines
DROP TABLE IF EXISTS intersection_points;
CREATE TABLE intersection_points
AS
-- 2 lines will suffice to compute a perpendicular
WITH nbr_parallel_lines AS (
SELECT A.geom AS A_geom, B.geom AS B_geom
FROM parallel_lines AS A, parallel_lines AS B
WHERE A.fid_1 <> B.fid_1
ORDER BY A.geom <-> B.geom
@TimMcCauley
TimMcCauley / car-location-dependent-speeds.lua
Created December 10, 2020 07:41
This lua file is used in OSRM v5.23.0 and makes use of polygons provided to manipulate the edge forward and backward speed. Look for "customized speed manipulation" in the lua script.
api_version = 4
Set = require('lib/set')
Sequence = require('lib/sequence')
Handlers = require("lib/way_handlers")
Relations = require("lib/relations")
find_access_tag = require("lib/access").find_access_tag
limit = require("lib/maxspeed").limit
Utils = require("lib/utils")
Measure = require("lib/measure")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
goroutine 67149298 [runnable]:
github.com/TykTechnologies/tyk/vendor/github.com/TykTechnologies/redigocluster/rediscluster.ConcurrentMap.Iter.func1.1(0xc4240154a0, 0xc422bb1650, 0xc4204610e0)
/src/github.com/TykTechnologies/tyk/vendor/github.com/TykTechnologies/redigocluster/rediscluster/concurrent_map.go:171
created by github.com/TykTechnologies/tyk/vendor/github.com/TykTechnologies/redigocluster/rediscluster.ConcurrentMap.Iter.func1
/src/github.com/TykTechnologies/tyk/vendor/github.com/TykTechnologies/redigocluster/rediscluster/concurrent_map.go:171 +0x91
goroutine 67149172 [runnable]:
github.com/TykTechnologies/tyk/vendor/github.com/TykTechnologies/redigocluster/rediscluster.ConcurrentMap.Iter.func1.1(0xc4240152c0, 0xc422bb1610, 0xc4204611a0)
/src/github.com/TykTechnologies/tyk/vendor/github.com/TykTechnologies/redigocluster/rediscluster/concurrent_map.go:171
created by github.com/TykTechnologies/tyk/vendor/github.com/TykTechnologies/redigocluster/rediscluster.ConcurrentMap.Iter.func1