Skip to content

Commit

Permalink
Update to reflect changes to go-whosonfirst-spatial and go-whosonfirs…
Browse files Browse the repository at this point in the history
…t-spatial-www (#13)

* update to reflect changes to go-whosonfirst-spatial-www

* add server Makefile target

* update vendor deps

---------

Co-authored-by: sfomuseumbot <sfomuseumbot@localhost>
  • Loading branch information
thisisaaronland and sfomuseumbot authored May 18, 2024
1 parent 612f33a commit d6aafe4
Show file tree
Hide file tree
Showing 564 changed files with 18,984 additions and 24,821 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*~
bin
*.db
!fixtures/*.db
!fixtures/*.db
go.work*
work
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@ GOMOD=$(shell test -f "go.work" && echo "readonly" || echo "vendor")
LDFLAGS=-s -w

cli:
go build -ldflags="$(LDFLAGS)" -mod $(GOMOD) -o bin/query cmd/query/main.go
go build -ldflags="$(LDFLAGS)" -mod $(GOMOD) -o bin/server cmd/server/main.go
go build -ldflags="$(LDFLAGS)" -mod $(GOMOD) -o bin/update-hierarchies cmd/update-hierarchies/main.go
go build -ldflags="$(LDFLAGS)" -mod $(GOMOD) -o bin/pip cmd/pip/main.go

# For example:
# make server DSN=modernc:///PATH/TO/SQLITE.db

server:
go run cmd/server/main.go \
-enable-www \
-spatial-database-uri "sqlite://?dsn=$(DSN)" \
-map-provider leaflet \
-leaflet-tile-url "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
11 changes: 3 additions & 8 deletions cmd/query/main.go → cmd/pip/main.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
package main

import (
_ "github.com/whosonfirst/go-whosonfirst-spatial-sqlite"
)

import (
"context"
"log"

"github.com/whosonfirst/go-whosonfirst-spatial/app/pip"
_ "github.com/whosonfirst/go-whosonfirst-spatial-sqlite"
"github.com/whosonfirst/go-whosonfirst-spatial/app/pip"
)

func main() {

ctx := context.Background()

logger := log.Default()

err := pip.Run(ctx, logger)

if err != nil {
logger.Fatalf("Failed to run PIP application, %v", err)
logger.Fatal(err)
}

}
9 changes: 6 additions & 3 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ package main

import (
"context"
"log/slog"
"os"

_ "github.com/whosonfirst/go-whosonfirst-spatial-sqlite"
"github.com/whosonfirst/go-whosonfirst-spatial-www/app/server"
"log"
)

func main() {

ctx := context.Background()
logger := log.Default()
logger := slog.Default()

err := server.Run(ctx, logger)

if err != nil {
logger.Fatal(err)
logger.Error("Failed to run server", "error", err)
os.Exit(1)
}
}
21 changes: 21 additions & 0 deletions cmd/update-hierarchies/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package main

import (
"context"
"log"

_ "github.com/whosonfirst/go-whosonfirst-spatial-sqlite"
"github.com/whosonfirst/go-whosonfirst-spatial/app/hierarchy/update"
)

func main() {

ctx := context.Background()
logger := log.Default()

err := update.Run(ctx, logger)

if err != nil {
logger.Fatal(err)
}
}
40 changes: 28 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/whosonfirst/go-whosonfirst-spatial-sqlite

go 1.22.1
go 1.22.3

require (
github.com/aaronland/go-sqlite-modernc v0.0.3
Expand All @@ -10,8 +10,8 @@ require (
github.com/pkg/errors v0.9.1
github.com/whosonfirst/go-ioutil v1.0.2
github.com/whosonfirst/go-reader v1.0.2
github.com/whosonfirst/go-whosonfirst-spatial v0.7.4
github.com/whosonfirst/go-whosonfirst-spatial-www v0.0.50
github.com/whosonfirst/go-whosonfirst-spatial v0.8.0
github.com/whosonfirst/go-whosonfirst-spatial-www v0.1.0
github.com/whosonfirst/go-whosonfirst-spr/v2 v2.3.7
github.com/whosonfirst/go-whosonfirst-sqlite-features/v2 v2.0.3
github.com/whosonfirst/go-whosonfirst-sqlite-spr/v2 v2.0.0
Expand All @@ -22,7 +22,9 @@ require (
require (
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/RoaringBitmap/roaring v1.5.0 // indirect
github.com/aaronland/go-artisanal-integers v0.9.1 // indirect
github.com/aaronland/go-aws-session v0.2.1 // indirect
github.com/aaronland/go-brooklynintegers-api v1.2.7 // indirect
github.com/aaronland/go-http-bootstrap v0.4.0 // indirect
github.com/aaronland/go-http-leaflet v0.4.0 // indirect
github.com/aaronland/go-http-maps v0.3.2 // indirect
Expand All @@ -36,10 +38,15 @@ require (
github.com/aaronland/go-log/v2 v2.0.0 // indirect
github.com/aaronland/go-pagination v0.2.0 // indirect
github.com/aaronland/go-pagination-sql v0.2.0 // indirect
github.com/aaronland/go-pool/v2 v2.0.0 // indirect
github.com/aaronland/go-roster v1.0.0 // indirect
github.com/aaronland/go-string v1.0.0 // indirect
github.com/aaronland/go-uid v0.4.0 // indirect
github.com/aaronland/go-uid-artisanal v0.0.4 // indirect
github.com/aaronland/go-uid-proxy v0.1.1 // indirect
github.com/aaronland/go-uid-whosonfirst v0.0.4 // indirect
github.com/akrylysov/algnhsa v1.1.0 // indirect
github.com/aws/aws-lambda-go v1.46.0 // indirect
github.com/aws/aws-lambda-go v1.47.0 // indirect
github.com/aws/aws-sdk-go v1.45.12 // indirect
github.com/aws/aws-sdk-go-v2 v1.20.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.32 // indirect
Expand All @@ -54,7 +61,9 @@ require (
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.21.1 // indirect
github.com/aws/smithy-go v1.14.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/bits-and-blooms/bitset v1.2.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/dominikbraun/graph v0.23.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand All @@ -71,21 +80,22 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/natefinch/atomic v1.0.1 // indirect
github.com/paulmach/go.geojson v1.4.0 // indirect
github.com/protomaps/go-pmtiles v1.10.5 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/rs/cors v1.11.0 // indirect
github.com/schollz/progressbar/v3 v3.13.1 // indirect
github.com/sfomuseum/go-edtf v1.1.1 // indirect
github.com/sfomuseum/go-flags v0.10.0 // indirect
github.com/sfomuseum/go-http-auth v0.11.0 // indirect
github.com/sfomuseum/go-http-protomaps v0.2.0 // indirect
github.com/sfomuseum/go-http-rollup v0.0.2 // indirect
github.com/sfomuseum/go-sfomuseum-mapshaper v0.0.3 // indirect
github.com/sfomuseum/go-sfomuseum-pmtiles v1.2.0 // indirect
github.com/sfomuseum/go-template v1.8.0 // indirect
github.com/sfomuseum/go-timings v1.2.1 // indirect
Expand All @@ -102,31 +112,37 @@ require (
github.com/whosonfirst/go-rfc-5646 v0.1.0 // indirect
github.com/whosonfirst/go-sanitize v0.1.0 // indirect
github.com/whosonfirst/go-whosonfirst-crawl v0.2.2 // indirect
github.com/whosonfirst/go-whosonfirst-export/v2 v2.7.1 // indirect
github.com/whosonfirst/go-whosonfirst-feature v0.0.27 // indirect
github.com/whosonfirst/go-whosonfirst-flags v0.5.1 // indirect
github.com/whosonfirst/go-whosonfirst-iterate/v2 v2.3.4 // indirect
github.com/whosonfirst/go-whosonfirst-format v0.4.1 // indirect
github.com/whosonfirst/go-whosonfirst-id v1.2.2 // indirect
github.com/whosonfirst/go-whosonfirst-iterate/v2 v2.4.1 // indirect
github.com/whosonfirst/go-whosonfirst-names v0.1.0 // indirect
github.com/whosonfirst/go-whosonfirst-placetypes v0.7.2 // indirect
github.com/whosonfirst/go-whosonfirst-reader v1.0.2 // indirect
github.com/whosonfirst/go-whosonfirst-sources v0.1.0 // indirect
github.com/whosonfirst/go-whosonfirst-spr-geojson v0.0.8 // indirect
github.com/whosonfirst/go-whosonfirst-sql v0.0.3 // indirect
github.com/whosonfirst/go-whosonfirst-writer/v3 v3.1.0 // indirect
github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.0-20220916180959-42588e308a3e // indirect
github.com/whosonfirst/walk v0.0.2 // indirect
github.com/whosonfirst/warning v0.1.1 // indirect
go.mongodb.org/mongo-driver v1.11.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/ratelimit v0.3.0 // indirect
gocloud.dev v0.34.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.10.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.142.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.33.0 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
modernc.org/cc/v3 v3.40.0 // indirect
Expand Down
Loading

0 comments on commit d6aafe4

Please sign in to comment.