Skip to content

Commit

Permalink
update to use go-whosonfirst-spatial v0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Dec 9, 2020
1 parent 8e8143a commit b30305e
Show file tree
Hide file tree
Showing 56 changed files with 262 additions and 3,719 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ pr, err := properties.NewPropertiesReader(ctx, "sqlite://?dsn={DSN}")

### query

```
$> ./bin/query -h
Usage of ./bin/query:
-database-uri string
...
-latitude float
...
-longitude float
...
-properties value
...
-properties-uri string
...
```

For example:

```
$> ./bin/query \
-database-uri 'sqlite://?dsn=/usr/local/data/sfomuseum-data-architecture.db' \
Expand Down
10 changes: 6 additions & 4 deletions cmd/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/whosonfirst/go-whosonfirst-spatial/geo"
"github.com/whosonfirst/go-whosonfirst-spatial/properties"
"github.com/whosonfirst/go-whosonfirst-spr"
// "github.com/sfomuseum/go-flags/multi"
"github.com/sfomuseum/go-flags/multi"
"log"
)

Expand All @@ -22,17 +22,19 @@ func main() {
latitude := flag.Float64("latitude", 0.0, "...")
longitude := flag.Float64("longitude", 0.0, "...")

// var props multi.MultString
//flag.Var(&props, "properties", "...")
var props multi.MultiString
flag.Var(&props, "properties", "...")

flag.Parse()

/*
props := []string{
"wof:concordances",
"wof:hierarchy",
"sfomuseum:*",
}

*/

ctx := context.Background()
db, err := database.NewSpatialDatabase(ctx, *database_uri)

Expand Down
2 changes: 1 addition & 1 deletion database.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (r *SQLiteSpatialDatabase) PointInPolygonCandidates(ctx context.Context, co
return fc, nil
}

func (r *SQLiteSpatialDatabase) PointInPolygonCandidatesWithChannels(ctx context.Context, rsp_ch chan geojson.GeoJSONFeature, err_ch chan error, done_ch chan bool, coord *geom.Coord, filters ...filter.Filter) {
func (r *SQLiteSpatialDatabase) PointInPolygonCandidatesWithChannels(ctx context.Context, coord *geom.Coord, rsp_ch chan geojson.GeoJSONFeature, err_ch chan error, done_ch chan bool) {

defer func() {
done_ch <- true
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module github.com/whosonfirst/go-whosonfirst-spatial-sqlite
go 1.12

require (
github.com/sfomuseum/go-flags v0.4.2
github.com/skelterjohn/geom v0.0.0-20180103142417-96f3e8a219c5
github.com/tidwall/gjson v1.6.3
github.com/tidwall/gjson v1.6.4
github.com/whosonfirst/go-whosonfirst-geojson-v2 v0.12.3
github.com/whosonfirst/go-whosonfirst-log v0.1.0
github.com/whosonfirst/go-whosonfirst-spatial v0.0.4
github.com/whosonfirst/go-whosonfirst-spatial v0.0.6
github.com/whosonfirst/go-whosonfirst-spr v0.1.0
github.com/whosonfirst/go-whosonfirst-sqlite v0.1.6
github.com/whosonfirst/go-whosonfirst-sqlite-features v0.3.0
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sfomuseum/go-flags v0.4.2 h1:sDSvp0c4QZKf3pNUcpfIwshAu9U6sjsNEopmPfC329U=
github.com/sfomuseum/go-flags v0.4.2/go.mod h1:54KCZIGmvZkIOrSCHSNMvgSTKH2gJRJyISH+AiI+55w=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/skelterjohn/geom v0.0.0-20180103142417-96f3e8a219c5 h1:qQF/q/+xaKD4CAVz3zfuvpij8U4ihSGIhHfOROI4NFc=
github.com/skelterjohn/geom v0.0.0-20180103142417-96f3e8a219c5/go.mod h1:w8cQIijHlvvZM7afYlixPThHAdD+AkRFw3Mb9yQ2Y+I=
Expand All @@ -60,6 +62,8 @@ github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJH
github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
github.com/tidwall/gjson v1.6.3 h1:aHoiiem0dr7GHkW001T1SMTJ7X5PvyekH5WX0whWGnI=
github.com/tidwall/gjson v1.6.3/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
github.com/tidwall/gjson v1.6.4 h1:JKsCsJqRVFz8eYCsQ5E/ANRbK6CanAtA9IUvGsXklyo=
github.com/tidwall/gjson v1.6.4/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
Expand Down Expand Up @@ -116,6 +120,8 @@ github.com/whosonfirst/go-whosonfirst-spatial v0.0.3 h1:cJ3xCEurT/nyIKt34X79GfnR
github.com/whosonfirst/go-whosonfirst-spatial v0.0.3/go.mod h1:lVjcZgLF4JM3HpocC3nHofyX0ojtacPj7oJsUlP36pA=
github.com/whosonfirst/go-whosonfirst-spatial v0.0.4 h1:3CbSlmVjq4XB9TEjGSL39+eAMc3IvmgF0j0pB+AMVvY=
github.com/whosonfirst/go-whosonfirst-spatial v0.0.4/go.mod h1:lVjcZgLF4JM3HpocC3nHofyX0ojtacPj7oJsUlP36pA=
github.com/whosonfirst/go-whosonfirst-spatial v0.0.6 h1:vAvZyWbPBfM619VWVXLf1V4QEki4OgD6XL9H5XtnRSw=
github.com/whosonfirst/go-whosonfirst-spatial v0.0.6/go.mod h1:h8MYSHoAPrWsNA6zVOOa5vr/TRvGhf068741Z1CMOd8=
github.com/whosonfirst/go-whosonfirst-spr v0.1.0 h1:5qE629nCiucF2upy5NjPOEl9cFatsljykYY0l2JKgAk=
github.com/whosonfirst/go-whosonfirst-spr v0.1.0/go.mod h1:R8GtEVz1GVSnwwOjzcoVUd172ZK26Q7hQSLI6SGG7lM=
github.com/whosonfirst/go-whosonfirst-sqlite v0.1.5/go.mod h1:JGveApxJW/FUeB+LQxxX0U8kSunVP7NiurXP/aUo/0g=
Expand Down
9 changes: 0 additions & 9 deletions vendor/github.com/patrickmn/go-cache/CONTRIBUTORS

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/patrickmn/go-cache/LICENSE

This file was deleted.

83 changes: 0 additions & 83 deletions vendor/github.com/patrickmn/go-cache/README.md

This file was deleted.

Loading

0 comments on commit b30305e

Please sign in to comment.