Skip to content

Commit

Permalink
code: remove unused functions/conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
olt committed Nov 21, 2017
1 parent 8d86949 commit 3ac986a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 52 deletions.
6 changes: 0 additions & 6 deletions cache/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ import (
"github.com/omniscale/imposm3/element"
)

type byInt64 []int64

func (a byInt64) Len() int { return len(a) }
func (a byInt64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byInt64) Less(i, j int) bool { return a[i] < a[j] }

type DiffCache struct {
Dir string
Coords *CoordsRefIndex // Stores which ways a coord references
Expand Down
8 changes: 0 additions & 8 deletions database/postgis/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ func (t *simpleColumnType) GeneralizeSql(colSpec *ColumnSpec, spec *GeneralizedT
return "\"" + colSpec.Name + "\""
}

type hstoreColumnType struct {
simpleColumnType
}

func (t *hstoreColumnType) PrepareInsertSql(i int, spec *TableSpec) string {
return fmt.Sprintf("$%d::hstore", i)
}

type geometryType struct {
name string
}
Expand Down
6 changes: 0 additions & 6 deletions expire/tilelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ type tileKey struct {
Y uint32
}

type tile struct {
x uint32
y uint32
z uint32
}

func NewTileList(zoom int, out string) *TileList {
return &TileList{
tiles: make(map[tileKey]struct{}),
Expand Down
10 changes: 0 additions & 10 deletions geom/geojson/geojson.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ type object struct {
Properties map[string]interface{} `json:"properties"`
}

type geometry struct {
Type string `json:"type"`
Coordinates []interface{} `json:"coordinates"`
}

type Point struct {
Long float64
Lat float64
Expand Down Expand Up @@ -72,11 +67,6 @@ func newLineStringFromCoords(coords []interface{}) (LineString, error) {

type Polygon []LineString

type polygonFeature struct {
polygon Polygon
properties map[string]string
}

type Feature struct {
Polygon Polygon
Properties map[string]string
Expand Down
12 changes: 0 additions & 12 deletions mapping/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,3 @@ func MakeSuffixReplace(columnName string, columnType ColumnType, column config.C

return suffixReplace, nil
}

func asHex(b []byte) string {
digits := "0123456789ABCDEF"
buf := make([]byte, 0, len(b)*2)
n := len(b)

for i := 0; i < n; i++ {
c := b[i]
buf = append(buf, digits[c>>4], digits[c&0xF])
}
return string(buf)
}
4 changes: 2 additions & 2 deletions mapping/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ func (m *Mapping) addFilters(filters tableElementFilters) {
log.Print("warn: exclude_tags filter is deprecated and will be removed. See require and reject filter.")
for _, filterKeyVal := range *t.Filters.ExcludeTags {
// Convert `exclude_tags`` filter to `reject` filter !
keyname := string(filterKeyVal[0])
keyname := filterKeyVal[0]
vararr := []config.OrderedValue{
{
Value: config.Value(filterKeyVal[1]),
Order: 1,
},
}
filters[name] = append(filters[name], makeFiltersFunction(name, false, true, string(keyname), vararr))
filters[name] = append(filters[name], makeFiltersFunction(name, false, true, keyname, vararr))

}
}
Expand Down
8 changes: 0 additions & 8 deletions parser/pbf/pbf.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ import (

const coord_factor float64 = 11930464.7083 // ((2<<31)-1)/360.0

func coordToInt(coord float64) uint32 {
return uint32((coord + 180.0) * coord_factor)
}

func intToCoord(coord uint32) float64 {
return float64((float64(coord) / coord_factor) - 180.0)
}

func readDenseNodes(
dense *osmpbf.DenseNodes,
block *osmpbf.PrimitiveBlock,
Expand Down

0 comments on commit 3ac986a

Please sign in to comment.