Skip to content

Commit

Permalink
Update module path to github.com/reearth/orb
Browse files Browse the repository at this point in the history
  • Loading branch information
hexaforce committed Jan 23, 2025
1 parent 1568d95 commit f6f70ce
Show file tree
Hide file tree
Showing 131 changed files with 3,862 additions and 246 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: golangci-lint
on:
push:
branches:
- master
- main
pull_request:
permissions:
contents: read
Expand All @@ -11,11 +11,11 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: 1.19
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: v1.50
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: CI

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: '1.19'
go-version: '1.21'

- name: Run build
run: go build .
Expand Down
10 changes: 6 additions & 4 deletions clip/clip.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package clip

import (
"github.com/paulmach/orb"
"github.com/reearth/orb"
)

// Code based on https://github.com/mapbox/lineclip
Expand Down Expand Up @@ -150,9 +150,11 @@ func ring(box orb.Bound, in orb.Ring) orb.Ring {
}

// bitCode returns the point position relative to the bbox:
// left mid right
// top 1001 1000 1010
// mid 0001 0000 0010
//
// left mid right
// top 1001 1000 1010
// mid 0001 0000 0010
//
// bottom 0101 0100 0110
func bitCode(b orb.Bound, p orb.Point) int {
code := 0
Expand Down
2 changes: 1 addition & 1 deletion clip/clip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func TestInternalLine(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions clip/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package clip_test
import (
"fmt"

"github.com/paulmach/orb"
"github.com/paulmach/orb/clip"
"github.com/reearth/orb"
"github.com/reearth/orb/clip"
)

func ExampleGeometry() {
Expand All @@ -20,5 +20,5 @@ func ExampleGeometry() {

fmt.Println(clipped)
// Output:
// [[[0 10] [10 10] [10 0]] [[20 0] [20 10] [30 10]] [[30 20] [20 20] [20 30]] [[10 30] [10 20] [5 20] [0 20]]]
// [[[0 10 0] [10 10 0] [10 0 0]] [[20 0 0] [20 10 0] [30 10 0]] [[30 20 0] [20 20 0] [20 30 0]] [[10 30 0] [10 20 0] [5 20 0] [0 20 0]]]
}
2 changes: 1 addition & 1 deletion clip/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"math"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

// Geometry will clip the geometry to the bounding box using the
Expand Down
2 changes: 1 addition & 1 deletion clip/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package clip
import (
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func TestGeometry(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion clip/smartclip/around_bound.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package smartclip
import (
"sort"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

// aroundBound will connect the endpoints of the linestring provided
Expand Down
2 changes: 1 addition & 1 deletion clip/smartclip/around_bound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func TestNexts(t *testing.T) {
Expand Down
14 changes: 8 additions & 6 deletions clip/smartclip/smart.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"sort"

"github.com/paulmach/orb"
"github.com/paulmach/orb/clip"
"github.com/reearth/orb"
"github.com/reearth/orb/clip"
)

// Geometry will do a smart more involved clipping and wrapping of the geometry.
Expand Down Expand Up @@ -338,11 +338,13 @@ func smartWrap(box orb.Bound, input []orb.LineString, o orb.Orientation) orb.Mul

const notOnSide = 0xFF

// 4
// +-+
// 4
// +-+
//
// 1 | | 3
// +-+
// 2
//
// +-+
// 2
func pointSide(b orb.Bound, p orb.Point) uint8 {
if p[1] == b.Max[1] {
return 4
Expand Down
2 changes: 1 addition & 1 deletion clip/smartclip/smart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func TestSmartClip(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion clip/smartclip/util_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package smartclip

import (
"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var flips = []string{
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package ewkb
import (
"testing"

"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/internal/wkbcommon"
"github.com/reearth/orb"
"github.com/reearth/orb/encoding/internal/wkbcommon"
)

func TestCollection(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/ewkb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"errors"
"io"

"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/internal/wkbcommon"
"github.com/reearth/orb"
"github.com/reearth/orb/encoding/internal/wkbcommon"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/ewkb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"io/ioutil"

Check failure on line 7 in encoding/ewkb/ewkb_test.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"testing"

"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/internal/wkbcommon"
"github.com/reearth/orb"
"github.com/reearth/orb/encoding/internal/wkbcommon"
)

func TestMarshal(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/line_string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package ewkb
import (
"testing"

"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/internal/wkbcommon"
"github.com/reearth/orb"
"github.com/reearth/orb/encoding/internal/wkbcommon"
)

func TestLineString(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/point_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package ewkb
import (
"testing"

"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/internal/wkbcommon"
"github.com/reearth/orb"
"github.com/reearth/orb/encoding/internal/wkbcommon"
)

func TestPoint(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/polygon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package ewkb
import (
"testing"

"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/internal/wkbcommon"
"github.com/reearth/orb"
"github.com/reearth/orb/encoding/internal/wkbcommon"
)

func TestPolygon(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"database/sql/driver"
"encoding/binary"

"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/internal/wkbcommon"
"github.com/reearth/orb"
"github.com/reearth/orb/encoding/internal/wkbcommon"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion encoding/ewkb/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wkbcommon
import (
"io"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func readCollection(r io.Reader, order byteOrder, buf []byte) (orb.Collection, error) {
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wkbcommon
import (
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/line_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"math"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func unmarshalLineString(order byteOrder, data []byte) (orb.LineString, error) {
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/line_string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wkbcommon
import (
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"math"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func unmarshalPoints(order byteOrder, data []byte) ([]orb.Point, error) {
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/point_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wkbcommon
import (
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/polygon.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"math"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func unmarshalPolygon(order byteOrder, data []byte) (orb.Polygon, error) {
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/polygon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wkbcommon
import (
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"io"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wkbcommon
import (
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

var SRID = []byte{215, 15, 0, 0}
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/wkb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/binary"
"io"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

// byteOrder represents little or big endian encoding.
Expand Down
2 changes: 1 addition & 1 deletion encoding/internal/wkbcommon/wkb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/binary"
"testing"

"github.com/paulmach/orb"
"github.com/reearth/orb"
)

func TestMarshal(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions encoding/mvt/clip.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mvt

import (
"github.com/paulmach/orb"
"github.com/paulmach/orb/clip"
"github.com/reearth/orb"
"github.com/reearth/orb/clip"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions encoding/mvt/clip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

"github.com/paulmach/orb"
"github.com/paulmach/orb/geojson"
"github.com/reearth/orb"
"github.com/reearth/orb/geojson"
)

func TestLayersClip(t *testing.T) {
Expand Down
Loading

0 comments on commit f6f70ce

Please sign in to comment.