https://docs.google.com/presentation/d/1HVp4jE8dCPsVS1LcVaBTqgUcSlKJvd8Djt8dhXgqG1E
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
https://docs.google.com/presentation/d/1iQFFMCuIPLYdUiEgeFsO8fKTQB6ArSM8GrxLKXxY-RQ/edit?usp=sharing |
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
https://docs.google.com/presentation/d/1Rl3k_bu7e3YZ-p8mGoQ-rqeJIUUlr6JfDSTCg3cWAog |
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
// Place this page as /benches/format.rs in a rust project created with `cargo new fmttest --lib` | |
// Add to Cargo.toml: | |
// | |
// [dev-dependencies] | |
// criterion = { version = "0.4", features = ["html_reports"] } | |
// | |
// [[bench]] | |
// name = "format" | |
// harness = false |
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
// Benchmarks for the Rust iterator extension discussion at | |
// https://internals.rust-lang.org/t/add-iterate-with-separators-iterator-function/18781/13 | |
// Place this page as /benches/iters.rs in a rust project created with `cargo new itertest --lib` | |
// Add to Cargo.toml: | |
// | |
// [dependencies] | |
// itertools = "0.10" | |
// |
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
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | |
use dup_indexer::DupIndexer; | |
fn benchmark_strings(c: &mut Criterion) { | |
let mut group = c.benchmark_group("Strings"); | |
group.bench_function("String", |b| { | |
b.iter(|| { | |
let mut di = DupIndexer::new(); | |
for _ in 0..100 { |
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
# | |
# This script converts margins, padding, and borders to logical values, | |
# allowing RTL and vertical languages to show correctly. | |
# Supports both *.css and *.scss files. | |
# | |
# Some renames are not yet implemented widely, and may require CSS plugin | |
# https://github.com/csstools/postcss-logical | |
# They have been commented out for now, but feel free to try them out. | |
# | |
# Full spec: https://drafts.csswg.org/css-logical/ |
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
SELECT x, | |
y, | |
ST_Y(p_mid) mid_lat, | |
ST_Y(p_min) min_lat, | |
ST_Y(p_max) max_lat, | |
ST_Y(d_mid) mid_lat_decoded, | |
ST_Y(d_min) min_lat_decoded, | |
ST_Y(d_max) max_lat_decoded, | |
abs(ST_Y(p_mid) - ST_Y(d_mid)) mid_lat_error, | |
abs(ST_Y(p_min) - ST_Y(d_min)) min_lat_error, |
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
create table map | |
( | |
tile_index INTEGER, | |
tmp_zoom INTEGER GENERATED ALWAYS AS ((tile_index & 0xFC000000) >> 26) VIRTUAL, | |
tile_column INTEGER GENERATED ALWAYS AS (CASE | |
WHEN tmp_zoom <= 13 THEN (tile_index & 0x3FFE000) >> 13 | |
ELSE (tile_index & 0x3FFF8000) >> 15 END) VIRTUAL, | |
tile_row INTEGER GENERATED ALWAYS AS (CASE | |
WHEN tmp_zoom <= 13 THEN tile_index & 0x1FFF | |
ELSE tile_index & 0x7FFF END) VIRTUAL, |
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
CREATE OR REPLACE FUNCTION getmvt(zoom integer, x integer, y integer) | |
RETURNS bytea AS $$ | |
SELECT STRING_AGG(mvtl, '') AS mvt FROM ( | |
SELECT IsEmpty, count(*) OVER () AS LayerCount, mvtl FROM ( | |
SELECT CASE zoom <= 8 WHEN TRUE THEN FALSE ELSE ST_WITHIN(ST_GeomFromText('POLYGON( | |
(0 4096,0 0,4096 0,4096 4096,0 4096))', 3857), ST_COLLECT(mvtgeometry)) END AS IsEmpty, ST_AsMVT(tile, 'water', 4096, 'mvtgeometry') as mvtl FROM (SELECT ST_AsMVTGeom(geometry, TileBBox(zoom, x, y), 4096, 4, true) AS mvtgeometry, class, intermittent FROM layer_water(TileBBox(zoom, x, y), zoom) WHERE ST_AsMVTGeom(geometry, TileBBox(zoom, x, y), 4096, 4, true) IS NOT NULL) AS tile HAVING COUNT(*) > 0 | |
UNION ALL | |
SELECT FALSE AS IsEmpty, ST_AsMVT(tile, 'waterway', 4096, 'mvtgeometry') as mvtl FROM (SELECT ST_AsMVTGeom(geometry, TileBBox(zoom, x, y), 4096, 4, true) AS mvtgeometry, name, name_en, name_de, NULLIF(tags->'name:ar', '') AS "name:ar", NULLIF(tags->'name:az', '') AS "name:az", NULLIF(tags->'name:be', '') AS "name:be", NULLIF(t |
NewerOlder