├── vendor ├── golang.org │ └── x │ │ └── sys │ │ ├── unix │ │ ├── .gitignore │ │ ├── ptrace_ios.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── ptrace_darwin.go │ │ ├── constants.go │ │ ├── endian_big.go │ │ ├── sysvshm_unix_other.go │ │ ├── asm_aix_ppc64.s │ │ ├── syscall_linux_gc_arm.go │ │ ├── endian_little.go │ │ ├── asm_solaris_amd64.s │ │ ├── readdirent_getdents.go │ │ ├── pagesize_unix.go │ │ ├── aliases.go │ │ ├── syscall_hurd.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo_linux_amd64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_hurd_386.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sysvshm_linux.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── race0.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix_gc.go │ │ ├── race.go │ │ ├── readdirent_getdirentries.go │ │ ├── zptrace_linux_arm64.go │ │ ├── asm_openbsd_mips64.s │ │ ├── bluetooth_linux.go │ │ ├── asm_bsd_arm.s │ │ ├── dev_darwin.go │ │ ├── env_unix.go │ │ ├── asm_bsd_386.s │ │ ├── dev_aix_ppc.go │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── asm_bsd_amd64.s │ │ ├── fcntl_darwin.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── dev_zos.go │ │ ├── fdset.go │ │ ├── dev_aix_ppc64.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_freebsd.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── dev_dragonfly.go │ │ ├── asm_linux_ppc64x.s │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_ppc64.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_riscv64.go │ │ ├── unveil_openbsd.go │ │ ├── syscall_openbsd_libc.go │ │ ├── asm_linux_riscv64.s │ │ ├── fcntl.go │ │ ├── asm_linux_arm64.s │ │ ├── syscall_darwin_libSystem.go │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_s390x.s │ │ ├── zptrace_armnn_linux.go │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_loong64.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_mips64x.s │ │ ├── sockcmsg_unix_other.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_aix_ppc.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── syscall_darwin_arm64.go │ │ ├── sysvshm_unix.go │ │ ├── gccgo_c.c │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── dev_linux.go │ │ ├── asm_linux_386.s │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_freebsd_riscv64.go │ │ └── syscall_freebsd_arm.go │ │ ├── PATENTS │ │ └── LICENSE ├── github.com │ ├── lib │ │ └── pq │ │ │ ├── .gitignore │ │ │ ├── conn_go115.go │ │ │ ├── oid │ │ │ └── doc.go │ │ │ ├── user_other.go │ │ │ ├── ssl_windows.go │ │ │ ├── uuid.go │ │ │ ├── user_posix.go │ │ │ ├── TESTS.md │ │ │ ├── krb.go │ │ │ ├── user_windows.go │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ └── url.go │ ├── jmhodges │ │ └── levigo │ │ │ ├── .gitignore │ │ │ ├── conv.go │ │ │ ├── comparator.go │ │ │ ├── version.go │ │ │ ├── env.go │ │ │ ├── LICENSE │ │ │ ├── cache.go │ │ │ └── filterpolicy.go │ ├── omniscale │ │ └── go-osm │ │ │ ├── parser │ │ │ ├── diff │ │ │ │ ├── doc.go │ │ │ │ └── 612.osc.gz │ │ │ └── pbf │ │ │ │ ├── monaco-20150428.osm.pbf │ │ │ │ ├── doc.go │ │ │ │ ├── internal │ │ │ │ └── osmpbf │ │ │ │ │ └── fileformat.proto │ │ │ │ └── barrier.go │ │ │ ├── replication │ │ │ ├── diff │ │ │ │ └── doc.go │ │ │ ├── doc.go │ │ │ └── replication.go │ │ │ ├── state │ │ │ ├── 964.state.txt │ │ │ └── doc.go │ │ │ ├── doc.go │ │ │ ├── diff.go │ │ │ └── changeset.go │ ├── pkg │ │ └── errors │ │ │ ├── .travis.yml │ │ │ ├── .gitignore │ │ │ ├── appveyor.yml │ │ │ ├── Makefile │ │ │ ├── LICENSE │ │ │ └── go113.go │ └── gogo │ │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── gogoproto │ │ ├── gogo.pb.golden │ │ └── Makefile │ │ ├── proto │ │ ├── encode_gogo.go │ │ ├── properties_gogo.go │ │ ├── custom_gogo.go │ │ ├── Makefile │ │ └── lib_gogo.go │ │ └── LICENSE ├── gopkg.in │ ├── fsnotify.v1 │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── open_mode_bsd.go │ │ ├── open_mode_darwin.go │ │ ├── .travis.yml │ │ ├── fen.go │ │ ├── LICENSE │ │ ├── fsnotify.go │ │ └── AUTHORS │ └── yaml.v2 │ │ ├── .travis.yml │ │ ├── NOTICE │ │ ├── writerc.go │ │ └── LICENSE.libyaml └── modules.txt ├── cache ├── query │ ├── query │ └── doc.go ├── binary │ ├── doc.go │ ├── nodes.go │ ├── messages.proto │ ├── tags.py │ ├── diff_test.go │ └── deltacoords_test.go ├── doc.go ├── ldb_pre_121.go └── ldb_post_121.go ├── test ├── doc.go ├── clipping.geojson ├── any_any.osm ├── Makefile ├── expire_tiles_mapping.yml ├── single_table.osc ├── single_table_mapping.json ├── any_any_mapping.json ├── route_relation_mapping.yml └── route_relation.osc ├── geom ├── doc.go ├── geos │ ├── doc.go │ ├── prepared.go │ ├── coords.go │ ├── serialize.go │ └── geos_test.go ├── geojson │ └── doc.go └── limit │ ├── doc.go │ ├── clipping.geojson │ └── hamburg_clip.geojson ├── database ├── doc.go └── postgis │ └── doc.go ├── proj ├── doc.go ├── proj_test.go └── proj.go ├── reader ├── doc.go └── reader_test.go ├── writer └── doc.go ├── update └── doc.go ├── config └── doc.go ├── log └── doc.go ├── stats ├── doc.go ├── http.go ├── memprof.go └── counter.go ├── element ├── doc.go ├── element_test.go └── element.go ├── .gitignore ├── version.go ├── AUTHORS ├── mapping ├── matcher_test.go ├── doc.go └── columns_categorize.go ├── go.mod ├── docs └── install.rst ├── expire └── expire.go ├── .github ├── ISSUE_TEMPLATE.md └── workflows │ └── ci.yml └── cmd └── imposm └── main.go /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /cache/query/query: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omniscale/imposm3/HEAD/cache/query/query -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.gitignore: -------------------------------------------------------------------------------- 1 | .db 2 | *.test 3 | *~ 4 | *.swp 5 | .idea 6 | .vscode -------------------------------------------------------------------------------- /test/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package test provides system tests for Imposm3. 3 | */ 4 | package test 5 | -------------------------------------------------------------------------------- /geom/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package geom provides functions for building geometries. 3 | */ 4 | package geom 5 | -------------------------------------------------------------------------------- /geom/geos/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package geos provides a wrapper to the GEOS library. 3 | */ 4 | package geos 5 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.6 4 | *.out 5 | _testmain.go 6 | _obj 7 | -------------------------------------------------------------------------------- /database/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package database defines interfaces to be implemented. 3 | */ 4 | package database 5 | -------------------------------------------------------------------------------- /proj/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package proj provides functions for coordinate transformations. 3 | */ 4 | package proj 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = 4 6 | -------------------------------------------------------------------------------- /geom/geojson/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package geojson creates GEOS geometries from GeoJSON files. 3 | */ 4 | package geojson 5 | -------------------------------------------------------------------------------- /reader/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package reader orchestrates the reading part of the import process. 3 | */ 4 | package reader 5 | -------------------------------------------------------------------------------- /writer/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package writer orchestrates the writing part of the import process. 3 | */ 4 | package writer 5 | -------------------------------------------------------------------------------- /cache/binary/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package binary provides functions for (un)marshaling cache data. 3 | */ 4 | package binary 5 | -------------------------------------------------------------------------------- /update/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package diff provides the diff sub command for updating with diff files. 3 | */ 4 | package update 5 | -------------------------------------------------------------------------------- /cache/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package cache implements caches for coords, nodes, ways and relations data. 3 | */ 4 | package cache 5 | -------------------------------------------------------------------------------- /database/postgis/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package postgis implements the database interfaces for PostGIS. 3 | */ 4 | package postgis 5 | -------------------------------------------------------------------------------- /geom/limit/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package limit provides functions to clip geometries at polygon boundaries. 3 | */ 4 | package limit 5 | -------------------------------------------------------------------------------- /cache/query/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package query provides the query-cache sub command for debugging and testing. 3 | */ 4 | package query 5 | -------------------------------------------------------------------------------- /config/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package config provides functions for parsing command line args and JSON config. 3 | */ 4 | package config 5 | -------------------------------------------------------------------------------- /log/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package log provides a simple framework for reporting messages and the import progress. 3 | */ 4 | package log 5 | -------------------------------------------------------------------------------- /stats/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package stats provides functions to collect statistics about the import process. 3 | */ 4 | package stats 5 | -------------------------------------------------------------------------------- /element/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package element provides basic types for OSM elements (coords/nodes/ways/relations/etc). 3 | */ 4 | package element 5 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/parser/diff/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package diff provides a parser for OSM diff files (.osc). 3 | */ 4 | package diff 5 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/replication/diff/doc.go: -------------------------------------------------------------------------------- 1 | // Package diff provides functions for downloading OSM diff files. 2 | package diff 3 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/state/964.state.txt: -------------------------------------------------------------------------------- 1 | #Mon May 04 00:06:14 UTC 2015 2 | sequenceNumber=964 3 | timestamp=2015-05-04T00\:00\:00Z 4 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package osm provides basic types for OSM elements (nodes/ways/relations/etc). 3 | */ 4 | package osm 5 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/replication/doc.go: -------------------------------------------------------------------------------- 1 | // Package replication provides basic types for replication of OSM data. 2 | package replication 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | imposm 3 | imposm3 4 | docs/_build 5 | mapping.json 6 | config.json 7 | test/build 8 | test/.lasttestrun* 9 | test/*.pyc 10 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/state/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package state provides functions for reading and writing diff status files. 3 | */ 4 | package state 5 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/parser/diff/612.osc.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omniscale/imposm3/HEAD/vendor/github.com/omniscale/go-osm/parser/diff/612.osc.gz -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/conn_go115.go: -------------------------------------------------------------------------------- 1 | //go:build go1.15 2 | // +build go1.15 3 | 4 | package pq 5 | 6 | import "database/sql/driver" 7 | 8 | var _ driver.Validator = &conn{} 9 | -------------------------------------------------------------------------------- /version.go: -------------------------------------------------------------------------------- 1 | package imposm3 2 | 3 | // Version gets replaced while building with 4 | // go build -ldflags "-X github.com/omniscale/imposm3.Version 1.2.3" 5 | var Version = "0.0.0-dev" 6 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/parser/pbf/monaco-20150428.osm.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omniscale/imposm3/HEAD/vendor/github.com/omniscale/go-osm/parser/pbf/monaco-20150428.osm.pbf -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - 1.13.x 7 | - tip 8 | 9 | script: 10 | - make check 11 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/parser/pbf/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package pbf provides an efficient parser for OpenStreetMap PBF files. 3 | 4 | Files are parsed in parallel and nodes, ways, relations passed back in blocks via channels. 5 | */ 6 | package pbf 7 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/.gitignore: -------------------------------------------------------------------------------- 1 | # Setup a Global .gitignore for OS and editor generated files: 2 | # https://help.github.com/articles/ignoring-files 3 | # git config --global core.excludesfile ~/.gitignore_global 4 | 5 | .vagrant 6 | *.sublime-project 7 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | ======= 3 | 4 | Imposm 3 is written and maintained by Omniscale 5 | 6 | 7 | Core development 8 | ---------------- 9 | 10 | Oliver Tonnhofer (oltonn) 11 | 12 | 13 | Patches by 14 | ---------- 15 | 16 | Yohan Boniface (yohanboniface) 17 | -------------------------------------------------------------------------------- /stats/http.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import ( 4 | "net/http" 5 | _ "net/http/pprof" 6 | 7 | "github.com/omniscale/imposm3/log" 8 | ) 9 | 10 | func StartHTTPPProf(bind string) { 11 | go func() { 12 | log.Println(http.ListenAndServe(bind, nil)) 13 | }() 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_other.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | //go:build js || android || hurd || zos 4 | // +build js android hurd zos 5 | 6 | package pq 7 | 8 | func userCurrent() (string, error) { 9 | return "", ErrCouldNotDetectUsername 10 | } 11 | -------------------------------------------------------------------------------- /cache/binary/nodes.go: -------------------------------------------------------------------------------- 1 | package binary 2 | 3 | func (nd *Node) wgsCoord() (lon float64, lat float64) { 4 | lon = IntToCoord(nd.GetLong()) 5 | lat = IntToCoord(nd.GetLat()) 6 | return 7 | } 8 | 9 | func (nd *Node) fromWgsCoord(lon float64, lat float64) { 10 | nd.Long = CoordToInt(lon) 11 | nd.Lat = CoordToInt(lat) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "1.14.x" 15 | - "tip" 16 | 17 | go_import_path: gopkg.in/yaml.v2 18 | -------------------------------------------------------------------------------- /cache/ldb_pre_121.go: -------------------------------------------------------------------------------- 1 | //go:build ldbpre121 2 | 3 | package cache 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include "leveldb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "github.com/jmhodges/levigo" 11 | ) 12 | 13 | func setMaxFileSize(o *levigo.Options, maxFileSize int) { 14 | // setMaxFileSize is only available with LevelDB 1.21 and higher. 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package pq 5 | 6 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 7 | // The key file should have very little access. 8 | // 9 | // libpq does not check key file permissions on Windows. 10 | func sslKeyPermissions(string) error { return nil } 11 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/conv.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #include "leveldb/c.h" 4 | import "C" 5 | 6 | func boolToUchar(b bool) C.uchar { 7 | uc := C.uchar(0) 8 | if b { 9 | uc = C.uchar(1) 10 | } 11 | return uc 12 | } 13 | 14 | func ucharToBool(uc C.uchar) bool { 15 | if uc == C.uchar(0) { 16 | return false 17 | } 18 | return true 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | // +build ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 11 | return ENOTSUP 12 | } 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/open_mode_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd openbsd netbsd dragonfly 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const openMode = unix.O_NONBLOCK | unix.O_RDONLY 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/open_mode_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | // note: this constant is not defined on BSD 12 | const openMode = unix.O_EVTONLY 13 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | // +build amd64,linux,gc 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 11 | return ptrace1(request, pid, addr, data) 12 | } 13 | -------------------------------------------------------------------------------- /cache/ldb_post_121.go: -------------------------------------------------------------------------------- 1 | //go:build !ldbpre121 2 | 3 | package cache 4 | 5 | // #cgo LDFLAGS: -lleveldb 6 | // #include "leveldb/c.h" 7 | import "C" 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "github.com/jmhodges/levigo" 13 | ) 14 | 15 | func setMaxFileSize(o *levigo.Options, maxFileSize int) { 16 | p := (*C.struct_leveldb_options_t)(unsafe.Pointer(o.Opt)) 17 | C.leveldb_options_set_max_file_size(p, C.size_t(maxFileSize)) 18 | } 19 | -------------------------------------------------------------------------------- /test/clipping.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 4 | 5 | "features": [ 6 | { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -179.0, -85.0 ], [ -179.0, 85.0 ], [ 179.0, 85.0 ], [ 179.0, -85.0 ], [ -179.0, -85.0 ] ] ] } } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/comparator.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include "leveldb/c.h" 5 | import "C" 6 | 7 | // DestroyComparator deallocates a *C.leveldb_comparator_t. 8 | // 9 | // This is provided as a convienience to advanced users that have implemented 10 | // their own comparators in C in their own code. 11 | func DestroyComparator(cmp *C.leveldb_comparator_t) { 12 | C.leveldb_comparator_destroy(cmp) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | const ( 11 | R_OK = 0x4 12 | W_OK = 0x2 13 | X_OK = 0x1 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 7 | 8 | package unix 9 | 10 | const isBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | // SysvShmCtl performs control operations on the shared memory segment 11 | // specified by id. 12 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 13 | return shmctl(id, cmd, desc) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 12 | // 13 | 14 | TEXT ·syscall6(SB),NOSPLIT,$0-88 15 | JMP syscall·syscall6(SB) 16 | 17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSyscall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | // +build arm,gc,linux 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/version.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | /* 4 | #cgo LDFLAGS: -lleveldb 5 | #include "leveldb/c.h" 6 | */ 7 | import "C" 8 | 9 | // GetLevelDBMajorVersion returns the underlying LevelDB implementation's major 10 | // version. 11 | func GetLevelDBMajorVersion() int { 12 | return int(C.leveldb_major_version()) 13 | } 14 | 15 | // GetLevelDBMinorVersion returns the underlying LevelDB implementation's minor 16 | // version. 17 | func GetLevelDBMinorVersion() int { 18 | return int(C.leveldb_minor_version()) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | // +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh 7 | 8 | package unix 9 | 10 | const isBigEndian = false 11 | -------------------------------------------------------------------------------- /mapping/matcher_test.go: -------------------------------------------------------------------------------- 1 | package mapping 2 | 3 | import ( 4 | "testing" 5 | 6 | osm "github.com/omniscale/go-osm" 7 | ) 8 | 9 | func BenchmarkTagMatch(b *testing.B) { 10 | m, err := FromFile("test_mapping.yml") 11 | if err != nil { 12 | b.Fatal(err) 13 | } 14 | matcher := m.PolygonMatcher 15 | for i := 0; i < b.N; i++ { 16 | e := osm.Relation{} 17 | e.Tags = osm.Tags{"landuse": "forest", "name": "Forest", "source": "bling", "tourism": "zoo"} 18 | if m := matcher.MatchRelation(&e); len(m) != 1 { 19 | b.Fatal(m) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 12 | // 13 | 14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 15 | JMP syscall·sysvicall6(SB) 16 | 17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSysvicall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build aix dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | // ReadDirent reads directory entries from fd and writes them into buf. 11 | func ReadDirent(fd int, buf []byte) (n int, err error) { 12 | return Getdents(fd, buf) 13 | } 14 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/omniscale/imposm3 2 | 3 | go 1.21.0 4 | 5 | require ( 6 | github.com/gogo/protobuf v1.3.2 7 | github.com/jmhodges/levigo v1.0.1-0.20191214093932-ed89ec741d96 8 | github.com/lib/pq v1.10.9 9 | github.com/omniscale/go-osm v0.3.1 10 | github.com/pkg/errors v0.9.1 11 | gopkg.in/yaml.v2 v2.4.0 12 | ) 13 | 14 | require ( 15 | github.com/kr/pretty v0.3.1 // indirect 16 | golang.org/x/sys v0.4.0 // indirect 17 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect 18 | gopkg.in/fsnotify.v1 v1.4.7 // indirect 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | // For Unix, get the pagesize from the runtime. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getpagesize() int { 15 | return syscall.Getpagesize() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | go: 5 | - 1.8.x 6 | - 1.9.x 7 | - tip 8 | 9 | matrix: 10 | allow_failures: 11 | - go: tip 12 | fast_finish: true 13 | 14 | before_script: 15 | - go get -u github.com/golang/lint/golint 16 | 17 | script: 18 | - go test -v --race ./... 19 | 20 | after_script: 21 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 22 | - test -z "$(golint ./... | tee /dev/stderr)" 23 | - go vet ./... 24 | 25 | os: 26 | - linux 27 | - osx 28 | 29 | notifications: 30 | email: false 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | // +build go1.9 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | type Signal = syscall.Signal 14 | type Errno = syscall.Errno 15 | type SysProcAttr = syscall.SysProcAttr 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | // +build hurd 7 | 8 | package unix 9 | 10 | /* 11 | #include 12 | int ioctl(int, unsigned long int, uintptr_t); 13 | */ 14 | import "C" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc 7 | 8 | package unix 9 | 10 | func init() { 11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 13 | fcntl64Syscall = SYS_FCNTL64 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | // +build gccgo,linux,amd64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //extern gettimeofday 13 | func realGettimeofday(*Timeval, *byte) int32 14 | 15 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 16 | r := realGettimeofday(tv, nil) 17 | if r < 0 { 18 | return syscall.GetErrno() 19 | } 20 | return 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | // +build linux,gc 7 | 8 | package unix 9 | 10 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 11 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 12 | 13 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 14 | // fail. 15 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 16 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/diff.go: -------------------------------------------------------------------------------- 1 | package osm 2 | 3 | // A Diff contains a change operation on a single OSM element. 4 | type Diff struct { 5 | // Create specifies whether the element was created. 6 | Create bool 7 | // Modify specifies whether the element was modified. 8 | Modify bool 9 | // Delete specifies whether the element was deleted. 10 | Delete bool 11 | // Node points to the actual node, if a node was changed. 12 | Node *Node 13 | // Way points to the actual way, if a way was changed. 14 | Way *Way 15 | // Rel points to the actual relation, if a relation was changed. 16 | Rel *Relation 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | // +build linux 7 | // +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64 8 | 9 | package unix 10 | 11 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 12 | // values. 13 | 14 | //sys Alarm(seconds uint) (remaining uint, err error) 15 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/changeset.go: -------------------------------------------------------------------------------- 1 | package osm 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // A Changeset contains metadata about a single OSM changeset. 8 | type Changeset struct { 9 | ID int64 10 | CreatedAt time.Time 11 | ClosedAt time.Time 12 | Open bool 13 | UserID int32 14 | UserName string 15 | NumChanges int32 16 | MaxExtent [4]float64 17 | Comments []Comment 18 | Tags Tags 19 | } 20 | 21 | // A Comment contains a single comment made to a Changeset. 22 | type Comment struct { 23 | UserID int32 24 | UserName string 25 | CreatedAt time.Time 26 | Text string 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | // +build 386,hurd 7 | 8 | package unix 9 | 10 | const ( 11 | TIOCGETA = 0x62251713 12 | ) 13 | 14 | type Winsize struct { 15 | Row uint16 16 | Col uint16 17 | Xpixel uint16 18 | Ypixel uint16 19 | } 20 | 21 | type Termios struct { 22 | Iflag uint32 23 | Oflag uint32 24 | Cflag uint32 25 | Lflag uint32 26 | Cc [20]uint8 27 | Ispeed int32 28 | Ospeed int32 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of GoGo authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file, which 3 | # lists people. For example, employees are listed in CONTRIBUTORS, 4 | # but not in AUTHORS, because the employer holds the copyright. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Individual's name 9 | # Individual's name 10 | 11 | # Please keep the list sorted. 12 | 13 | Sendgrid, Inc 14 | Vastech SA (PTY) LTD 15 | Walter Schulze 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /stats/memprof.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | "runtime/pprof" 8 | "time" 9 | 10 | "github.com/omniscale/imposm3/log" 11 | ) 12 | 13 | func MemProfiler(dir string, interval time.Duration) { 14 | if err := os.MkdirAll(dir, 0750); err != nil { 15 | panic(err) 16 | } 17 | 18 | ticker := time.NewTicker(interval) 19 | i := 0 20 | for range ticker.C { 21 | filename := path.Join( 22 | dir, 23 | fmt.Sprintf("memprof-%03d.pprof", i), 24 | ) 25 | f, err := os.Create(filename) 26 | if err != nil { 27 | log.Fatal(err) 28 | } 29 | pprof.WriteHeapProfile(f) 30 | f.Close() 31 | i++ 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | // +build linux 7 | 8 | package unix 9 | 10 | import "runtime" 11 | 12 | // SysvShmCtl performs control operations on the shared memory segment 13 | // specified by id. 14 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 15 | if runtime.GOARCH == "arm" || 16 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 17 | cmd |= ipc_64 18 | } 19 | 20 | return shmctl(id, cmd, desc) 21 | } 22 | -------------------------------------------------------------------------------- /docs/install.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | Binary 5 | ------ 6 | 7 | `Binary releases are available at GitHub. `_ 8 | 9 | These builds are for x86 64bit Linux and require *no* further dependencies. Download, untar and start ``imposm``. 10 | Binaries are compatible with Debian 8, Ubuntu 14.04 and SLES 12 (and newer versions). Older Imposm binaries (<=0.4) also support Debian 6, RHEL 6 and SLES 11. 11 | Older versions are available at ``_. 12 | 13 | Source 14 | ------ 15 | 16 | Please see `the README for build instructions `_. 17 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/uuid.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "encoding/hex" 5 | "fmt" 6 | ) 7 | 8 | // decodeUUIDBinary interprets the binary format of a uuid, returning it in text format. 9 | func decodeUUIDBinary(src []byte) ([]byte, error) { 10 | if len(src) != 16 { 11 | return nil, fmt.Errorf("pq: unable to decode uuid; bad length: %d", len(src)) 12 | } 13 | 14 | dst := make([]byte, 36) 15 | dst[8], dst[13], dst[18], dst[23] = '-', '-', '-', '-' 16 | hex.Encode(dst[0:], src[0:4]) 17 | hex.Encode(dst[9:], src[4:6]) 18 | hex.Encode(dst[14:], src[6:8]) 19 | hex.Encode(dst[19:], src[8:10]) 20 | hex.Encode(dst[24:], src[10:16]) 21 | 22 | return dst, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | //go:build aix || darwin || dragonfly || freebsd || (linux && !android) || nacl || netbsd || openbsd || plan9 || solaris || rumprun || illumos 4 | // +build aix darwin dragonfly freebsd linux,!android nacl netbsd openbsd plan9 solaris rumprun illumos 5 | 6 | package pq 7 | 8 | import ( 9 | "os" 10 | "os/user" 11 | ) 12 | 13 | func userCurrent() (string, error) { 14 | u, err := user.Current() 15 | if err == nil { 16 | return u.Username, nil 17 | } 18 | 19 | name := os.Getenv("USER") 20 | if name != "" { 21 | return name, nil 22 | } 23 | 24 | return "", ErrCouldNotDetectUsername 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | // +build linux,gc,386 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | 16 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 18 | -------------------------------------------------------------------------------- /proj/proj_test.go: -------------------------------------------------------------------------------- 1 | package proj 2 | 3 | import ( 4 | "math" 5 | "testing" 6 | ) 7 | 8 | func TestWgsToMerc(t *testing.T) { 9 | x, y := WgsToMerc(0, 0) 10 | if x != 0 || math.Abs(y) > 1e-8 { 11 | t.Fatalf("%v %v", x, y) 12 | } 13 | 14 | x, y = WgsToMerc(8, 53) 15 | if math.Abs(x-890555.9263461898) > 1e-6 || math.Abs(y-6982997.920389788) > 1e-6 { 16 | t.Fatalf("%v %v", x, y) 17 | } 18 | } 19 | 20 | func TestMercToWgs(t *testing.T) { 21 | long, lat := MercToWgs(0, 0) 22 | if long != 0 || lat != 0 { 23 | t.Fatalf("%v %v", long, lat) 24 | } 25 | long, lat = MercToWgs(890555.9263461898, 6982997.920389788) 26 | if math.Abs(long-8) > 1e-6 || math.Abs(lat-53) > 1e-6 { 27 | t.Fatalf("%v %v", long, lat) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/any_any.osm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | // +build linux,gccgo,arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all test clean files 2 | 3 | ifdef VERBOSE 4 | TESTOPTS = -v 5 | else 6 | TESTOPTS = 7 | endif 8 | 9 | all: test 10 | 11 | clean: 12 | rm -rf build 13 | 14 | PBF_FILES=$(addprefix build/,$(patsubst %.osm,%.pbf,$(wildcard *.osm))) 15 | OSCGZ_FILES=$(addprefix build/,$(patsubst %.osc,%.osc.gz,$(wildcard *.osc))) 16 | 17 | build/%.pbf: %.osm 18 | @mkdir -p build 19 | osmosis --read-xml $< --sort type="TypeThenId" --write-pbf $@ omitmetadata=true 20 | 21 | build/%.osc.gz: %.osc 22 | @mkdir -p build 23 | gzip --stdout $< > $@ 24 | 25 | files: $(PBF_FILES) $(OSCGZ_FILES) 26 | 27 | test: files 28 | (cd .. && go test ./test $(TESTOPTS)) 29 | 30 | route_relation: files 31 | (cd .. && go test -test.run TestRouteRelation_ ./test $(TESTOPTS)) 32 | -------------------------------------------------------------------------------- /mapping/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package mapping provides implements mapping and convertion between OSM elements and database tables, rows and columns. 3 | 4 | The core logic of Imposm is accesible with the Mapping struct. 5 | A Mapping creates filters and matchers based on mapping configuration (.yaml or .json file). 6 | 7 | Filters are for initial filtering (during -read). They remove all tags that are not needed. 8 | 9 | Matchers map OSM elements to zero or more destination tables. Each Match results can convert an OSM element 10 | to a row with all mapped column values. 11 | The matching is dependend on the element type (node, way, relation), the element tags and the destination 12 | table type (point, linestring, polygon, relation, relation_member). 13 | */ 14 | package mapping 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | // +build amd64,solaris 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func (iov *Iovec) SetLen(length int) { 19 | iov.Len = uint64(length) 20 | } 21 | 22 | func (msghdr *Msghdr) SetIovlen(length int) { 23 | msghdr.Iovlen = int32(length) 24 | } 25 | 26 | func (cmsg *Cmsghdr) SetLen(length int) { 27 | cmsg.Len = uint32(length) 28 | } 29 | -------------------------------------------------------------------------------- /cache/binary/messages.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package binary; 4 | 5 | message Node { 6 | required uint32 long = 1; 7 | required uint32 lat= 2; 8 | repeated string tags = 3; 9 | } 10 | 11 | message Way { 12 | repeated string tags = 1; 13 | repeated int64 refs = 2 [packed = true]; 14 | } 15 | 16 | message Relation { 17 | repeated string tags = 1; 18 | repeated int64 member_ids = 2; 19 | enum MemberType { 20 | NODE = 0; 21 | WAY = 1; 22 | RELATION = 2; 23 | } 24 | repeated MemberType member_types = 3; 25 | repeated string member_roles = 4; 26 | } 27 | 28 | message DeltaCoords { 29 | repeated sint64 ids = 1 [packed = true]; 30 | repeated sint64 lats = 2 [packed = true]; 31 | repeated sint64 lons = 3 [packed = true]; 32 | } 33 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /proj/proj.go: -------------------------------------------------------------------------------- 1 | package proj 2 | 3 | import ( 4 | "math" 5 | 6 | osm "github.com/omniscale/go-osm" 7 | ) 8 | 9 | const pole = 6378137 * math.Pi // 20037508.342789244 10 | 11 | func WgsToMerc(long, lat float64) (x, y float64) { 12 | x = long * pole / 180.0 13 | y = math.Log(math.Tan((90.0+lat)*math.Pi/360.0)) / math.Pi * pole 14 | return x, y 15 | } 16 | 17 | func MercToWgs(x, y float64) (long, lat float64) { 18 | long = 180.0 * x / pole 19 | lat = 180.0 / math.Pi * (2*math.Atan(math.Exp((y/pole)*math.Pi)) - math.Pi/2) 20 | return long, lat 21 | } 22 | 23 | func NodesToMerc(nodes []osm.Node) { 24 | for i, nd := range nodes { 25 | nodes[i].Long, nodes[i].Lat = WgsToMerc(nd.Long, nd.Lat) 26 | } 27 | } 28 | 29 | func NodeToMerc(node *osm.Node) { 30 | node.Long, node.Lat = WgsToMerc(node.Long, node.Lat) 31 | } 32 | -------------------------------------------------------------------------------- /reader/reader_test.go: -------------------------------------------------------------------------------- 1 | package reader 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestReaderCpus(t *testing.T) { 8 | p, r, w, n, c := readersForCpus(1) 9 | if p != 1 && r != 1 && w != 1 && n != 1 && c != 1 { 10 | t.Fatal(p, r, w, n, c) 11 | } 12 | 13 | p, r, w, n, c = readersForCpus(2) 14 | if p != 2 && r != 1 && w != 1 && n != 1 && c != 1 { 15 | t.Fatal(p, r, w, n, c) 16 | } 17 | 18 | p, r, w, n, c = readersForCpus(4) 19 | if p != 3 && r != 1 && w != 1 && n != 1 && c != 1 { 20 | t.Fatal(p, r, w, n, c) 21 | } 22 | 23 | p, r, w, n, c = readersForCpus(8) 24 | if p != 6 && r != 2 && w != 2 && n != 2 && c != 2 { 25 | t.Fatal(p, r, w, n, c) 26 | } 27 | 28 | p, r, w, n, c = readersForCpus(12) 29 | if p != 8 && r != 3 && w != 3 && n != 3 && c != 3 { 30 | t.Fatal(p, r, w, n, c) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/TESTS.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | ## Running Tests 4 | 5 | `go test` is used for testing. A running PostgreSQL 6 | server is required, with the ability to log in. The 7 | database to connect to test with is "pqgotest," on 8 | "localhost" but these can be overridden using [environment 9 | variables](https://www.postgresql.org/docs/9.3/static/libpq-envars.html). 10 | 11 | Example: 12 | 13 | PGHOST=/run/postgresql go test 14 | 15 | ## Benchmarks 16 | 17 | A benchmark suite can be run as part of the tests: 18 | 19 | go test -bench . 20 | 21 | ## Example setup (Docker) 22 | 23 | Run a postgres container: 24 | 25 | ``` 26 | docker run --expose 5432:5432 postgres 27 | ``` 28 | 29 | Run tests: 30 | 31 | ``` 32 | PGHOST=localhost PGPORT=5432 PGUSER=postgres PGSSLMODE=disable PGDATABASE=postgres go test 33 | ``` 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | // +build darwin dragonfly freebsd linux,!ppc64,!ppc64le netbsd openbsd solaris 7 | // +build gc 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | // +build darwin,race linux,race freebsd,race 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 6 | // +build darwin 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // ReadDirent reads directory entries from fd and writes them into buf. 13 | func ReadDirent(fd int, buf []byte) (n int, err error) { 14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 16 | // actual system call is getdirentries64, 64 is a good guess. 17 | // TODO(rsc): Can we use a single global basep for all calls? 18 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 19 | return Getdirentries(fd, buf, base) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for mips64, OpenBSD 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | JMP syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | JMP syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | JMP syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | // Unix environment variables. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | func Unsetenv(key string) error { 31 | return syscall.Unsetenv(key) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for 386 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for RISCV64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System call support for ppc64, BSD 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for AMD64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/env.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include "leveldb/c.h" 5 | import "C" 6 | 7 | // Env is a system call environment used by a database. 8 | // 9 | // Typically, NewDefaultEnv is all you need. Advanced users may create their 10 | // own Env with a *C.leveldb_env_t of their own creation. 11 | // 12 | // To prevent memory leaks, an Env must have Close called on it when it is 13 | // no longer needed by the program. 14 | type Env struct { 15 | Env *C.leveldb_env_t 16 | } 17 | 18 | // NewDefaultEnv creates a default environment for use in an Options. 19 | // 20 | // To prevent memory leaks, the Env returned should be deallocated with 21 | // Close. 22 | func NewDefaultEnv() *Env { 23 | return &Env{C.leveldb_create_default_env()} 24 | } 25 | 26 | // Close deallocates the Env, freeing the underlying struct. 27 | func (env *Env) Close() { 28 | C.leveldb_env_destroy(env.Env) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/krb.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | // NewGSSFunc creates a GSS authentication provider, for use with 4 | // RegisterGSSProvider. 5 | type NewGSSFunc func() (GSS, error) 6 | 7 | var newGss NewGSSFunc 8 | 9 | // RegisterGSSProvider registers a GSS authentication provider. For example, if 10 | // you need to use Kerberos to authenticate with your server, add this to your 11 | // main package: 12 | // 13 | // import "github.com/lib/pq/auth/kerberos" 14 | // 15 | // func init() { 16 | // pq.RegisterGSSProvider(func() (pq.GSS, error) { return kerberos.NewGSS() }) 17 | // } 18 | func RegisterGSSProvider(newGssArg NewGSSFunc) { 19 | newGss = newGssArg 20 | } 21 | 22 | // GSS provides GSSAPI authentication (e.g., Kerberos). 23 | type GSS interface { 24 | GetInitToken(host string, service string) ([]byte, error) 25 | GetInitTokenFromSpn(spn string) ([]byte, error) 26 | Continue(inToken []byte) (done bool, outToken []byte, err error) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Anton Povarov 2 | Brian Goff 3 | Clayton Coleman 4 | Denis Smirnov 5 | DongYun Kang 6 | Dwayne Schultz 7 | Georg Apitz 8 | Gustav Paul 9 | Johan Brandhorst 10 | John Shahid 11 | John Tuley 12 | Laurent 13 | Patrick Lee 14 | Peter Edge 15 | Roger Johansson 16 | Sam Nguyen 17 | Sergio Arbeo 18 | Stephen J Day 19 | Tamir Duberstein 20 | Todd Eisenberger 21 | Tormod Erevik Lea 22 | Vyacheslav Kim 23 | Walter Schulze 24 | -------------------------------------------------------------------------------- /test/expire_tiles_mapping.yml: -------------------------------------------------------------------------------- 1 | tables: 2 | roads: 3 | type: linestring 4 | columns: 5 | - name: osm_id 6 | type: id 7 | - name: type 8 | type: mapping_value 9 | - name: name 10 | type: string 11 | key: name 12 | - name: geometry 13 | type: geometry 14 | mapping: 15 | highway: [__any__] 16 | 17 | pois: 18 | type: point 19 | columns: 20 | - name: osm_id 21 | type: id 22 | - name: type 23 | type: mapping_value 24 | - name: name 25 | type: string 26 | key: name 27 | - name: geometry 28 | type: geometry 29 | mapping: 30 | amenity: [__any__] 31 | 32 | buildings: 33 | type: polygon 34 | columns: 35 | - name: osm_id 36 | type: id 37 | - name: type 38 | type: mapping_value 39 | - name: name 40 | type: string 41 | key: name 42 | - name: geometry 43 | type: geometry 44 | mapping: 45 | building: [__any__] 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | // +build linux 7 | // +build ppc64le ppc64 8 | // +build gc 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall(trap, a1, a2, a3) 16 | } 17 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 19 | } 20 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall(trap, a1, a2, a3) 22 | } 23 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 24 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | // +build zos,s390x 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by z/OS. 10 | // 11 | // The information below is extracted and adapted from macros. 12 | 13 | package unix 14 | 15 | // Major returns the major component of a z/OS device number. 16 | func Major(dev uint64) uint32 { 17 | return uint32((dev >> 16) & 0x0000FFFF) 18 | } 19 | 20 | // Minor returns the minor component of a z/OS device number. 21 | func Minor(dev uint64) uint32 { 22 | return uint32(dev & 0x0000FFFF) 23 | } 24 | 25 | // Mkdev returns a z/OS device number generated from the given major and minor 26 | // components. 27 | func Mkdev(major, minor uint32) uint64 { 28 | return (uint64(major) << 16) | uint64(minor) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | // Set adds fd to the set fds. 11 | func (fds *FdSet) Set(fd int) { 12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 13 | } 14 | 15 | // Clear removes fd from the set fds. 16 | func (fds *FdSet) Clear(fd int) { 17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 18 | } 19 | 20 | // IsSet returns whether fd is in the set fds. 21 | func (fds *FdSet) IsSet(fd int) bool { 22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 23 | } 24 | 25 | // Zero clears the set fds. 26 | func (fds *FdSet) Zero() { 27 | for i := range fds.Bits { 28 | fds.Bits[i] = 0 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_windows.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | package pq 3 | 4 | import ( 5 | "path/filepath" 6 | "syscall" 7 | ) 8 | 9 | // Perform Windows user name lookup identically to libpq. 10 | // 11 | // The PostgreSQL code makes use of the legacy Win32 function 12 | // GetUserName, and that function has not been imported into stock Go. 13 | // GetUserNameEx is available though, the difference being that a 14 | // wider range of names are available. To get the output to be the 15 | // same as GetUserName, only the base (or last) component of the 16 | // result is returned. 17 | func userCurrent() (string, error) { 18 | pw_name := make([]uint16, 128) 19 | pwname_size := uint32(len(pw_name)) - 1 20 | err := syscall.GetUserNameEx(syscall.NameSamCompatible, &pw_name[0], &pwname_size) 21 | if err != nil { 22 | return "", ErrCouldNotDetectUsername 23 | } 24 | s := syscall.UTF16ToString(pw_name) 25 | u := filepath.Base(s) 26 | return u, nil 27 | } 28 | -------------------------------------------------------------------------------- /expire/expire.go: -------------------------------------------------------------------------------- 1 | package expire 2 | 3 | import ( 4 | osm "github.com/omniscale/go-osm" 5 | "github.com/omniscale/imposm3/proj" 6 | ) 7 | 8 | type Expireor interface { 9 | Expire(long, lat float64) 10 | ExpireNodes(nodes []osm.Node, closed bool) 11 | } 12 | 13 | func ExpireProjectedNodes(expireor Expireor, nodes []osm.Node, srid int, closed bool) { 14 | if srid == 4326 { 15 | expireor.ExpireNodes(nodes, closed) 16 | } else if srid == 3857 { 17 | nds := make([]osm.Node, len(nodes)) 18 | for i, nd := range nodes { 19 | nds[i].Long, nds[i].Lat = proj.MercToWgs(nd.Long, nd.Lat) 20 | } 21 | expireor.ExpireNodes(nds, closed) 22 | } else { 23 | panic("unsupported srid") 24 | } 25 | } 26 | 27 | func ExpireProjectedNode(expireor Expireor, node osm.Node, srid int) { 28 | if srid == 4326 { 29 | expireor.Expire(node.Long, node.Lat) 30 | } else if srid == 3857 { 31 | long, lat := proj.MercToWgs(node.Long, node.Lat) 32 | expireor.Expire(long, lat) 33 | } else { 34 | panic("unsupported srid") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | // +build aix,ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | // +build 386,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | // +build amd64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | // +build arm,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | // +build arm64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /test/single_table.osc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Jeffrey M Hodges 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/parser/pbf/internal/osmpbf/fileformat.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package osmpbf; 4 | 5 | // 6 | // STORAGE LAYER: Storing primitives. 7 | // 8 | 9 | message Blob { 10 | optional bytes raw = 1; // No compression 11 | optional int32 raw_size = 2; // When compressed, the uncompressed size 12 | 13 | // Possible compressed versions of the data. 14 | optional bytes zlib_data = 3; 15 | 16 | // PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED. 17 | optional bytes lzma_data = 4; 18 | 19 | // Formerly used for bzip2 compressed data. Depreciated in 2010. 20 | optional bytes OBSOLETE_bzip2_data = 5 [deprecated=true]; // Don't reuse this tag number. 21 | } 22 | 23 | /* A file contains an sequence of fileblock headers, each prefixed by 24 | their length in network byte order, followed by a data block 25 | containing the actual data. types staring with a "_" are reserved. 26 | */ 27 | 28 | message BlobHeader { 29 | required string type = 1; 30 | optional bytes indexdata = 2; 31 | required int32 datasize = 3; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/Makefile: -------------------------------------------------------------------------------- 1 | PKGS := github.com/pkg/errors 2 | SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) 3 | GO := go 4 | 5 | check: test vet gofmt misspell unconvert staticcheck ineffassign unparam 6 | 7 | test: 8 | $(GO) test $(PKGS) 9 | 10 | vet: | test 11 | $(GO) vet $(PKGS) 12 | 13 | staticcheck: 14 | $(GO) get honnef.co/go/tools/cmd/staticcheck 15 | staticcheck -checks all $(PKGS) 16 | 17 | misspell: 18 | $(GO) get github.com/client9/misspell/cmd/misspell 19 | misspell \ 20 | -locale GB \ 21 | -error \ 22 | *.md *.go 23 | 24 | unconvert: 25 | $(GO) get github.com/mdempsky/unconvert 26 | unconvert -v $(PKGS) 27 | 28 | ineffassign: 29 | $(GO) get github.com/gordonklaus/ineffassign 30 | find $(SRCDIRS) -name '*.go' | xargs ineffassign 31 | 32 | pedantic: check errcheck 33 | 34 | unparam: 35 | $(GO) get mvdan.cc/unparam 36 | unparam ./... 37 | 38 | errcheck: 39 | $(GO) get github.com/kisielk/errcheck 40 | errcheck $(PKGS) 41 | 42 | gofmt: 43 | @echo Checking code is gofmted 44 | @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" 45 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/fen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build solaris 6 | 7 | package fsnotify 8 | 9 | import ( 10 | "errors" 11 | ) 12 | 13 | // Watcher watches a set of files, delivering events to a channel. 14 | type Watcher struct { 15 | Events chan Event 16 | Errors chan error 17 | } 18 | 19 | // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. 20 | func NewWatcher() (*Watcher, error) { 21 | return nil, errors.New("FEN based watcher not yet supported for fsnotify\n") 22 | } 23 | 24 | // Close removes all watches and closes the events channel. 25 | func (w *Watcher) Close() error { 26 | return nil 27 | } 28 | 29 | // Add starts watching the named file or directory (non-recursively). 30 | func (w *Watcher) Add(name string) error { 31 | return nil 32 | } 33 | 34 | // Remove stops watching the the named file or directory (non-recursively). 35 | func (w *Watcher) Remove(name string) error { 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/parser/pbf/barrier.go: -------------------------------------------------------------------------------- 1 | package pbf 2 | 3 | import ( 4 | "sync" 5 | "sync/atomic" 6 | ) 7 | 8 | // barrier is a struct to synchronize multiple goroutines. 9 | // Works similar to a WaitGroup. Except: 10 | // Calls callback function once all goroutines called doneWait(). 11 | // doneWait() blocks until the callback returns. doneWait() does not 12 | // block after all goroutines were blocked once. 13 | type barrier struct { 14 | synced int32 15 | wg sync.WaitGroup 16 | once sync.Once 17 | callbackWg sync.WaitGroup 18 | callback func() 19 | } 20 | 21 | func newBarrier(callback func()) *barrier { 22 | s := &barrier{callback: callback} 23 | s.callbackWg.Add(1) 24 | return s 25 | } 26 | 27 | func (s *barrier) add(delta int) { 28 | s.wg.Add(delta) 29 | } 30 | 31 | func (s *barrier) doneWait() { 32 | if atomic.LoadInt32(&s.synced) == 1 { 33 | return 34 | } 35 | s.wg.Done() 36 | s.wg.Wait() 37 | s.once.Do(s.call) 38 | s.callbackWg.Wait() 39 | } 40 | 41 | func (s *barrier) call() { 42 | s.callback() 43 | atomic.StoreInt32(&s.synced, 1) 44 | s.callbackWg.Done() 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | // +build linux,gccgo,386 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | 23 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 24 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 25 | return int(fd), err 26 | } 27 | 28 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 29 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 30 | return int(fd), err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | // +build linux 7 | // +build ppc64 ppc64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for ppc64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | BL runtime·entersyscall(SB) 21 | MOVD a1+8(FP), R3 22 | MOVD a2+16(FP), R4 23 | MOVD a3+24(FP), R5 24 | MOVD R0, R6 25 | MOVD R0, R7 26 | MOVD R0, R8 27 | MOVD trap+0(FP), R9 // syscall entry 28 | SYSCALL R9 29 | MOVD R3, r1+32(FP) 30 | MOVD R4, r2+40(FP) 31 | BL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 35 | MOVD a1+8(FP), R3 36 | MOVD a2+16(FP), R4 37 | MOVD a3+24(FP), R5 38 | MOVD R0, R6 39 | MOVD R0, R7 40 | MOVD R0, R8 41 | MOVD trap+0(FP), R9 // syscall entry 42 | SYSCALL R9 43 | MOVD R3, r1+32(FP) 44 | MOVD R4, r2+40(FP) 45 | RET 46 | -------------------------------------------------------------------------------- /geom/geos/prepared.go: -------------------------------------------------------------------------------- 1 | package geos 2 | 3 | /* 4 | #cgo LDFLAGS: -lgeos_c 5 | #include "geos_c.h" 6 | #include 7 | */ 8 | import "C" 9 | import "github.com/omniscale/imposm3/log" 10 | 11 | type PreparedGeom struct { 12 | v *C.GEOSPreparedGeometry 13 | } 14 | 15 | func (g *Geos) Prepare(geom *Geom) *PreparedGeom { 16 | prep := C.GEOSPrepare_r(g.v, geom.v) 17 | if prep == nil { 18 | return nil 19 | } 20 | return &PreparedGeom{prep} 21 | } 22 | 23 | func (g *Geos) PreparedContains(a *PreparedGeom, b *Geom) bool { 24 | result := C.GEOSPreparedContains_r(g.v, a.v, b.v) 25 | if result == 1 { 26 | return true 27 | } 28 | // result == 2 -> exception (already logged to console) 29 | return false 30 | } 31 | 32 | func (g *Geos) PreparedIntersects(a *PreparedGeom, b *Geom) bool { 33 | result := C.GEOSPreparedIntersects_r(g.v, a.v, b.v) 34 | if result == 1 { 35 | return true 36 | } 37 | // result == 2 -> exception (already logged to console) 38 | return false 39 | } 40 | 41 | func (g *Geos) PreparedDestroy(geom *PreparedGeom) { 42 | if geom.v != nil { 43 | C.GEOSPreparedGeom_destroy_r(g.v, geom.v) 44 | geom.v = nil 45 | } else { 46 | log.Printf("double free?") 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | // +build amd64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | // +build arm64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ppc64 && openbsd 6 | // +build ppc64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && openbsd 6 | // +build 386,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && openbsd 6 | // +build arm,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && openbsd 6 | // +build riscv64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/cache.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include 5 | // #include "leveldb/c.h" 6 | import "C" 7 | 8 | // Cache is a cache used to store data read from data in memory. 9 | // 10 | // Typically, NewLRUCache is all you will need, but advanced users may 11 | // implement their own *C.leveldb_cache_t and create a Cache. 12 | // 13 | // To prevent memory leaks, a Cache must have Close called on it when it is 14 | // no longer needed by the program. Note: if the process is shutting down, 15 | // this may not be necessary and could be avoided to shorten shutdown time. 16 | type Cache struct { 17 | Cache *C.leveldb_cache_t 18 | } 19 | 20 | // NewLRUCache creates a new Cache object with the capacity given. 21 | // 22 | // To prevent memory leaks, Close should be called on the Cache when the 23 | // program no longer needs it. Note: if the process is shutting down, this may 24 | // not be necessary and could be avoided to shorten shutdown time. 25 | func NewLRUCache(capacity int) *Cache { 26 | return &Cache{C.leveldb_cache_create_lru(C.size_t(capacity))} 27 | } 28 | 29 | // Close deallocates the underlying memory of the Cache object. 30 | func (c *Cache) Close() { 31 | C.leveldb_cache_destroy(c.Cache) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/filterpolicy.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include 5 | // #include "leveldb/c.h" 6 | import "C" 7 | 8 | // FilterPolicy is a factory type that allows the LevelDB database to create a 9 | // filter, such as a bloom filter, that is stored in the sstables and used by 10 | // DB.Get to reduce reads. 11 | // 12 | // An instance of this struct may be supplied to Options when opening a 13 | // DB. Typical usage is to call NewBloomFilter to get an instance. 14 | // 15 | // To prevent memory leaks, a FilterPolicy must have Close called on it when 16 | // it is no longer needed by the program. 17 | type FilterPolicy struct { 18 | Policy *C.leveldb_filterpolicy_t 19 | } 20 | 21 | // NewBloomFilter creates a filter policy that will create a bloom filter when 22 | // necessary with the given number of bits per key. 23 | // 24 | // See the FilterPolicy documentation for more. 25 | func NewBloomFilter(bitsPerKey int) *FilterPolicy { 26 | policy := C.leveldb_filterpolicy_create_bloom(C.int(bitsPerKey)) 27 | return &FilterPolicy{policy} 28 | } 29 | 30 | // Close reaps the resources associated with this FilterPolicy. 31 | func (fp *FilterPolicy) Close() { 32 | C.leveldb_filterpolicy_destroy(fp.Policy) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Unveil implements the unveil syscall. 13 | // For more information see unveil(2). 14 | // Note that the special case of blocking further 15 | // unveil calls is handled by UnveilBlock. 16 | func Unveil(path string, flags string) error { 17 | pathPtr, err := syscall.BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := syscall.BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 26 | if e != 0 { 27 | return e 28 | } 29 | return nil 30 | } 31 | 32 | // UnveilBlock blocks future unveil calls. 33 | // For more information see unveil(2). 34 | func UnveilBlock() error { 35 | // Both pointers must be nil. 36 | var pathUnsafe, flagsUnsafe unsafe.Pointer 37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 38 | if e != 0 { 39 | return e 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/omniscale/go-osm/replication/replication.go: -------------------------------------------------------------------------------- 1 | package replication 2 | 3 | import "time" 4 | 5 | // A Sequence contains metadata for a replication file (diff or changeset). 6 | type Sequence struct { 7 | // Sequence specifies the number of this replication file. 8 | Sequence int 9 | // Error describes any an error that occurred the during download of the 10 | // replication file. The filenames and Time are zero if Error is set. 11 | Error error 12 | // Filename specifies the full path to the replication file. 13 | Filename string 14 | // StateFilename specifies the full path to the .state.txt file for this sequence. 15 | StateFilename string 16 | // Time specifies the creation time of this replication sequence. The 17 | // replication file will only contain data older then this timestamp. 18 | Time time.Time 19 | // Latest is true if the next Sequence is not yet available. 20 | Latest bool 21 | } 22 | 23 | // A Source provides a stream of replication files. 24 | type Source interface { 25 | // Sequences returns the channel with metadata for each replication file. 26 | Sequences() <-chan Sequence 27 | 28 | // Stop signals the source that it should stop loading more replication 29 | // files and that Sequences channel should be closed. 30 | Stop() 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build openbsd 6 | // +build openbsd 7 | 8 | package unix 9 | 10 | import _ "unsafe" 11 | 12 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 18 | 19 | //go:linkname syscall_syscall syscall.syscall 20 | //go:linkname syscall_syscall6 syscall.syscall6 21 | //go:linkname syscall_syscall10 syscall.syscall10 22 | //go:linkname syscall_rawSyscall syscall.rawSyscall 23 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 24 | 25 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 26 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | // +build riscv64 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for linux/riscv64. 13 | // 14 | // Where available, just jump to package syscall's implementation of 15 | // these functions. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOV a1+8(FP), A0 26 | MOV a2+16(FP), A1 27 | MOV a3+24(FP), A2 28 | MOV trap+0(FP), A7 // syscall entry 29 | ECALL 30 | MOV A0, r1+32(FP) // r1 31 | MOV A1, r2+40(FP) // r2 32 | CALL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | JMP syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | JMP syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOV a1+8(FP), A0 43 | MOV a2+16(FP), A1 44 | MOV a3+24(FP), A2 45 | MOV trap+0(FP), A7 // syscall entry 46 | ECALL 47 | MOV A0, r1+32(FP) 48 | MOV A1, r2+40(FP) 49 | RET 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 13 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 14 | var fcntl64Syscall uintptr = SYS_FCNTL 15 | 16 | func fcntl(fd int, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 26 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 27 | return fcntl(int(fd), cmd, arg) 28 | } 29 | 30 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 31 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 32 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 33 | if errno == 0 { 34 | return nil 35 | } 36 | return errno 37 | } 38 | -------------------------------------------------------------------------------- /vendor/modules.txt: -------------------------------------------------------------------------------- 1 | # github.com/gogo/protobuf v1.3.2 2 | ## explicit; go 1.15 3 | github.com/gogo/protobuf/gogoproto 4 | github.com/gogo/protobuf/proto 5 | github.com/gogo/protobuf/protoc-gen-gogo/descriptor 6 | # github.com/jmhodges/levigo v1.0.1-0.20191214093932-ed89ec741d96 7 | ## explicit; go 1.13 8 | github.com/jmhodges/levigo 9 | # github.com/kr/pretty v0.3.1 10 | ## explicit; go 1.12 11 | # github.com/lib/pq v1.10.9 12 | ## explicit; go 1.13 13 | github.com/lib/pq 14 | github.com/lib/pq/hstore 15 | github.com/lib/pq/oid 16 | github.com/lib/pq/scram 17 | # github.com/omniscale/go-osm v0.3.1 18 | ## explicit; go 1.21.0 19 | github.com/omniscale/go-osm 20 | github.com/omniscale/go-osm/parser/diff 21 | github.com/omniscale/go-osm/parser/pbf 22 | github.com/omniscale/go-osm/parser/pbf/internal/osmpbf 23 | github.com/omniscale/go-osm/replication 24 | github.com/omniscale/go-osm/replication/diff 25 | github.com/omniscale/go-osm/replication/internal/source 26 | github.com/omniscale/go-osm/state 27 | # github.com/pkg/errors v0.9.1 28 | ## explicit 29 | github.com/pkg/errors 30 | # golang.org/x/sys v0.4.0 31 | ## explicit; go 1.17 32 | golang.org/x/sys/unix 33 | # gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 34 | ## explicit 35 | # gopkg.in/fsnotify.v1 v1.4.7 36 | ## explicit 37 | gopkg.in/fsnotify.v1 38 | # gopkg.in/yaml.v2 v2.4.0 39 | ## explicit; go 1.15 40 | gopkg.in/yaml.v2 41 | -------------------------------------------------------------------------------- /cache/binary/tags.py: -------------------------------------------------------------------------------- 1 | # query taginfo for most used 2 | 3 | import json 4 | import urllib2 5 | 6 | URL = "http://taginfo.openstreetmap.org/api/4/tags/popular?sortname=count_%s&sortorder=desc&page=1&rp=200&qtype=tag" 7 | 8 | added = set() 9 | 10 | def codepoints_for(elem_type, min_count=100000): 11 | resp = urllib2.urlopen(URL % elem_type) 12 | data = json.load(resp) 13 | by_count = [] 14 | for item in data['data']: 15 | if item['in_wiki'] != 1: 16 | continue 17 | if item['key'] not in ('source', 'source_ref', 'attribution', 'import', 'import_uuid'): 18 | by_count.append((item['count_%s' % elem_type], item['key'], item['value'].encode('utf8'), item['count_%s_fraction' % elem_type])) 19 | 20 | by_count.sort(reverse=True) 21 | fraction = 0.0 22 | for item in by_count: 23 | fraction += item[-1] 24 | if item[0] < min_count: 25 | break 26 | key_val = (item[1], item[2]) 27 | if key_val in added: 28 | print '//', 29 | added.add(key_val) 30 | print 'addTagCodePoint("%s", "%s")' % key_val 31 | 32 | 33 | if __name__ == '__main__': 34 | print '// most used tags for ways' 35 | codepoints_for('ways') 36 | print '// most used tags for nodes' 37 | codepoints_for('nodes') 38 | print '// most used tags for rels' 39 | codepoints_for('relations') -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && arm64 && gc 6 | // +build linux 7 | // +build arm64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // Just jump to package syscall's implementation for all these functions. 13 | // The runtime may know about them. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | B syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | B syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | BL runtime·entersyscall(SB) 23 | MOVD a1+8(FP), R0 24 | MOVD a2+16(FP), R1 25 | MOVD a3+24(FP), R2 26 | MOVD $0, R3 27 | MOVD $0, R4 28 | MOVD $0, R5 29 | MOVD trap+0(FP), R8 // syscall entry 30 | SVC 31 | MOVD R0, r1+32(FP) // r1 32 | MOVD R1, r2+40(FP) // r2 33 | BL runtime·exitsyscall(SB) 34 | RET 35 | 36 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 37 | B syscall·RawSyscall(SB) 38 | 39 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 40 | B syscall·RawSyscall6(SB) 41 | 42 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 43 | MOVD a1+8(FP), R0 44 | MOVD a2+16(FP), R1 45 | MOVD a3+24(FP), R2 46 | MOVD $0, R3 47 | MOVD $0, R4 48 | MOVD $0, R5 49 | MOVD trap+0(FP), R8 // syscall entry 50 | SVC 51 | MOVD R0, r1+32(FP) 52 | MOVD R1, r2+40(FP) 53 | RET 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 6 | // +build darwin,go1.12 7 | 8 | package unix 9 | 10 | import _ "unsafe" 11 | 12 | // Implemented in the runtime package (runtime/sys_darwin.go) 13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 17 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 19 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 20 | 21 | //go:linkname syscall_syscall syscall.syscall 22 | //go:linkname syscall_syscall6 syscall.syscall6 23 | //go:linkname syscall_syscall6X syscall.syscall6X 24 | //go:linkname syscall_syscall9 syscall.syscall9 25 | //go:linkname syscall_rawSyscall syscall.rawSyscall 26 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 27 | //go:linkname syscall_syscallPtr syscall.syscallPtr 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | ## Context 10 | 11 | 12 | ## Expected Behavior 13 | 14 | 15 | ## Actual Behavior 16 | 17 | 18 | ## Possible Fix 19 | 20 | 21 | ## Steps to Reproduce 22 | 23 | 24 | 25 | 1. 26 | 2. 27 | 3. 28 | 4. 29 | 30 | ## Context 31 | 32 | 33 | ## Your Environment 34 | 35 | * Version used: 36 | * Environment name and version (e.g. PostgreSQL x.y.z with PostGIS a.b.c): 37 | * Server type and version: 38 | * Operating System and version: 39 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for arm, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 24 | BL runtime·entersyscall(SB) 25 | MOVW trap+0(FP), R7 26 | MOVW a1+4(FP), R0 27 | MOVW a2+8(FP), R1 28 | MOVW a3+12(FP), R2 29 | MOVW $0, R3 30 | MOVW $0, R4 31 | MOVW $0, R5 32 | SWI $0 33 | MOVW R0, r1+16(FP) 34 | MOVW $0, R0 35 | MOVW R0, r2+20(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 40 | B syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 43 | B syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 46 | MOVW trap+0(FP), R7 // syscall entry 47 | MOVW a1+4(FP), R0 48 | MOVW a2+8(FP), R1 49 | MOVW a3+12(FP), R2 50 | SWI $0 51 | MOVW R0, r1+16(FP) 52 | MOVW $0, R0 53 | MOVW R0, r2+20(FP) 54 | RET 55 | 56 | TEXT ·seek(SB),NOSPLIT,$0-28 57 | B syscall·seek(SB) 58 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/README.md: -------------------------------------------------------------------------------- 1 | # pq - A pure Go postgres driver for Go's database/sql package 2 | 3 | [![GoDoc](https://godoc.org/github.com/lib/pq?status.svg)](https://pkg.go.dev/github.com/lib/pq?tab=doc) 4 | 5 | ## Install 6 | 7 | go get github.com/lib/pq 8 | 9 | ## Features 10 | 11 | * SSL 12 | * Handles bad connections for `database/sql` 13 | * Scan `time.Time` correctly (i.e. `timestamp[tz]`, `time[tz]`, `date`) 14 | * Scan binary blobs correctly (i.e. `bytea`) 15 | * Package for `hstore` support 16 | * COPY FROM support 17 | * pq.ParseURL for converting urls to connection strings for sql.Open. 18 | * Many libpq compatible environment variables 19 | * Unix socket support 20 | * Notifications: `LISTEN`/`NOTIFY` 21 | * pgpass support 22 | * GSS (Kerberos) auth 23 | 24 | ## Tests 25 | 26 | `go test` is used for testing. See [TESTS.md](TESTS.md) for more details. 27 | 28 | ## Status 29 | 30 | This package is currently in maintenance mode, which means: 31 | 1. It generally does not accept new features. 32 | 2. It does accept bug fixes and version compatability changes provided by the community. 33 | 3. Maintainers usually do not resolve reported issues. 34 | 4. Community members are encouraged to help each other with reported issues. 35 | 36 | For users that require new features or reliable resolution of reported bugs, we recommend using [pgx](https://github.com/jackc/pgx) which is under active development. 37 | -------------------------------------------------------------------------------- /test/single_table_mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "tags": { 3 | "load_all": true, 4 | "exclude": [ 5 | "created_by", 6 | "source" 7 | ] 8 | }, 9 | "use_single_id_space": true, 10 | "tables": { 11 | "all": { 12 | "columns": [ 13 | { 14 | "type": "id", 15 | "name": "osm_id", 16 | "key": null 17 | }, 18 | { 19 | "type": "geometry", 20 | "name": "geometry", 21 | "key": null 22 | }, 23 | { 24 | "type": "hstore_tags", 25 | "name": "tags", 26 | "key": null 27 | } 28 | ], 29 | "type": "geometry", 30 | "type_mappings": { 31 | "points": { 32 | "amenity": ["__any__"], 33 | "poi": ["__any__"], 34 | "shop": ["__any__"] 35 | }, 36 | "linestrings": { 37 | "highway": ["__any__"] 38 | }, 39 | "polygons": { 40 | "landuse": ["__any__"], 41 | "building": ["__any__"], 42 | "shop": ["__any__"] 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && s390x && gc 6 | // +build linux 7 | // +build s390x 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for s390x, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | BR syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | BR syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | BL runtime·entersyscall(SB) 27 | MOVD a1+8(FP), R2 28 | MOVD a2+16(FP), R3 29 | MOVD a3+24(FP), R4 30 | MOVD $0, R5 31 | MOVD $0, R6 32 | MOVD $0, R7 33 | MOVD trap+0(FP), R1 // syscall entry 34 | SYSCALL 35 | MOVD R2, r1+32(FP) 36 | MOVD R3, r2+40(FP) 37 | BL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | BR syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | BR syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVD a1+8(FP), R2 48 | MOVD a2+16(FP), R3 49 | MOVD a3+24(FP), R4 50 | MOVD $0, R5 51 | MOVD $0, R6 52 | MOVD $0, R7 53 | MOVD trap+0(FP), R1 // syscall entry 54 | SYSCALL 55 | MOVD R2, r1+32(FP) 56 | MOVD R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE.libyaml: -------------------------------------------------------------------------------- 1 | The following files were ported to Go from C files of libyaml, and thus 2 | are still covered by their original copyright and license: 3 | 4 | apic.go 5 | emitterc.go 6 | parserc.go 7 | readerc.go 8 | scannerc.go 9 | writerc.go 10 | yamlh.go 11 | yamlprivateh.go 12 | 13 | Copyright (c) 2006 Kirill Simonov 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of 16 | this software and associated documentation files (the "Software"), to deal in 17 | the Software without restriction, including without limitation the rights to 18 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 19 | of the Software, and to permit persons to whom the Software is furnished to do 20 | so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. 2 | 3 | //go:build linux && (arm || arm64) 4 | // +build linux 5 | // +build arm arm64 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsArm is the registers used by arm binaries. 12 | type PtraceRegsArm struct { 13 | Uregs [18]uint32 14 | } 15 | 16 | // PtraceGetRegsArm fetches the registers used by arm binaries. 17 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 18 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 19 | } 20 | 21 | // PtraceSetRegsArm sets the registers used by arm binaries. 22 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 23 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 24 | } 25 | 26 | // PtraceRegsArm64 is the registers used by arm64 binaries. 27 | type PtraceRegsArm64 struct { 28 | Regs [31]uint64 29 | Sp uint64 30 | Pc uint64 31 | Pstate uint64 32 | } 33 | 34 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 35 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 36 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 37 | } 38 | 39 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 40 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 41 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips || mipsle) && gc 6 | // +build linux 7 | // +build mips mipsle 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-28 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 26 | JMP syscall·Syscall9(SB) 27 | 28 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 29 | JAL runtime·entersyscall(SB) 30 | MOVW a1+4(FP), R4 31 | MOVW a2+8(FP), R5 32 | MOVW a3+12(FP), R6 33 | MOVW R0, R7 34 | MOVW trap+0(FP), R2 // syscall entry 35 | SYSCALL 36 | MOVW R2, r1+16(FP) // r1 37 | MOVW R3, r2+20(FP) // r2 38 | JAL runtime·exitsyscall(SB) 39 | RET 40 | 41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 42 | JMP syscall·RawSyscall(SB) 43 | 44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 45 | JMP syscall·RawSyscall6(SB) 46 | 47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 48 | MOVW a1+4(FP), R4 49 | MOVW a2+8(FP), R5 50 | MOVW a3+12(FP), R6 51 | MOVW trap+0(FP), R2 // syscall entry 52 | SYSCALL 53 | MOVW R2, r1+16(FP) 54 | MOVW R3, r2+20(FP) 55 | RET 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && loong64 && gc 6 | // +build linux 7 | // +build loong64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | JAL runtime·entersyscall(SB) 24 | MOVV a1+8(FP), R4 25 | MOVV a2+16(FP), R5 26 | MOVV a3+24(FP), R6 27 | MOVV R0, R7 28 | MOVV R0, R8 29 | MOVV R0, R9 30 | MOVV trap+0(FP), R11 // syscall entry 31 | SYSCALL 32 | MOVV R4, r1+32(FP) 33 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 34 | JAL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVV a1+8(FP), R4 45 | MOVV a2+16(FP), R5 46 | MOVV a3+24(FP), R6 47 | MOVV R0, R7 48 | MOVV R0, R8 49 | MOVV R0, R9 50 | MOVV trap+0(FP), R11 // syscall entry 51 | SYSCALL 52 | MOVV R4, r1+32(FP) 53 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: gogo.proto 3 | // DO NOT EDIT! 4 | 5 | package gogoproto 6 | 7 | import proto "github.com/gogo/protobuf/proto" 8 | import json "encoding/json" 9 | import math "math" 10 | import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" 11 | 12 | // Reference proto, json, and math imports to suppress error if they are not otherwise used. 13 | var _ = proto.Marshal 14 | var _ = &json.SyntaxError{} 15 | var _ = math.Inf 16 | 17 | var E_Nullable = &proto.ExtensionDesc{ 18 | ExtendedType: (*google_protobuf.FieldOptions)(nil), 19 | ExtensionType: (*bool)(nil), 20 | Field: 51235, 21 | Name: "gogoproto.nullable", 22 | Tag: "varint,51235,opt,name=nullable", 23 | } 24 | 25 | var E_Embed = &proto.ExtensionDesc{ 26 | ExtendedType: (*google_protobuf.FieldOptions)(nil), 27 | ExtensionType: (*bool)(nil), 28 | Field: 51236, 29 | Name: "gogoproto.embed", 30 | Tag: "varint,51236,opt,name=embed", 31 | } 32 | 33 | var E_Customtype = &proto.ExtensionDesc{ 34 | ExtendedType: (*google_protobuf.FieldOptions)(nil), 35 | ExtensionType: (*string)(nil), 36 | Field: 51237, 37 | Name: "gogoproto.customtype", 38 | Tag: "bytes,51237,opt,name=customtype", 39 | } 40 | 41 | func init() { 42 | proto.RegisterExtension(E_Nullable) 43 | proto.RegisterExtension(E_Embed) 44 | proto.RegisterExtension(E_Customtype) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for AMD64, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOVQ a1+8(FP), DI 26 | MOVQ a2+16(FP), SI 27 | MOVQ a3+24(FP), DX 28 | MOVQ $0, R10 29 | MOVQ $0, R8 30 | MOVQ $0, R9 31 | MOVQ trap+0(FP), AX // syscall entry 32 | SYSCALL 33 | MOVQ AX, r1+32(FP) 34 | MOVQ DX, r2+40(FP) 35 | CALL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 45 | MOVQ a1+8(FP), DI 46 | MOVQ a2+16(FP), SI 47 | MOVQ a3+24(FP), DX 48 | MOVQ $0, R10 49 | MOVQ $0, R8 50 | MOVQ $0, R9 51 | MOVQ trap+0(FP), AX // syscall entry 52 | SYSCALL 53 | MOVQ AX, r1+32(FP) 54 | MOVQ DX, r2+40(FP) 55 | RET 56 | 57 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 58 | JMP syscall·gettimeofday(SB) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) && gc 6 | // +build linux 7 | // +build mips64 mips64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | JAL runtime·entersyscall(SB) 27 | MOVV a1+8(FP), R4 28 | MOVV a2+16(FP), R5 29 | MOVV a3+24(FP), R6 30 | MOVV R0, R7 31 | MOVV R0, R8 32 | MOVV R0, R9 33 | MOVV trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVV R2, r1+32(FP) 36 | MOVV R3, r2+40(FP) 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVV a1+8(FP), R4 48 | MOVV a2+16(FP), R5 49 | MOVV a3+24(FP), R6 50 | MOVV R0, R7 51 | MOVV R0, R8 52 | MOVV R0, R9 53 | MOVV trap+0(FP), R2 // syscall entry 54 | SYSCALL 55 | MOVV R2, r1+32(FP) 56 | MOVV R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | ) 13 | 14 | // Round the length of a raw sockaddr up to align it properly. 15 | func cmsgAlignOf(salen int) int { 16 | salign := SizeofPtr 17 | 18 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 19 | // sockcmsg_dragonfly.go 20 | switch runtime.GOOS { 21 | case "aix": 22 | // There is no alignment on AIX. 23 | salign = 1 24 | case "darwin", "ios", "illumos", "solaris": 25 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 26 | // kernels still require 32-bit aligned access to network 27 | // subsystem. 28 | if SizeofPtr == 8 { 29 | salign = 4 30 | } 31 | case "netbsd", "openbsd": 32 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 33 | if runtime.GOARCH == "arm" { 34 | salign = 8 35 | } 36 | // NetBSD aarch64 requires 128-bit alignment. 37 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 38 | salign = 16 39 | } 40 | case "zos": 41 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 42 | // not pointer width. 43 | salign = SizeofInt 44 | } 45 | 46 | return (salen + salign - 1) & ^(salign - 1) 47 | } 48 | -------------------------------------------------------------------------------- /geom/limit/clipping.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 4 | 5 | "features": [ 6 | { "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 9.954755609379474, 53.571876422071362 ], [ 9.965983954174423, 53.584913170828465 ], [ 9.982202674433795, 53.592911003648098 ], [ 10.000417544878935, 53.596168946041004 ], [ 10.004908882796917, 53.599278565796155 ], [ 10.015388671272202, 53.600907322890677 ], [ 10.030359797665469, 53.601055388603349 ], [ 10.034601616810226, 53.589504704351242 ], [ 10.037346323315658, 53.576321219894261 ], [ 10.046079480378397, 53.568172066952314 ], [ 10.03759584208888, 53.563281821320793 ], [ 10.042336698780082, 53.553796096879587 ], [ 10.030359797665469, 53.55097961299515 ], [ 10.037096804542438, 53.538228972823489 ], [ 10.027365572386815, 53.525919479865891 ], [ 10.031856910304796, 53.519540865555904 ], [ 9.97671326142293, 53.518057329222344 ], [ 9.948018602502502, 53.515683563037065 ], [ 9.948018602502502, 53.515683563037065 ], [ 9.909842230199672, 53.516128654326764 ], [ 9.921569612541065, 53.534076772724042 ], [ 9.928556138191254, 53.54134285568388 ], [ 9.947020527409617, 53.542232494433655 ], [ 9.948767158822166, 53.547718186927078 ], [ 9.942030151945195, 53.56239262500295 ], [ 9.942030151945195, 53.56239262500295 ], [ 9.946521489863175, 53.56698660478073 ], [ 9.954755609379474, 53.571876422071362 ] ] ] } } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/any_any_mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "tags": { 3 | "load_all": true, 4 | "exclude": [ 5 | "created_by", 6 | "source" 7 | ] 8 | }, 9 | "tables": { 10 | "all": { 11 | "columns": [ 12 | { 13 | "type": "id", 14 | "name": "osm_id" 15 | }, 16 | { 17 | "type": "geometry", 18 | "name": "geometry" 19 | }, 20 | { 21 | "type": "hstore_tags", 22 | "name": "tags" 23 | } 24 | ], 25 | "type": "point", 26 | "mapping": { 27 | "__any__": ["__any__"] 28 | } 29 | }, 30 | "amenities": { 31 | "columns": [ 32 | { 33 | "type": "id", 34 | "name": "osm_id" 35 | }, 36 | { 37 | "type": "geometry", 38 | "name": "geometry" 39 | }, 40 | { 41 | "type": "hstore_tags", 42 | "name": "tags" 43 | }, 44 | { 45 | "type": "mapping_value", 46 | "name": "type" 47 | }, 48 | ], 49 | "type": "point", 50 | "mapping": { 51 | "amenity": ["__any__"] 52 | } 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-22.04 8 | 9 | env: 10 | PGPASSWORD: postgres 11 | PGUSER: postgres 12 | 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | go: 17 | - '1.22' 18 | postgis: 19 | - '14-3.2' 20 | - '15-3.3' 21 | - '16-3.4' 22 | - '17-3.5' 23 | - '18-3.6' 24 | 25 | services: 26 | postgres: 27 | image: postgis/postgis:${{ matrix.postgis }} 28 | env: 29 | POSTGRES_PASSWORD: postgres 30 | options: >- 31 | --health-cmd pg_isready 32 | --health-interval 10s 33 | --health-timeout 5s 34 | --health-retries 5 35 | ports: 36 | - 5432:5432 37 | 38 | name: Build with go v${{ matrix.go }} with postgis image ${{ matrix.postgis }} 39 | 40 | steps: 41 | - uses: actions/checkout@v4 42 | 43 | - uses: actions/setup-go@v5 44 | with: 45 | go-version: ${{ matrix.go }} 46 | check-latest: true 47 | 48 | - name: Prepare postgres 49 | run: >- 50 | psql --host localhost --dbname postgres -c "create extension if not exists postgis; create extension if not exists hstore;" 51 | 52 | - name: Install deps 53 | run: >- 54 | sudo apt-get update && sudo apt-get install -y --no-install-recommends \ 55 | libgeos-dev \ 56 | libleveldb-dev \ 57 | osmosis \ 58 | 59 | - run: make 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && dragonfly 6 | // +build amd64,dragonfly 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: nsec} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: usec} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint64(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint64(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/go113.go: -------------------------------------------------------------------------------- 1 | // +build go1.13 2 | 3 | package errors 4 | 5 | import ( 6 | stderrors "errors" 7 | ) 8 | 9 | // Is reports whether any error in err's chain matches target. 10 | // 11 | // The chain consists of err itself followed by the sequence of errors obtained by 12 | // repeatedly calling Unwrap. 13 | // 14 | // An error is considered to match a target if it is equal to that target or if 15 | // it implements a method Is(error) bool such that Is(target) returns true. 16 | func Is(err, target error) bool { return stderrors.Is(err, target) } 17 | 18 | // As finds the first error in err's chain that matches target, and if so, sets 19 | // target to that error value and returns true. 20 | // 21 | // The chain consists of err itself followed by the sequence of errors obtained by 22 | // repeatedly calling Unwrap. 23 | // 24 | // An error matches target if the error's concrete value is assignable to the value 25 | // pointed to by target, or if the error has a method As(interface{}) bool such that 26 | // As(target) returns true. In the latter case, the As method is responsible for 27 | // setting target. 28 | // 29 | // As will panic if target is not a non-nil pointer to either a type that implements 30 | // error, or to any interface type. As returns false if err is nil. 31 | func As(err error, target interface{}) bool { return stderrors.As(err, target) } 32 | 33 | // Unwrap returns the result of calling the Unwrap method on err, if err's 34 | // type contains an Unwrap method returning error. 35 | // Otherwise, Unwrap returns nil. 36 | func Unwrap(err error) error { 37 | return stderrors.Unwrap(err) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func Fstat(fd int, stat *Stat_t) error { 41 | return fstat(fd, stat) 42 | } 43 | 44 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 45 | return fstatat(dirfd, path, stat, flags) 46 | } 47 | 48 | func Lstat(path string, stat *Stat_t) error { 49 | return lstat(path, stat) 50 | } 51 | 52 | func Stat(path string, statptr *Stat_t) error { 53 | return stat(path, statptr) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | Copyright (c) 2012 fsnotify Authors. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /test/route_relation_mapping.yml: -------------------------------------------------------------------------------- 1 | tables: 2 | master_routes: 3 | type: relation_member 4 | columns: 5 | - name: osm_id 6 | type: id 7 | - name: member 8 | type: member_id 9 | - name: index 10 | type: member_index 11 | - name: role 12 | type: member_role 13 | - name: type 14 | type: member_type 15 | - name: geometry 16 | type: geometry 17 | - name: subname 18 | key: name 19 | type: string 20 | from_member: true 21 | - key: name 22 | name: name 23 | type: string 24 | relation_types: [route_master] 25 | mapping: 26 | route_master: [bus] 27 | route_members: 28 | type: relation_member 29 | columns: 30 | - name: osm_id 31 | type: id 32 | - key: ref 33 | name: ref 34 | type: string 35 | - name: member 36 | type: member_id 37 | - name: index 38 | type: member_index 39 | - name: role 40 | type: member_role 41 | - name: type 42 | type: member_type 43 | - name: geometry 44 | type: geometry 45 | - name: relname 46 | key: name 47 | type: string 48 | - name: name 49 | key: name 50 | type: string 51 | from_member: true 52 | relation_types: [route] 53 | mapping: 54 | route: [bus, tram, rail] 55 | routes: 56 | type: relation 57 | columns: 58 | - name: osm_id 59 | type: id 60 | - key: ref 61 | name: ref 62 | type: string 63 | - name: tags 64 | type: hstore_tags 65 | relation_types: [route, route_master] 66 | mapping: 67 | route_master: [bus, tram, rail] 68 | route: [bus, tram, rail] 69 | -------------------------------------------------------------------------------- /element/element_test.go: -------------------------------------------------------------------------------- 1 | package element 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestIDRefs(t *testing.T) { 8 | 9 | idRefs := IDRefs{} 10 | 11 | idRefs.Add(1) 12 | if idRefs.Refs[0] != 1 { 13 | t.Fatal(idRefs) 14 | } 15 | 16 | idRefs.Add(10) 17 | if idRefs.Refs[0] != 1 || idRefs.Refs[1] != 10 { 18 | t.Fatal(idRefs) 19 | } 20 | 21 | // insert twice 22 | idRefs.Add(10) 23 | if idRefs.Refs[0] != 1 || idRefs.Refs[1] != 10 || len(idRefs.Refs) != 2 { 24 | t.Fatal(idRefs) 25 | } 26 | 27 | // insert before 28 | idRefs.Add(0) 29 | if idRefs.Refs[0] != 0 || idRefs.Refs[1] != 1 || idRefs.Refs[2] != 10 { 30 | t.Fatal(idRefs) 31 | } 32 | 33 | // insert after 34 | idRefs.Add(12) 35 | if idRefs.Refs[0] != 0 || idRefs.Refs[1] != 1 || idRefs.Refs[2] != 10 || idRefs.Refs[3] != 12 { 36 | t.Fatal(idRefs) 37 | } 38 | 39 | // insert between 40 | idRefs.Add(11) 41 | if idRefs.Refs[0] != 0 || idRefs.Refs[1] != 1 || idRefs.Refs[2] != 10 || idRefs.Refs[3] != 11 || idRefs.Refs[4] != 12 { 42 | t.Fatal(idRefs) 43 | } 44 | 45 | // delete between 46 | idRefs.Delete(11) 47 | if idRefs.Refs[0] != 0 || idRefs.Refs[1] != 1 || idRefs.Refs[2] != 10 || idRefs.Refs[3] != 12 { 48 | t.Fatal(idRefs) 49 | } 50 | 51 | // delete end 52 | idRefs.Delete(12) 53 | if idRefs.Refs[0] != 0 || idRefs.Refs[1] != 1 || idRefs.Refs[2] != 10 { 54 | t.Fatal(idRefs) 55 | } 56 | 57 | // delete begin 58 | idRefs.Delete(0) 59 | if idRefs.Refs[0] != 1 || idRefs.Refs[1] != 10 { 60 | t.Fatal(idRefs) 61 | } 62 | 63 | // delete missing 64 | idRefs.Delete(99) 65 | if idRefs.Refs[0] != 1 || idRefs.Refs[1] != 10 || len(idRefs.Refs) != 2 { 66 | t.Fatal(idRefs) 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /element/element.go: -------------------------------------------------------------------------------- 1 | package element 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | type IDRefs struct { 8 | ID int64 9 | Refs []int64 10 | } 11 | 12 | func (idRefs *IDRefs) Add(ref int64) { 13 | i := sort.Search(len(idRefs.Refs), func(i int) bool { 14 | return idRefs.Refs[i] >= ref 15 | }) 16 | if i < len(idRefs.Refs) && idRefs.Refs[i] >= ref { 17 | if idRefs.Refs[i] > ref { 18 | idRefs.Refs = append(idRefs.Refs, 0) 19 | copy(idRefs.Refs[i+1:], idRefs.Refs[i:]) 20 | idRefs.Refs[i] = ref 21 | } // else already inserted 22 | } else { 23 | idRefs.Refs = append(idRefs.Refs, ref) 24 | } 25 | } 26 | 27 | func (idRefs *IDRefs) Delete(ref int64) { 28 | i := sort.Search(len(idRefs.Refs), func(i int) bool { 29 | return idRefs.Refs[i] >= ref 30 | }) 31 | if i < len(idRefs.Refs) && idRefs.Refs[i] == ref { 32 | idRefs.Refs = append(idRefs.Refs[:i], idRefs.Refs[i+1:]...) 33 | } 34 | } 35 | 36 | // RelIDOffset is a constant we subtract from relation IDs 37 | // to avoid conflicts with way and node IDs. 38 | // Nodes, ways and relations have separate ID spaces in OSM, but 39 | // we need unique IDs for updating and removing elements in diff mode. 40 | // In a normal diff import relation IDs are negated to distinguish them 41 | // from way IDs, because ways and relations can both be imported in the 42 | // same polygon table. 43 | // Nodes are only imported together with ways and relations in single table 44 | // imports (see `type_mappings`). In this case we negate the way and 45 | // relation IDs and aditionaly subtract RelIDOffset from the relation IDs. 46 | // Ways will go from -0 to -100,000,000,000,000,000, relations from 47 | // -100,000,000,000,000,000 down wards. 48 | const RelIDOffset = -1e17 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. 2 | 3 | //go:build linux && (mips || mips64) 4 | // +build linux 5 | // +build mips mips64 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsMips is the registers used by mips binaries. 12 | type PtraceRegsMips struct { 13 | Regs [32]uint64 14 | Lo uint64 15 | Hi uint64 16 | Epc uint64 17 | Badvaddr uint64 18 | Status uint64 19 | Cause uint64 20 | } 21 | 22 | // PtraceGetRegsMips fetches the registers used by mips binaries. 23 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 25 | } 26 | 27 | // PtraceSetRegsMips sets the registers used by mips binaries. 28 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 30 | } 31 | 32 | // PtraceRegsMips64 is the registers used by mips64 binaries. 33 | type PtraceRegsMips64 struct { 34 | Regs [32]uint64 35 | Lo uint64 36 | Hi uint64 37 | Epc uint64 38 | Badvaddr uint64 39 | Status uint64 40 | Cause uint64 41 | } 42 | 43 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 44 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 46 | } 47 | 48 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 49 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && darwin 6 | // +build arm64,darwin 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func setTimespec(sec, nsec int64) Timespec { 13 | return Timespec{Sec: sec, Nsec: nsec} 14 | } 15 | 16 | func setTimeval(sec, usec int64) Timeval { 17 | return Timeval{Sec: sec, Usec: int32(usec)} 18 | } 19 | 20 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 21 | k.Ident = uint64(fd) 22 | k.Filter = int16(mode) 23 | k.Flags = uint16(flags) 24 | } 25 | 26 | func (iov *Iovec) SetLen(length int) { 27 | iov.Len = uint64(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetControllen(length int) { 31 | msghdr.Controllen = uint32(length) 32 | } 33 | 34 | func (msghdr *Msghdr) SetIovlen(length int) { 35 | msghdr.Iovlen = int32(length) 36 | } 37 | 38 | func (cmsg *Cmsghdr) SetLen(length int) { 39 | cmsg.Len = uint32(length) 40 | } 41 | 42 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 43 | 44 | //sys Fstat(fd int, stat *Stat_t) (err error) 45 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 46 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) 47 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT 48 | //sys Lstat(path string, stat *Stat_t) (err error) 49 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 50 | //sys Stat(path string, stat *Stat_t) (err error) 51 | //sys Statfs(path string, stat *Statfs_t) (err error) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || linux 6 | // +build darwin,!ios linux 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // SysvShmAttach attaches the Sysv shared memory segment associated with the 13 | // shared memory identifier id. 14 | func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) { 15 | addr, errno := shmat(id, addr, flag) 16 | if errno != nil { 17 | return nil, errno 18 | } 19 | 20 | // Retrieve the size of the shared memory to enable slice creation 21 | var info SysvShmDesc 22 | 23 | _, err := SysvShmCtl(id, IPC_STAT, &info) 24 | if err != nil { 25 | // release the shared memory if we can't find the size 26 | 27 | // ignoring error from shmdt as there's nothing sensible to return here 28 | shmdt(addr) 29 | return nil, err 30 | } 31 | 32 | // Use unsafe to convert addr into a []byte. 33 | b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz)) 34 | return b, nil 35 | } 36 | 37 | // SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach. 38 | // 39 | // It is not safe to use the slice after calling this function. 40 | func SysvShmDetach(data []byte) error { 41 | if len(data) == 0 { 42 | return EINVAL 43 | } 44 | 45 | return shmdt(uintptr(unsafe.Pointer(&data[0]))) 46 | } 47 | 48 | // SysvShmGet returns the Sysv shared memory identifier associated with key. 49 | // If the IPC_CREAT flag is specified a new segment is created. 50 | func SysvShmGet(key, size, flag int) (id int, err error) { 51 | return shmget(key, size, flag) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/encode_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | func NewRequiredNotSetError(field string) *RequiredNotSetError { 32 | return &RequiredNotSetError{field} 33 | } 34 | -------------------------------------------------------------------------------- /geom/limit/hamburg_clip.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | 4 | "features": [ 5 | { "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 1108158.325407607015222, 7089488.17479423712939 ], [ 1109408.259032631991431, 7091932.489438731223345 ], [ 1111213.718713223934174, 7093432.409788761287928 ], [ 1113241.388816042570397, 7094043.488449884578586 ], [ 1113741.362266052514315, 7094626.790808229707181 ], [ 1114907.966982742538676, 7094932.33013879135251 ], [ 1116574.545149442739785, 7094960.106441569514573 ], [ 1117046.74229667452164, 7092793.554824859835207 ], [ 1117352.281627236166969, 7090321.463877587579191 ], [ 1118324.452224477892742, 7088793.767224779352546 ], [ 1117380.057930014561862, 7087877.149233094416559 ], [ 1117907.807682802900672, 7086099.465855280868709 ], [ 1116574.545149442739785, 7085571.716102492064238 ], [ 1117324.505324458004907, 7083182.95406355522573 ], [ 1116241.229516102699563, 7080877.520932952873409 ], [ 1116741.202966112876311, 7079683.139913484454155 ], [ 1110602.640052100410685, 7079405.376885700970888 ], [ 1107408.3652325917501, 7078960.956041247583926 ], [ 1107408.3652325917501, 7078960.956041247583926 ], [ 1103158.590907506411895, 7079044.284949583001435 ], [ 1104464.07713808817789, 7082405.217585762031376 ], [ 1105241.813615881605074, 7083766.256421900354326 ], [ 1107297.26002147840336, 7083932.914238570258021 ], [ 1107491.694140926934779, 7084960.63744136877358 ], [ 1106741.733965911669657, 7087710.491416423581541 ], [ 1106741.733965911669657, 7087710.491416423581541 ], [ 1107241.707415921846405, 7088571.556802552193403 ], [ 1108158.325407607015222, 7089488.17479423712939 ] ] ] } } 6 | 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,!hurd 6 | // +build !aix,!hurd 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall"); 26 | 27 | struct ret 28 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 29 | { 30 | struct ret r; 31 | 32 | errno = 0; 33 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 34 | r.err = errno; 35 | return r; 36 | } 37 | 38 | uintptr_t gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 39 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError"); 40 | 41 | uintptr_t 42 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 43 | { 44 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 45 | } 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. 2 | 3 | //go:build linux && (mipsle || mips64le) 4 | // +build linux 5 | // +build mipsle mips64le 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsMipsle is the registers used by mipsle binaries. 12 | type PtraceRegsMipsle struct { 13 | Regs [32]uint64 14 | Lo uint64 15 | Hi uint64 16 | Epc uint64 17 | Badvaddr uint64 18 | Status uint64 19 | Cause uint64 20 | } 21 | 22 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 23 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 25 | } 26 | 27 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 28 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 30 | } 31 | 32 | // PtraceRegsMips64le is the registers used by mips64le binaries. 33 | type PtraceRegsMips64le struct { 34 | Regs [32]uint64 35 | Lo uint64 36 | Hi uint64 37 | Epc uint64 38 | Badvaddr uint64 39 | Status uint64 40 | Cause uint64 41 | } 42 | 43 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 44 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 46 | } 47 | 48 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 49 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used by the Linux kernel and glibc. 7 | // 8 | // The information below is extracted and adapted from bits/sysmacros.h in the 9 | // glibc sources: 10 | // 11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's 12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major 13 | // number and m is a hex digit of the minor number. This is backward compatible 14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also 15 | // backward compatible with the Linux kernel, which for some architectures uses 16 | // 32-bit dev_t, encoded as mmmM MMmm. 17 | 18 | package unix 19 | 20 | // Major returns the major component of a Linux device number. 21 | func Major(dev uint64) uint32 { 22 | major := uint32((dev & 0x00000000000fff00) >> 8) 23 | major |= uint32((dev & 0xfffff00000000000) >> 32) 24 | return major 25 | } 26 | 27 | // Minor returns the minor component of a Linux device number. 28 | func Minor(dev uint64) uint32 { 29 | minor := uint32((dev & 0x00000000000000ff) >> 0) 30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12) 31 | return minor 32 | } 33 | 34 | // Mkdev returns a Linux device number generated from the given major and minor 35 | // components. 36 | func Mkdev(major, minor uint32) uint64 { 37 | dev := (uint64(major) & 0x00000fff) << 8 38 | dev |= (uint64(major) & 0xfffff000) << 32 39 | dev |= (uint64(minor) & 0x000000ff) << 0 40 | dev |= (uint64(minor) & 0xffffff00) << 12 41 | return dev 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/properties_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2018, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "reflect" 33 | ) 34 | 35 | var sizerType = reflect.TypeOf((*Sizer)(nil)).Elem() 36 | var protosizerType = reflect.TypeOf((*ProtoSizer)(nil)).Elem() 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for 386, Linux 12 | // 13 | 14 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 15 | // instead of the glibc-specific "CALL 0x10(GS)". 16 | #define INVOKE_SYSCALL INT $0x80 17 | 18 | // Just jump to package syscall's implementation for all these functions. 19 | // The runtime may know about them. 20 | 21 | TEXT ·Syscall(SB),NOSPLIT,$0-28 22 | JMP syscall·Syscall(SB) 23 | 24 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 25 | JMP syscall·Syscall6(SB) 26 | 27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 28 | CALL runtime·entersyscall(SB) 29 | MOVL trap+0(FP), AX // syscall entry 30 | MOVL a1+4(FP), BX 31 | MOVL a2+8(FP), CX 32 | MOVL a3+12(FP), DX 33 | MOVL $0, SI 34 | MOVL $0, DI 35 | INVOKE_SYSCALL 36 | MOVL AX, r1+16(FP) 37 | MOVL DX, r2+20(FP) 38 | CALL runtime·exitsyscall(SB) 39 | RET 40 | 41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 42 | JMP syscall·RawSyscall(SB) 43 | 44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 45 | JMP syscall·RawSyscall6(SB) 46 | 47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 48 | MOVL trap+0(FP), AX // syscall entry 49 | MOVL a1+4(FP), BX 50 | MOVL a2+8(FP), CX 51 | MOVL a3+12(FP), DX 52 | MOVL $0, SI 53 | MOVL $0, DI 54 | INVOKE_SYSCALL 55 | MOVL AX, r1+16(FP) 56 | MOVL DX, r2+20(FP) 57 | RET 58 | 59 | TEXT ·socketcall(SB),NOSPLIT,$0-36 60 | JMP syscall·socketcall(SB) 61 | 62 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 63 | JMP syscall·rawsocketcall(SB) 64 | 65 | TEXT ·seek(SB),NOSPLIT,$0-28 66 | JMP syscall·seek(SB) 67 | -------------------------------------------------------------------------------- /geom/geos/coords.go: -------------------------------------------------------------------------------- 1 | package geos 2 | 3 | /* 4 | #cgo LDFLAGS: -lgeos_c 5 | #include "geos_c.h" 6 | #include 7 | */ 8 | import "C" 9 | 10 | type CoordSeq struct { 11 | v *C.GEOSCoordSequence 12 | } 13 | 14 | func (g *Geos) CreateCoordSeq(size, dim uint32) (*CoordSeq, error) { 15 | result := C.GEOSCoordSeq_create_r(g.v, C.uint(size), C.uint(dim)) 16 | if result == nil { 17 | return nil, CreateError("could not create CoordSeq") 18 | } 19 | return &CoordSeq{result}, nil 20 | } 21 | 22 | func (g *CoordSeq) SetXY(handle *Geos, i uint32, x, y float64) error { 23 | if C.GEOSCoordSeq_setX_r(handle.v, g.v, C.uint(i), C.double(x)) == 0 { 24 | return Error("unable to SetY") 25 | } 26 | if C.GEOSCoordSeq_setY_r(handle.v, g.v, C.uint(i), C.double(y)) == 0 { 27 | return Error("unable to SetX") 28 | } 29 | return nil 30 | } 31 | 32 | func (g *CoordSeq) AsPoint(handle *Geos) (*Geom, error) { 33 | geom := C.GEOSGeom_createPoint_r(handle.v, g.v) 34 | if geom == nil { 35 | return nil, CreateError("unable to create Point") 36 | } 37 | return &Geom{geom}, nil 38 | } 39 | 40 | func (g *CoordSeq) AsLineString(handle *Geos) (*Geom, error) { 41 | geom := C.GEOSGeom_createLineString_r(handle.v, g.v) 42 | if geom == nil { 43 | return nil, CreateError("unable to create LineString") 44 | } 45 | return &Geom{geom}, nil 46 | } 47 | 48 | func (g *CoordSeq) AsLinearRing(handle *Geos) (*Geom, error) { 49 | ring := C.GEOSGeom_createLinearRing_r(handle.v, g.v) 50 | if ring == nil { 51 | return nil, CreateError("unable to create LinearRing") 52 | } 53 | return &Geom{ring}, nil 54 | } 55 | 56 | func (g *Geos) DestroyCoordSeq(coordSeq *CoordSeq) { 57 | if coordSeq.v != nil { 58 | C.GEOSCoordSeq_destroy_r(g.v, coordSeq.v) 59 | coordSeq.v = nil 60 | } else { 61 | panic("double free?") 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && darwin 6 | // +build amd64,darwin 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func setTimespec(sec, nsec int64) Timespec { 13 | return Timespec{Sec: sec, Nsec: nsec} 14 | } 15 | 16 | func setTimeval(sec, usec int64) Timeval { 17 | return Timeval{Sec: sec, Usec: int32(usec)} 18 | } 19 | 20 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 21 | k.Ident = uint64(fd) 22 | k.Filter = int16(mode) 23 | k.Flags = uint16(flags) 24 | } 25 | 26 | func (iov *Iovec) SetLen(length int) { 27 | iov.Len = uint64(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetControllen(length int) { 31 | msghdr.Controllen = uint32(length) 32 | } 33 | 34 | func (msghdr *Msghdr) SetIovlen(length int) { 35 | msghdr.Iovlen = int32(length) 36 | } 37 | 38 | func (cmsg *Cmsghdr) SetLen(length int) { 39 | cmsg.Len = uint32(length) 40 | } 41 | 42 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 43 | 44 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 45 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 46 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 47 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 48 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 49 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 50 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 51 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 52 | -------------------------------------------------------------------------------- /test/route_relation.osc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /cache/binary/diff_test.go: -------------------------------------------------------------------------------- 1 | package binary 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/omniscale/imposm3/element" 7 | ) 8 | 9 | func TestMarshalBunch(t *testing.T) { 10 | bunch := []element.IDRefs{ 11 | {ID: 123923123, Refs: []int64{1213123}}, 12 | {ID: 123923133, Refs: []int64{1231237}}, 13 | {ID: 123924123, Refs: []int64{912412210, 912412213}}, 14 | {ID: 123924129, Refs: []int64{812412213}}, 15 | {ID: 123924130, Refs: []int64{91241213}}, 16 | {ID: 123924132, Refs: []int64{912412210, 9124213, 212412210}}, 17 | } 18 | 19 | buf := MarshalIDRefsBunch2(bunch, nil) 20 | newBunch := UnmarshalIDRefsBunch2(buf, nil) 21 | 22 | t.Log(len(buf), float64(len(buf))/6.0) 23 | 24 | if len(newBunch) != 6 { 25 | t.Fatal(newBunch) 26 | } 27 | if newBunch[0].ID != 123923123 || newBunch[0].Refs[0] != 1213123 { 28 | t.Fatal(newBunch[0]) 29 | } 30 | if newBunch[1].ID != 123923133 || newBunch[1].Refs[0] != 1231237 { 31 | t.Fatal(newBunch[1]) 32 | } 33 | if newBunch[2].ID != 123924123 || newBunch[2].Refs[0] != 912412210 || newBunch[2].Refs[1] != 912412213 { 34 | t.Fatal(newBunch[2]) 35 | } 36 | if newBunch[5].ID != 123924132 || newBunch[5].Refs[2] != 212412210 { 37 | t.Fatal(newBunch[5]) 38 | } 39 | } 40 | 41 | func BenchmarkMarshalBunch(b *testing.B) { 42 | bunch := []element.IDRefs{ 43 | {ID: 123923123, Refs: []int64{1213123}}, 44 | {ID: 123923133, Refs: []int64{1231237}}, 45 | {ID: 123924123, Refs: []int64{912412210, 912412213}}, 46 | {ID: 123924129, Refs: []int64{812412213}}, 47 | {ID: 123924130, Refs: []int64{91241213}}, 48 | {ID: 123924132, Refs: []int64{912412210, 9124213, 212412210}}, 49 | } 50 | idRefs := []element.IDRefs{} 51 | buf := []byte{} 52 | for i := 0; i < b.N; i++ { 53 | buf = MarshalIDRefsBunch2(bunch, buf) 54 | idRefs = UnmarshalIDRefsBunch2(buf, idRefs) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/custom_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2018, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import "reflect" 32 | 33 | type custom interface { 34 | Marshal() ([]byte, error) 35 | Unmarshal(data []byte) error 36 | Size() int 37 | } 38 | 39 | var customType = reflect.TypeOf((*custom)(nil)).Elem() 40 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/fsnotify.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !plan9 6 | 7 | // Package fsnotify provides a platform-independent interface for file system notifications. 8 | package fsnotify 9 | 10 | import ( 11 | "bytes" 12 | "errors" 13 | "fmt" 14 | ) 15 | 16 | // Event represents a single file system notification. 17 | type Event struct { 18 | Name string // Relative path to the file or directory. 19 | Op Op // File operation that triggered the event. 20 | } 21 | 22 | // Op describes a set of file operations. 23 | type Op uint32 24 | 25 | // These are the generalized file operations that can trigger a notification. 26 | const ( 27 | Create Op = 1 << iota 28 | Write 29 | Remove 30 | Rename 31 | Chmod 32 | ) 33 | 34 | func (op Op) String() string { 35 | // Use a buffer for efficient string concatenation 36 | var buffer bytes.Buffer 37 | 38 | if op&Create == Create { 39 | buffer.WriteString("|CREATE") 40 | } 41 | if op&Remove == Remove { 42 | buffer.WriteString("|REMOVE") 43 | } 44 | if op&Write == Write { 45 | buffer.WriteString("|WRITE") 46 | } 47 | if op&Rename == Rename { 48 | buffer.WriteString("|RENAME") 49 | } 50 | if op&Chmod == Chmod { 51 | buffer.WriteString("|CHMOD") 52 | } 53 | if buffer.Len() == 0 { 54 | return "" 55 | } 56 | return buffer.String()[1:] // Strip leading pipe 57 | } 58 | 59 | // String returns a string representation of the event in the form 60 | // "file: REMOVE|WRITE|..." 61 | func (e Event) String() string { 62 | return fmt.Sprintf("%q: %s", e.Name, e.Op.String()) 63 | } 64 | 65 | // Common errors that can be reported by a watcher 66 | var ErrEventOverflow = errors.New("fsnotify queue overflow") 67 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, The GoGo Authors. All rights reserved. 2 | 3 | Protocol Buffers for Go with Gadgets 4 | 5 | Go support for Protocol Buffers - Google's data interchange format 6 | 7 | Copyright 2010 The Go Authors. All rights reserved. 8 | https://github.com/golang/protobuf 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are 12 | met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the following disclaimer 18 | in the documentation and/or other materials provided with the 19 | distribution. 20 | * Neither the name of Google Inc. nor the names of its 21 | contributors may be used to endorse or promote products derived from 22 | this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | -------------------------------------------------------------------------------- /stats/counter.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import ( 4 | "sync" 5 | "sync/atomic" 6 | "time" 7 | ) 8 | 9 | type ElementCount struct { 10 | Current int64 11 | Total int64 12 | Rps float64 13 | LastRps float64 14 | } 15 | 16 | func NewRpsCounter() *RpsCounter { 17 | return &RpsCounter{ 18 | mu: &sync.Mutex{}, 19 | } 20 | } 21 | 22 | type RpsCounter struct { 23 | counter int64 24 | lastAdd int64 25 | start time.Time 26 | stop time.Time 27 | updated bool 28 | mu *sync.Mutex 29 | total int64 30 | } 31 | 32 | func (r *RpsCounter) Add(n int) { 33 | atomic.AddInt64(&r.counter, int64(n)) 34 | atomic.AddInt64(&r.lastAdd, int64(n)) 35 | if n > 0 { 36 | r.mu.Lock() 37 | defer r.mu.Unlock() 38 | if r.start.IsZero() { 39 | r.start = time.Now() 40 | } 41 | r.updated = true 42 | } 43 | } 44 | 45 | func (r *RpsCounter) Value() int64 { 46 | return atomic.LoadInt64(&r.counter) 47 | } 48 | 49 | func (r *RpsCounter) Rps() float64 { 50 | r.mu.Lock() 51 | defer r.mu.Unlock() 52 | return float64(atomic.LoadInt64(&r.counter)) / float64(r.stop.Sub(r.start).Seconds()) 53 | } 54 | 55 | func (r *RpsCounter) LastRps() float64 { 56 | r.mu.Lock() 57 | defer r.mu.Unlock() 58 | return float64(atomic.LoadInt64(&r.lastAdd)) / float64(time.Since(r.stop).Seconds()) 59 | } 60 | 61 | func (r *RpsCounter) Progress() float64 { 62 | if r.total == 0 { 63 | return -1.0 64 | } 65 | 66 | return float64(atomic.LoadInt64(&r.counter)) / float64(r.total) 67 | } 68 | 69 | func (r *RpsCounter) Count() ElementCount { 70 | return ElementCount{ 71 | Current: r.Value(), 72 | Total: r.total, 73 | Rps: r.Rps(), 74 | LastRps: r.LastRps(), 75 | } 76 | } 77 | 78 | func (r *RpsCounter) Tick() { 79 | r.mu.Lock() 80 | defer r.mu.Unlock() 81 | if r.updated { 82 | r.stop = time.Now() 83 | r.updated = false 84 | } 85 | atomic.StoreInt64(&r.lastAdd, 0) 86 | } 87 | -------------------------------------------------------------------------------- /geom/geos/serialize.go: -------------------------------------------------------------------------------- 1 | package geos 2 | 3 | /* 4 | #cgo LDFLAGS: -lgeos_c 5 | #include "geos_c.h" 6 | #include 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | func (g *Geos) FromWkt(wkt string) *Geom { 15 | wktC := C.CString(wkt) 16 | defer C.free(unsafe.Pointer(wktC)) 17 | geom := C.GEOSGeomFromWKT_r(g.v, wktC) 18 | if geom == nil { 19 | return nil 20 | } 21 | return &Geom{geom} 22 | } 23 | 24 | func (g *Geos) FromWkb(wkb []byte) *Geom { 25 | if len(wkb) == 0 { 26 | return nil 27 | } 28 | geom := C.GEOSGeomFromWKB_buf_r(g.v, (*C.uchar)(&wkb[0]), C.size_t(len(wkb))) 29 | if geom == nil { 30 | return nil 31 | } 32 | return &Geom{geom} 33 | } 34 | 35 | func (g *Geos) AsWkt(geom *Geom) string { 36 | str := C.GEOSGeomToWKT_r(g.v, geom.v) 37 | if str == nil { 38 | return "" 39 | } 40 | result := C.GoString(str) 41 | C.free(unsafe.Pointer(str)) 42 | return result 43 | } 44 | 45 | func (g *Geos) AsWkb(geom *Geom) []byte { 46 | var size C.size_t 47 | buf := C.GEOSGeomToWKB_buf_r(g.v, geom.v, &size) 48 | if buf == nil { 49 | return nil 50 | } 51 | result := C.GoBytes(unsafe.Pointer(buf), C.int(size)) 52 | C.free(unsafe.Pointer(buf)) 53 | return result 54 | } 55 | 56 | func (g *Geos) AsEwkbHex(geom *Geom) []byte { 57 | if g.wkbwriter == nil { 58 | g.wkbwriter = C.GEOSWKBWriter_create_r(g.v) 59 | if g.wkbwriter == nil { 60 | return nil 61 | } 62 | if g.srid != 0 { 63 | C.GEOSWKBWriter_setIncludeSRID_r(g.v, g.wkbwriter, C.char(1)) 64 | } 65 | } 66 | 67 | if g.srid != 0 { 68 | C.GEOSSetSRID_r(g.v, geom.v, C.int(g.srid)) 69 | } 70 | 71 | var size C.size_t 72 | buf := C.GEOSWKBWriter_writeHEX_r(g.v, g.wkbwriter, geom.v, &size) 73 | if buf == nil { 74 | return nil 75 | } 76 | result := C.GoBytes(unsafe.Pointer(buf), C.int(size)) 77 | C.free(unsafe.Pointer(buf)) 78 | 79 | return result 80 | 81 | } 82 | -------------------------------------------------------------------------------- /cache/binary/deltacoords_test.go: -------------------------------------------------------------------------------- 1 | package binary 2 | 3 | import ( 4 | "math" 5 | "math/rand" 6 | "testing" 7 | 8 | osm "github.com/omniscale/go-osm" 9 | ) 10 | 11 | type fataler interface { 12 | Fatalf(string, ...interface{}) 13 | } 14 | 15 | func compareNodes(t fataler, a []osm.Node, b []osm.Node) { 16 | if len(a) != len(b) { 17 | t.Fatalf("length did not match %d != %d", len(a), len(b)) 18 | } 19 | 20 | for i := range a { 21 | if a[i].ID != b[i].ID { 22 | t.Fatalf("id did not match %d != %d", a[i].ID, b[i].ID) 23 | } 24 | if math.Abs(a[i].Long-b[i].Long) > 1e-7 { 25 | t.Fatalf("long did not match %v != %v", a[i].Long, b[i].Long) 26 | } 27 | if math.Abs(a[i].Lat-b[i].Lat) > 1e-7 { 28 | t.Fatalf("lat did not match %v != %v", a[i].Lat, b[i].Lat) 29 | } 30 | } 31 | } 32 | 33 | var nodes []osm.Node 34 | 35 | func init() { 36 | nodes = make([]osm.Node, 64) 37 | offset := rand.Int63n(1e10) 38 | for i := range nodes { 39 | nodes[i] = osm.Node{Element: osm.Element{ID: offset + rand.Int63n(1000)}, Long: rand.Float64()*360 - 180, Lat: rand.Float64()*180 - 90} 40 | } 41 | } 42 | 43 | func TestMarshalDeltaCoords(t *testing.T) { 44 | buf := MarshalDeltaNodes(nodes, nil) 45 | nodes2, _ := UnmarshalDeltaNodes(buf, nil) 46 | 47 | compareNodes(t, nodes, nodes2) 48 | } 49 | 50 | func BenchmarkMarshalDeltaCoords(b *testing.B) { 51 | b.ReportAllocs() 52 | var buf []byte 53 | 54 | for n := 0; n < b.N; n++ { 55 | buf = MarshalDeltaNodes(nodes, buf) 56 | } 57 | nodes2, _ := UnmarshalDeltaNodes(buf, nil) 58 | 59 | compareNodes(b, nodes, nodes2) 60 | } 61 | 62 | func BenchmarkUnmarshalDeltaCoords(b *testing.B) { 63 | b.ReportAllocs() 64 | buf := MarshalDeltaNodes(nodes, nil) 65 | 66 | var nodes2 []osm.Node 67 | for n := 0; n < b.N; n++ { 68 | nodes2, _ = UnmarshalDeltaNodes(buf, nodes2) 69 | } 70 | 71 | compareNodes(b, nodes, nodes2) 72 | 73 | } 74 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/gogoproto/Makefile: -------------------------------------------------------------------------------- 1 | # Protocol Buffers for Go with Gadgets 2 | # 3 | # Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | # http://github.com/gogo/protobuf 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | regenerate: 30 | go install github.com/gogo/protobuf/protoc-gen-gogo 31 | protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:../../../../ --proto_path=../../../../:../protobuf/:. *.proto 32 | 33 | restore: 34 | cp gogo.pb.golden gogo.pb.go 35 | 36 | preserve: 37 | cp gogo.pb.go gogo.pb.golden 38 | -------------------------------------------------------------------------------- /mapping/columns_categorize.go: -------------------------------------------------------------------------------- 1 | package mapping 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | 7 | osm "github.com/omniscale/go-osm" 8 | "github.com/omniscale/imposm3/geom" 9 | "github.com/omniscale/imposm3/mapping/config" 10 | ) 11 | 12 | func MakeCategorizeInt(fieldName string, fieldType ColumnType, field config.Column) (MakeValue, error) { 13 | _values, ok := field.Args["values"] 14 | if !ok { 15 | return nil, errors.New("missing 'values' in 'args' for categorize_int") 16 | } 17 | 18 | values, ok := _values.(map[interface{}]interface{}) 19 | if !ok { 20 | return nil, errors.New("'values' in 'args' for categorize_int not a dictionary") 21 | } 22 | 23 | valuesCategory := make(map[string]int) 24 | for value, category := range values { 25 | v, ok := value.(string) 26 | if !ok { 27 | return nil, fmt.Errorf("category in values not an string key but %t", value) 28 | } 29 | c, ok := category.(int) 30 | if !ok { 31 | return nil, fmt.Errorf("category in values not an int but %t", category) 32 | } 33 | valuesCategory[v] = int(c) 34 | } 35 | 36 | _defaultCategory, ok := field.Args["default"] 37 | if !ok { 38 | return nil, errors.New("missing 'default' in categorize_int") 39 | } 40 | 41 | defaultCategoryF, ok := _defaultCategory.(int) 42 | if !ok { 43 | return nil, fmt.Errorf("'default' in 'args' for categorize_int not an int but %t", _defaultCategory) 44 | } 45 | defaultCategory := int(defaultCategoryF) 46 | 47 | makeValue := func(val string, elem *osm.Element, geom *geom.Geometry, m Match) interface{} { 48 | if val != "" { 49 | if cat, ok := valuesCategory[val]; ok { 50 | return cat 51 | } 52 | } 53 | for _, k := range field.Keys { 54 | v, ok := elem.Tags[string(k)] 55 | if !ok { 56 | continue 57 | } 58 | if cat, ok := valuesCategory[v]; ok { 59 | return cat 60 | } 61 | } 62 | 63 | return defaultCategory 64 | } 65 | 66 | return makeValue, nil 67 | } 68 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && freebsd 6 | // +build arm64,freebsd 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: nsec} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: usec} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint64(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint64(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | 59 | func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { 60 | ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)} 61 | err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) 62 | return int(ioDesc.Len), err 63 | } 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && freebsd 6 | // +build riscv64,freebsd 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: nsec} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: usec} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint64(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint64(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | 59 | func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { 60 | ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)} 61 | err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) 62 | return int(ioDesc.Len), err 63 | } 64 | -------------------------------------------------------------------------------- /cmd/imposm/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "runtime" 7 | "strings" 8 | 9 | "github.com/omniscale/imposm3" 10 | "github.com/omniscale/imposm3/cache/query" 11 | "github.com/omniscale/imposm3/config" 12 | "github.com/omniscale/imposm3/import_" 13 | "github.com/omniscale/imposm3/log" 14 | "github.com/omniscale/imposm3/stats" 15 | "github.com/omniscale/imposm3/update" 16 | ) 17 | 18 | func PrintCmds() { 19 | fmt.Fprintf(os.Stderr, "Usage: %s COMMAND [args]\n\n", os.Args[0]) 20 | fmt.Println("Available commands:") 21 | fmt.Println("\timport") 22 | fmt.Println("\tdiff") 23 | fmt.Println("\trun") 24 | fmt.Println("\tquery-cache") 25 | fmt.Println("\tversion") 26 | } 27 | 28 | func Main(usage func()) { 29 | if os.Getenv("GOMAXPROCS") == "" { 30 | runtime.GOMAXPROCS(runtime.NumCPU()) 31 | } 32 | 33 | if len(os.Args) <= 1 { 34 | usage() 35 | os.Exit(1) 36 | } 37 | 38 | if strings.HasSuffix(os.Args[0], "imposm3") { 39 | fmt.Println("WARNING: Use imposm binary instead of imposm3!") 40 | } 41 | 42 | switch os.Args[1] { 43 | case "import": 44 | opts := config.ParseImport(os.Args[2:]) 45 | if opts.Base.HTTPProfile != "" { 46 | stats.StartHTTPPProf(opts.Base.HTTPProfile) 47 | } 48 | import_.Import(opts) 49 | case "diff": 50 | opts, files := config.ParseDiffImport(os.Args[2:]) 51 | 52 | if opts.HTTPProfile != "" { 53 | stats.StartHTTPPProf(opts.HTTPProfile) 54 | } 55 | update.Diff(opts, files) 56 | case "run": 57 | opts := config.ParseRunImport(os.Args[2:]) 58 | 59 | if opts.HTTPProfile != "" { 60 | stats.StartHTTPPProf(opts.HTTPProfile) 61 | } 62 | update.Run(opts) 63 | case "query-cache": 64 | query.Query(os.Args[2:]) 65 | case "version": 66 | fmt.Println(imposm3.Version) 67 | os.Exit(0) 68 | default: 69 | usage() 70 | log.Fatalf("invalid command: '%s'", os.Args[1]) 71 | } 72 | os.Exit(0) 73 | 74 | } 75 | 76 | func main() { 77 | Main(PrintCmds) 78 | } 79 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && freebsd 6 | // +build arm,freebsd 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: int32(nsec)} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: int32(usec)} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint32(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | 59 | func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { 60 | ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)} 61 | err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) 62 | return int(ioDesc.Len), err 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/Makefile: -------------------------------------------------------------------------------- 1 | # Go support for Protocol Buffers - Google's data interchange format 2 | # 3 | # Copyright 2010 The Go Authors. All rights reserved. 4 | # https://github.com/golang/protobuf 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | install: 33 | go install 34 | 35 | test: install generate-test-pbs 36 | go test 37 | 38 | 39 | generate-test-pbs: 40 | make install 41 | make -C test_proto 42 | make -C proto3_proto 43 | make 44 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/lib_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "encoding/json" 33 | "strconv" 34 | ) 35 | 36 | type Sizer interface { 37 | Size() int 38 | } 39 | 40 | type ProtoSizer interface { 41 | ProtoSize() int 42 | } 43 | 44 | func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) { 45 | s, ok := m[value] 46 | if !ok { 47 | s = strconv.Itoa(int(value)) 48 | } 49 | return json.Marshal(s) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/url.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | nurl "net/url" 7 | "sort" 8 | "strings" 9 | ) 10 | 11 | // ParseURL no longer needs to be used by clients of this library since supplying a URL as a 12 | // connection string to sql.Open() is now supported: 13 | // 14 | // sql.Open("postgres", "postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full") 15 | // 16 | // It remains exported here for backwards-compatibility. 17 | // 18 | // ParseURL converts a url to a connection string for driver.Open. 19 | // Example: 20 | // 21 | // "postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full" 22 | // 23 | // converts to: 24 | // 25 | // "user=bob password=secret host=1.2.3.4 port=5432 dbname=mydb sslmode=verify-full" 26 | // 27 | // A minimal example: 28 | // 29 | // "postgres://" 30 | // 31 | // This will be blank, causing driver.Open to use all of the defaults 32 | func ParseURL(url string) (string, error) { 33 | u, err := nurl.Parse(url) 34 | if err != nil { 35 | return "", err 36 | } 37 | 38 | if u.Scheme != "postgres" && u.Scheme != "postgresql" { 39 | return "", fmt.Errorf("invalid connection protocol: %s", u.Scheme) 40 | } 41 | 42 | var kvs []string 43 | escaper := strings.NewReplacer(`'`, `\'`, `\`, `\\`) 44 | accrue := func(k, v string) { 45 | if v != "" { 46 | kvs = append(kvs, k+"='"+escaper.Replace(v)+"'") 47 | } 48 | } 49 | 50 | if u.User != nil { 51 | v := u.User.Username() 52 | accrue("user", v) 53 | 54 | v, _ = u.User.Password() 55 | accrue("password", v) 56 | } 57 | 58 | if host, port, err := net.SplitHostPort(u.Host); err != nil { 59 | accrue("host", u.Host) 60 | } else { 61 | accrue("host", host) 62 | accrue("port", port) 63 | } 64 | 65 | if u.Path != "" { 66 | accrue("dbname", u.Path[1:]) 67 | } 68 | 69 | q := u.Query() 70 | for k := range q { 71 | accrue(k, q.Get(k)) 72 | } 73 | 74 | sort.Strings(kvs) // Makes testing easier (not a performance concern) 75 | return strings.Join(kvs, " "), nil 76 | } 77 | -------------------------------------------------------------------------------- /vendor/gopkg.in/fsnotify.v1/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file as 2 | # Name or Organization 3 | # The email address is not required for organizations. 4 | 5 | # You can update this list using the following command: 6 | # 7 | # $ git shortlog -se | awk '{print $2 " " $3 " " $4}' 8 | 9 | # Please keep the list sorted. 10 | 11 | Aaron L 12 | Adrien Bustany 13 | Amit Krishnan 14 | Anmol Sethi 15 | Bjørn Erik Pedersen 16 | Bruno Bigras 17 | Caleb Spare 18 | Case Nelson 19 | Chris Howey 20 | Christoffer Buchholz 21 | Daniel Wagner-Hall 22 | Dave Cheney 23 | Evan Phoenix 24 | Francisco Souza 25 | Hari haran 26 | John C Barstow 27 | Kelvin Fo 28 | Ken-ichirou MATSUZAWA 29 | Matt Layher 30 | Nathan Youngman 31 | Nickolai Zeldovich 32 | Patrick 33 | Paul Hammond 34 | Pawel Knap 35 | Pieter Droogendijk 36 | Pursuit92 37 | Riku Voipio 38 | Rob Figueiredo 39 | Rodrigo Chiossi 40 | Slawek Ligus 41 | Soge Zhang 42 | Tiffany Jernigan 43 | Tilak Sharma 44 | Tom Payne 45 | Travis Cline 46 | Tudor Golubenco 47 | Vahe Khachikyan 48 | Yukang 49 | bronze1man 50 | debrando 51 | henrikedwards 52 | 铁哥 53 | -------------------------------------------------------------------------------- /geom/geos/geos_test.go: -------------------------------------------------------------------------------- 1 | package geos 2 | 3 | import ( 4 | "fmt" 5 | 6 | "testing" 7 | ) 8 | 9 | func TestFoo(t *testing.T) { 10 | _ = NewGeos() 11 | } 12 | 13 | func BenchmarkWKB(b *testing.B) { 14 | g := NewGeos() 15 | defer g.Finish() 16 | 17 | for i := 0; i < b.N; i++ { 18 | cs, _ := g.CreateCoordSeq(10, 2) 19 | for i := 0; i < 10; i++ { 20 | cs.SetXY(g, uint32(i), float64(i*10), 0) 21 | } 22 | geom, _ := cs.AsLineString(g) 23 | if g.IsValid(geom) == false { 24 | b.Fail() 25 | } 26 | g.AsWkb(geom) 27 | g.Destroy(geom) 28 | } 29 | } 30 | 31 | func TestIndexQuery(t *testing.T) { 32 | g := NewGeos() 33 | defer g.Finish() 34 | 35 | idx := g.CreateIndex() 36 | 37 | for i := 0; i < 10; i++ { 38 | p := g.FromWkt(fmt.Sprintf("POLYGON((%d 0, 10 0, 10 10, %d 10, %d 0))", i, i, i)) 39 | if p == nil { 40 | t.Fatal() 41 | } 42 | g.IndexAdd(idx, p) 43 | } 44 | 45 | if geoms := g.IndexQuery(idx, g.Point(0, 10.000001)); len(geoms) != 0 { 46 | t.Fatal(geoms) 47 | } 48 | 49 | if geoms := g.IndexQuery(idx, g.Point(9.5, 5)); len(geoms) != 10 { 50 | t.Fatal(geoms) 51 | } 52 | 53 | if geoms := g.IndexQuery(idx, g.Point(0.5, 5)); len(geoms) != 1 { 54 | t.Fatal(geoms) 55 | } 56 | if geoms := g.IndexQuery(idx, g.Point(4.5, 5)); len(geoms) != 5 { 57 | t.Fatal(geoms) 58 | } 59 | 60 | } 61 | 62 | func BenchmarkIndexQuery(b *testing.B) { 63 | g := NewGeos() 64 | defer g.Finish() 65 | 66 | idx := g.CreateIndex() 67 | for i := 0; i < 10; i++ { 68 | p := g.FromWkt(fmt.Sprintf("POLYGON((%d 0, 10 0, 10 10, %d 10, %d 0))", i, i, i)) 69 | if p == nil { 70 | b.Fatal() 71 | } 72 | g.IndexAdd(idx, p) 73 | } 74 | 75 | for i := 0; i < b.N; i++ { 76 | if geoms := g.IndexQuery(idx, g.Point(8.5, 5)); len(geoms) != 9 { 77 | b.Fatal(geoms) 78 | } 79 | } 80 | 81 | // if geoms := g.IndexQuery(idx, g.Point(0, 0)); len(geoms) != 10 { 82 | // b.Fatal(geoms) 83 | // } 84 | 85 | // if geoms := g.IndexQuery(idx, g.Point(5, 5)); len(geoms) != 10 { 86 | // b.Fatal(geoms) 87 | // } 88 | 89 | } 90 | --------------------------------------------------------------------------------