Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
ensure IsPrincipalWOFRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Aug 21, 2019
1 parent 44c4a72 commit 259f1da
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
15 changes: 15 additions & 0 deletions index.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"github.com/whosonfirst/go-whosonfirst-geojson-v2/feature"
wof_index "github.com/whosonfirst/go-whosonfirst-index"
wof_utils "github.com/whosonfirst/go-whosonfirst-index/utils"
"github.com/whosonfirst/go-whosonfirst-sqlite"
sql_index "github.com/whosonfirst/go-whosonfirst-sqlite-index"
"github.com/whosonfirst/warning"
Expand All @@ -22,12 +23,26 @@ func NewDefaultSQLiteFeaturesIndexer(db sqlite.Database, to_index []sqlite.Table
case <-ctx.Done():
return nil, nil
default:

path, err := wof_index.PathForContext(ctx)

if err != nil {
return nil, err
}

// skip alt files - see below for details
// (20190821/thisisaaronland)

ok, err := wof_utils.IsPrincipalWOFRecord(fh, ctx)

if err != nil {
return nil, err
}

if !ok {
return nil, nil
}

closer := ioutil.NopCloser(fh)

i, err := feature.LoadWOFFeatureFromReader(closer)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ github.com/whosonfirst/go-whosonfirst-geojson-v2/utils
github.com/whosonfirst/go-whosonfirst-hash
# github.com/whosonfirst/go-whosonfirst-index v0.1.2
github.com/whosonfirst/go-whosonfirst-index
github.com/whosonfirst/go-whosonfirst-index/utils
# github.com/whosonfirst/go-whosonfirst-log v0.1.0
github.com/whosonfirst/go-whosonfirst-log
# github.com/whosonfirst/go-whosonfirst-names v0.1.0
Expand Down

0 comments on commit 259f1da

Please sign in to comment.