Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View invisiblefunnel's full-sized avatar

Danny Whalen invisiblefunnel

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package quickselect
func Quickselect(data []int, k, left, right int) {
var t, i, j int
for right > left {
t = data[k]
i = left
j = right
swap(data, left, k)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@invisiblefunnel
invisiblefunnel / main.go
Created December 19, 2020 21:06
paulmach/osm cgo branch
package main
import (
"fmt"
"io"
"log"
"os"
"github.com/cheggaaa/pb/v3"
"github.com/paulmach/osm/osmpbf" // cgo branch
package main
import (
"testing"
"testing/quick"
flatbuffers "github.com/google/flatbuffers/go"
)
// TestCreateSharedStringReset ...
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
commands:
# replaces `aws-cli/install`
aws_cli_install:
description: Install AWS CLI (from cache if possible)
steps:
- restore_cache:
key: awscliv2
paths:
- /tmp/aws
- run:
% make clean && time make
rm -f tile-join
go build -o tile-join main.go tile_writer.go chan_group.go model.go scanner.go util.go io_closer_cache.go neighborhood.go
./tile-join --pbf_path /Volumes/OSM\ Projects/planet-highways-200413.osm.pbf \
				--out_dir ~/Desktop/planet-highways-200413-tiles \
				--way_tags access --way_tags area --way_tags foot --way_tags highway --way_tags service \
				--zoom 10 \
				--overwrite \
 --progress
//
// Port of https://github.com/mapbox/concaveman/blob/6d149db46e9876b3afe2c14b4cee7d9e3997f1e1/index.js#L285-L352
//
// function sqSegSegDist(x0, y0, x1, y1, x2, y2, x3, y3) {
func sqSegSegDist(x0, y0, x1, y1, x2, y2, x3, y3 float64) float64 {
// var ux = x1 - x0;
ux := x1 - x0
// var uy = y1 - y0;
uy := y1 - y0
// var vx = x3 - x2;