From 4d9af1751bd0ded2894e244a65832c6e5f622420 Mon Sep 17 00:00:00 2001 From: sfomuseumbot Date: Mon, 6 Feb 2023 18:04:48 -0800 Subject: [PATCH] update to use whosonfirst/go-whosonfirst-export v2.7.0 --- cmd/wof-create/main.go | 2 +- cmd/wof-exportify/main.go | 6 +- go.mod | 8 +- go.sum | 16 ++-- .../go-whosonfirst-export/v2/export.go | 75 +++++++++++++------ .../v2/properties/alt.go | 22 ++++++ .../v2/properties/properties.go | 20 +++-- .../resolver.go | 13 +++- .../v3/featurecollection.go | 31 ++++++-- vendor/modules.txt | 8 +- 10 files changed, 142 insertions(+), 59 deletions(-) create mode 100644 vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/alt.go diff --git a/cmd/wof-create/main.go b/cmd/wof-create/main.go index 9495086..87559ca 100644 --- a/cmd/wof-create/main.go +++ b/cmd/wof-create/main.go @@ -20,7 +20,7 @@ import ( exportify "github.com/whosonfirst/go-whosonfirst-exportify" wof_reader "github.com/whosonfirst/go-whosonfirst-reader" hierarchy "github.com/whosonfirst/go-whosonfirst-spatial-hierarchy" - hierarchy_filter "github.com/whosonfirst/go-whosonfirst-spatial-hierarchy/filter" + hierarchy_filter "github.com/whosonfirst/go-whosonfirst-spatial-hierarchy/filter" _ "github.com/whosonfirst/go-whosonfirst-spatial-sqlite" "github.com/whosonfirst/go-whosonfirst-spatial/database" "github.com/whosonfirst/go-whosonfirst-spatial/filter" diff --git a/cmd/wof-exportify/main.go b/cmd/wof-exportify/main.go index 88d1327..346e1e5 100644 --- a/cmd/wof-exportify/main.go +++ b/cmd/wof-exportify/main.go @@ -8,7 +8,7 @@ import ( "log" "os" "path/filepath" - + "github.com/sfomuseum/go-flags/multi" "github.com/whosonfirst/go-reader" export "github.com/whosonfirst/go-whosonfirst-export/v2" @@ -88,11 +88,11 @@ func main() { } } - for _, str_id := range flag.Args(){ + for _, str_id := range flag.Args() { ids.Set(str_id) } - + ctx := context.Background() ex, err := export.NewExporter(ctx, *exporter_uri) diff --git a/go.mod b/go.mod index 4a168ae..fa16a21 100644 --- a/go.mod +++ b/go.mod @@ -10,16 +10,16 @@ require ( github.com/tidwall/gjson v1.14.4 github.com/tidwall/sjson v1.2.5 github.com/whosonfirst/go-reader v1.0.2 - github.com/whosonfirst/go-whosonfirst-export/v2 v2.6.1 + github.com/whosonfirst/go-whosonfirst-export/v2 v2.7.0 github.com/whosonfirst/go-whosonfirst-iterate-reader v1.0.0 github.com/whosonfirst/go-whosonfirst-iterate/v2 v2.3.1 github.com/whosonfirst/go-whosonfirst-reader v1.0.1 github.com/whosonfirst/go-whosonfirst-spatial v0.5.4 - github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.3.3 + github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.4.0 github.com/whosonfirst/go-whosonfirst-spatial-sqlite v0.6.4 github.com/whosonfirst/go-whosonfirst-uri v1.2.0 github.com/whosonfirst/go-whosonfirst-writer/v3 v3.0.0 - github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.0 + github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.1 github.com/whosonfirst/go-writer-jsonl/v3 v3.0.1 github.com/whosonfirst/go-writer/v3 v3.1.0 ) @@ -57,7 +57,7 @@ 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.1 // indirect - github.com/whosonfirst/go-whosonfirst-feature v0.0.25 // indirect + github.com/whosonfirst/go-whosonfirst-feature v0.0.26 // indirect github.com/whosonfirst/go-whosonfirst-flags v0.4.4 // indirect github.com/whosonfirst/go-whosonfirst-format v0.4.1 // indirect github.com/whosonfirst/go-whosonfirst-id v1.2.0 // indirect diff --git a/go.sum b/go.sum index 236ef92..273193b 100644 --- a/go.sum +++ b/go.sum @@ -126,11 +126,11 @@ github.com/whosonfirst/go-sanitize v0.1.0 h1:ygSqCnakwdzH/m8UEa15zXGDsoo5/JJeRkg github.com/whosonfirst/go-sanitize v0.1.0/go.mod h1:p/emgbafMM0p5iVAz2XWwecYPl06Tw4Jos9rhTKIrt8= github.com/whosonfirst/go-whosonfirst-crawl v0.2.1 h1:nNG7r7/4MaII/NM8Df2oqgfgVNBDoIKlseleoX1vw1Q= github.com/whosonfirst/go-whosonfirst-crawl v0.2.1/go.mod h1:MTD1TCgAkXlAtysPU98ylrz9Y5+ZCfRrsrBnRyiH/t8= -github.com/whosonfirst/go-whosonfirst-export/v2 v2.6.1 h1:u2/HPnz8OwlTIeyuFogDLKMwHVg9CgNHvy5cEEynlxU= -github.com/whosonfirst/go-whosonfirst-export/v2 v2.6.1/go.mod h1:nOKxHWpoM31OvZoNxzPCbhK+CnMgTVsXnZvYNK/jwCA= +github.com/whosonfirst/go-whosonfirst-export/v2 v2.7.0 h1:WuneueMbfjVWKh4sESLBfSFm+0rhIsgYdy0K2JLeLm4= +github.com/whosonfirst/go-whosonfirst-export/v2 v2.7.0/go.mod h1:w0O954Le3iSTHX0Ivfg6SVuzd7oUne6QmELfsfhAjZc= github.com/whosonfirst/go-whosonfirst-feature v0.0.23/go.mod h1:3cvRigFFG2a99M64lZzfy5amHacWu8Os5fXZdGjPnLM= -github.com/whosonfirst/go-whosonfirst-feature v0.0.25 h1:6s2to+aWB9Fo+IcwSvsB2UiuymJPKSe8g0TwuRasLhE= -github.com/whosonfirst/go-whosonfirst-feature v0.0.25/go.mod h1:JTauqAjTuZDfOTHxv5hFUzknF0NGgxvHTT5maTej9Co= +github.com/whosonfirst/go-whosonfirst-feature v0.0.26 h1:Dba+7aNMzxAaSVh9WzlPdrYhwT8T03cjNANjZvhcNsY= +github.com/whosonfirst/go-whosonfirst-feature v0.0.26/go.mod h1:ntGT7tkg89WyEalg+Aocl0R27tPx2wBp7Prfx9a5tUg= github.com/whosonfirst/go-whosonfirst-flags v0.4.3/go.mod h1:pL17Ryo60FH8RYaQRgfu5XnxhrNRK3x+rn03TYD6Gc8= github.com/whosonfirst/go-whosonfirst-flags v0.4.4 h1:pwUnE8btx4Po6N5+uq0IrKVF0WraY5YW3tc3saIDg3A= github.com/whosonfirst/go-whosonfirst-flags v0.4.4/go.mod h1:C9X7vQvNR/u55AfOHYUT8o7dRACWV++ZV4B0kylnIaY= @@ -154,8 +154,8 @@ github.com/whosonfirst/go-whosonfirst-sources v0.1.0 h1:JuKLa6KWke22jBfJ1pM9WQHo github.com/whosonfirst/go-whosonfirst-sources v0.1.0/go.mod h1:EUMHyGzUmqPPxlMmOp+28BFeoBdxxE0HCKRd67lkqGM= github.com/whosonfirst/go-whosonfirst-spatial v0.5.4 h1:JJO2K+xLyciyWVPmpQ/VKZqXAswYm0O4yaXohFCBp/c= github.com/whosonfirst/go-whosonfirst-spatial v0.5.4/go.mod h1:Q8SCUVV0mcGZpMB3Lq9GiBXkm6ZVS/kor4GuPQGvaCA= -github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.3.3 h1:83M/8Awd8xDfzIXcAqnAaAJHctXw/1TsXl+8EmEFUQE= -github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.3.3/go.mod h1:b455foAMOzfInf6OtcuiZ3wdvEBuSi9IhknW3fDhWIs= +github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.4.0 h1:/Avg3xQmcG5b/LQCkKMkkmQPvvUZBc6+d+kDEA4Eg0o= +github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.4.0/go.mod h1:uG6FVI2SPZxNTFWxxjMK5JjYbU1oXQXZeTZA4hC4lKY= github.com/whosonfirst/go-whosonfirst-spatial-sqlite v0.6.4 h1:rhh5BycxB99bAal4GtZ0TYdr4+3jOPc5f3ej1Rmlmoo= github.com/whosonfirst/go-whosonfirst-spatial-sqlite v0.6.4/go.mod h1:7Dy0+ECgz53IxnSomcAy9j02Fw8kMRlgXAo33UnyUDI= github.com/whosonfirst/go-whosonfirst-spr/v2 v2.3.3 h1:dc7BdkGrSKtGyIEO8jW4h6xS0DMdKANwMHFRc1+WcnM= @@ -169,8 +169,8 @@ github.com/whosonfirst/go-whosonfirst-uri v1.2.0 h1:lhmRsIhcpTr5HAo+kXKRGsSt76HT github.com/whosonfirst/go-whosonfirst-uri v1.2.0/go.mod h1:CuVygTCUpMG945MMvqHyqxvc/L5YkDaMrrVpRFr7ZxY= github.com/whosonfirst/go-whosonfirst-writer/v3 v3.0.0 h1:snhEF7nNPP1E0reD8cbwRHdFpk9WaNmljvlZF6yFvU8= github.com/whosonfirst/go-whosonfirst-writer/v3 v3.0.0/go.mod h1:zr1HVHJ0Q8/azLtC0aeu8zgeALqPxrgPgxUe1SKnDyo= -github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.0 h1:5JxJ4hUV/WN73gEWGp6EtAX9uZ/ODLkGZpK6Bxg2jXc= -github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.0/go.mod h1:R6Rg3Mlb+Swbr0177vQP8GTV2REJue6Vc//AWbm2bb8= +github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.1 h1:lejRWv24cXLD7t/CVCarkOolwjet3YAGV6vIQckqG9o= +github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.1/go.mod h1:viwrSnGMsMhpkn2i1CQTc2Cl+TbSaF1h9rbhNeBvaB8= github.com/whosonfirst/go-writer-jsonl/v3 v3.0.1 h1:ECVwoNFX0XIVLXPCa/fDeOw0Cf7dvS6IlULofNYk+Qs= github.com/whosonfirst/go-writer-jsonl/v3 v3.0.1/go.mod h1:zPIzNWCiiGt0UoNFVbt+jOCS2lLOf3oH/sb08e8UUnA= github.com/whosonfirst/go-writer/v3 v3.1.0 h1:lEZ6TIYvZb5NJ6e2OXYRM1j+MM2svKCSlb+6Vzbz+/M= diff --git a/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/export.go b/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/export.go index 718752b..9e64afd 100644 --- a/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/export.go +++ b/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/export.go @@ -3,10 +3,12 @@ package export import ( "bytes" "encoding/json" - _ "fmt" + "fmt" "io" + _ "log" "github.com/whosonfirst/go-whosonfirst-export/v2/properties" + "github.com/whosonfirst/go-whosonfirst-feature/alt" format "github.com/whosonfirst/go-whosonfirst-format" ) @@ -14,35 +16,32 @@ func Export(feature []byte, opts *Options, wr io.Writer) error { var err error - feature, err = prepareWithoutTimestamps(feature, opts) + feature, err = Prepare(feature, opts) if err != nil { - return err - } - - feature, err = prepareTimestamps(feature, opts) - - if err != nil { - return err + return fmt.Errorf("Failed to prepare feature, %w", err) } feature, err = Format(feature, opts) if err != nil { - return err + return fmt.Errorf("Failed to format feature, %w", err) } r := bytes.NewReader(feature) _, err = io.Copy(wr, r) - return err + if err != nil { + return fmt.Errorf("Failed to copy feature to writer, %w", err) + } + + return nil } // ExportChanged returns a boolean which indicates whether the file was changed // by comparing it to the `existingFeature` byte slice, before the lastmodified // timestamp is incremented. If the `feature` is identical to `existingFeature` // it doesn't write to the `io.Writer`. - func ExportChanged(feature []byte, existingFeature []byte, opts *Options, wr io.Writer) (changed bool, err error) { changed = false @@ -84,16 +83,19 @@ func ExportChanged(feature []byte, existingFeature []byte, opts *Options, wr io. } func Prepare(feature []byte, opts *Options) ([]byte, error) { + var err error feature, err = prepareWithoutTimestamps(feature, opts) + if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to prepare without timestamps, %w", err) } feature, err = prepareTimestamps(feature, opts) + if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to prepare with timestamps, %w", err) } return feature, nil @@ -107,54 +109,83 @@ func Format(feature []byte, opts *Options) ([]byte, error) { func prepareWithoutTimestamps(feature []byte, opts *Options) ([]byte, error) { + if alt.IsAlt(feature) { + return prepareWithoutTimestampsAsAlternateGeometry(feature, opts) + } + var err error feature, err = properties.EnsureWOFId(feature, opts.IDProvider) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure wof:id, %w", err) } feature, err = properties.EnsureRequired(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure required properties, %w", err) } feature, err = properties.EnsureEDTF(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure EDTF properties, %w", err) } feature, err = properties.EnsureParentId(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure parent ID, %w", err) } feature, err = properties.EnsureHierarchy(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure hierarchy, %w", err) } feature, err = properties.EnsureBelongsTo(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure belongs to, %w", err) } feature, err = properties.EnsureSupersedes(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure supersedes, %w", err) } feature, err = properties.EnsureSupersededBy(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure superseded by, %w", err) + } + + return feature, nil +} + +func prepareWithoutTimestampsAsAlternateGeometry(feature []byte, opts *Options) ([]byte, error) { + + var err error + + feature, err = properties.EnsureWOFId(feature, opts.IDProvider) + + if err != nil { + return nil, fmt.Errorf("Failed to ensure wof:id, %w", err) + } + + feature, err = properties.EnsureRequired(feature) + + if err != nil { + return nil, fmt.Errorf("Failed to ensure required properties, %w", err) + } + + feature, err = properties.EnsureSourceAltLabel(feature) + + if err != nil { + return nil, fmt.Errorf("Failed to ensure src:alt_label, %w", err) } return feature, nil diff --git a/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/alt.go b/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/alt.go new file mode 100644 index 0000000..3511ed4 --- /dev/null +++ b/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/alt.go @@ -0,0 +1,22 @@ +package properties + +import ( + "fmt" + + wof_properties "github.com/whosonfirst/go-whosonfirst-feature/properties" +) + +func EnsureSourceAltLabel(feature []byte) ([]byte, error) { + + label, err := wof_properties.AltLabel(feature) + + if err != nil { + return nil, fmt.Errorf("Failed to derive src:alt_label, %w", err) + } + + if label == "" { + return nil, fmt.Errorf("Invalid or empty src:alt_label property") + } + + return feature, nil +} diff --git a/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/properties.go b/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/properties.go index 0db7661..eeb317f 100644 --- a/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/properties.go +++ b/vendor/github.com/whosonfirst/go-whosonfirst-export/v2/properties/properties.go @@ -1,5 +1,9 @@ package properties +import ( + "fmt" +) + func EnsureRequired(feature []byte) ([]byte, error) { var err error @@ -7,19 +11,19 @@ func EnsureRequired(feature []byte) ([]byte, error) { feature, err = EnsureName(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure wof:name, %w", err) } feature, err = EnsurePlacetype(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure placetype, %w", err) } feature, err = EnsureGeom(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure geometry, %w", err) } return feature, nil @@ -32,19 +36,19 @@ func EnsureGeom(feature []byte) ([]byte, error) { feature, err = EnsureSrcGeom(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure src:geom, %w", err) } feature, err = EnsureGeomHash(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure geom:hash, %w", err) } feature, err = EnsureGeomCoords(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure geometry coordinates, %w", err) } return feature, nil @@ -57,13 +61,13 @@ func EnsureTimestamps(feature []byte) ([]byte, error) { feature, err = EnsureCreated(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure wof:created, %w", err) } feature, err = EnsureLastModified(feature) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to ensure wof:lastmodified, %w", err) } return feature, nil diff --git a/vendor/github.com/whosonfirst/go-whosonfirst-spatial-hierarchy/resolver.go b/vendor/github.com/whosonfirst/go-whosonfirst-spatial-hierarchy/resolver.go index c68a226..a3ddf46 100644 --- a/vendor/github.com/whosonfirst/go-whosonfirst-spatial-hierarchy/resolver.go +++ b/vendor/github.com/whosonfirst/go-whosonfirst-spatial-hierarchy/resolver.go @@ -27,6 +27,9 @@ type PointInPolygonHierarchyResolver struct { Database database.SpatialDatabase // Mapshaper is an optional `mapshaper.Client` instance used to derive centroids used in point-in-polygon requests. Mapshaper *mapshaper.Client + // reader is the `reader.Reader` instance used to retrieve ancestor records. By default it is the same as `Database` but can be assigned + // explicitly using the `SetReader` method. + reader reader.Reader } // PointInPolygonHierarchyResolverUpdateCallback is a function definition for a custom callback to convert 'spr' in to a dictionary of properties @@ -85,11 +88,17 @@ func NewPointInPolygonHierarchyResolver(ctx context.Context, spatial_db database t := &PointInPolygonHierarchyResolver{ Database: spatial_db, Mapshaper: ms_client, + reader: spatial_db, } return t, nil } +// SetReader assigns 'r' as the internal `reader.Reader` instance used to retrieve ancestor records when resolving a hierarchy. +func (t *PointInPolygonHierarchyResolver) SetReader(r reader.Reader) { + t.reader = r +} + // PointInPolygonAndUpdate will ... func (t *PointInPolygonHierarchyResolver) PointInPolygonAndUpdate(ctx context.Context, inputs *filter.SPRInputs, results_cb hierarchy_filter.FilterSPRResultsFunc, update_cb PointInPolygonHierarchyResolverUpdateCallback, body []byte) (bool, []byte, error) { @@ -99,13 +108,13 @@ func (t *PointInPolygonHierarchyResolver) PointInPolygonAndUpdate(ctx context.Co return false, nil, fmt.Errorf("Failed to perform point in polygon operation, %w", err) } - parent_spr, err := results_cb(ctx, t.Database, body, possible) + parent_spr, err := results_cb(ctx, t.reader, body, possible) if err != nil { return false, nil, fmt.Errorf("Results callback failed, %w", err) } - to_assign, err := update_cb(ctx, t.Database, parent_spr) + to_assign, err := update_cb(ctx, t.reader, parent_spr) if err != nil { return false, nil, fmt.Errorf("Update callback failed, %w", err) diff --git a/vendor/github.com/whosonfirst/go-writer-featurecollection/v3/featurecollection.go b/vendor/github.com/whosonfirst/go-writer-featurecollection/v3/featurecollection.go index b871ae6..3e0f4e3 100644 --- a/vendor/github.com/whosonfirst/go-writer-featurecollection/v3/featurecollection.go +++ b/vendor/github.com/whosonfirst/go-writer-featurecollection/v3/featurecollection.go @@ -29,6 +29,7 @@ type FeatureCollectionWriter struct { writer writer.Writer mu *sync.RWMutex count int64 + closed bool } func NewFeatureCollectionWriter(ctx context.Context, uri string) (writer.Writer, error) { @@ -36,7 +37,7 @@ func NewFeatureCollectionWriter(ctx context.Context, uri string) (writer.Writer, u, err := url.Parse(uri) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to parse URI, %w", err) } q := u.Query() @@ -50,7 +51,7 @@ func NewFeatureCollectionWriter(ctx context.Context, uri string) (writer.Writer, wr, err := writer.NewWriter(ctx, wr_uri) if err != nil { - return nil, err + return nil, fmt.Errorf("Failed to create writer for '%s', %w", wr_uri, err) } mu := new(sync.RWMutex) @@ -88,13 +89,13 @@ func (fc *FeatureCollectionWriter) Write(ctx context.Context, key string, fh io. body, err := io.ReadAll(fh) if err != nil { - return 0, err + return 0, fmt.Errorf("Failed to read filehandle, %w", err) } _, err = geojson.UnmarshalFeature(body) if err != nil { - return 0, err + return 0, fmt.Errorf("Failed to unmarshal GeoJSON feature, %w", err) } fc.mu.Lock() @@ -114,7 +115,13 @@ func (fc *FeatureCollectionWriter) Write(ctx context.Context, key string, fh io. sr := strings.NewReader(preamble + string(body)) - return fc.writer.Write(ctx, key, sr) + i, err := fc.writer.Write(ctx, key, sr) + + if err != nil { + return 0, fmt.Errorf("Failed write body, %w", err) + } + + return i, nil } func (fc *FeatureCollectionWriter) WriterURI(ctx context.Context, str_uri string) string { @@ -127,19 +134,29 @@ func (fc *FeatureCollectionWriter) Flush(ctx context.Context) error { func (fc *FeatureCollectionWriter) Close(ctx context.Context) error { - body := `]}` + if fc.closed { + return fmt.Errorf("Feature collection writer has already been closed") + } + + fc.mu.Lock() + defer fc.mu.Unlock() + + var body string if atomic.LoadInt64(&fc.count) == 0 { body = `{"type":"FeatureCollection", "features":[]}` + } else { + body = `]}` } sr := strings.NewReader(body) _, err := fc.writer.Write(ctx, "", sr) if err != nil { - return err + return fmt.Errorf("Failed to write closure, %w", err) } + fc.closed = true return nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index a259a99..252a41c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -131,11 +131,11 @@ github.com/whosonfirst/go-sanitize # github.com/whosonfirst/go-whosonfirst-crawl v0.2.1 ## explicit; go 1.12 github.com/whosonfirst/go-whosonfirst-crawl -# github.com/whosonfirst/go-whosonfirst-export/v2 v2.6.1 +# github.com/whosonfirst/go-whosonfirst-export/v2 v2.7.0 ## explicit; go 1.18 github.com/whosonfirst/go-whosonfirst-export/v2 github.com/whosonfirst/go-whosonfirst-export/v2/properties -# github.com/whosonfirst/go-whosonfirst-feature v0.0.25 +# github.com/whosonfirst/go-whosonfirst-feature v0.0.26 ## explicit; go 1.18 github.com/whosonfirst/go-whosonfirst-feature/alt github.com/whosonfirst/go-whosonfirst-feature/geometry @@ -182,7 +182,7 @@ github.com/whosonfirst/go-whosonfirst-spatial/database github.com/whosonfirst/go-whosonfirst-spatial/filter github.com/whosonfirst/go-whosonfirst-spatial/flags github.com/whosonfirst/go-whosonfirst-spatial/geo -# github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.3.3 +# github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.4.0 ## explicit; go 1.18 github.com/whosonfirst/go-whosonfirst-spatial-hierarchy github.com/whosonfirst/go-whosonfirst-spatial-hierarchy/filter @@ -205,7 +205,7 @@ github.com/whosonfirst/go-whosonfirst-uri # github.com/whosonfirst/go-whosonfirst-writer/v3 v3.0.0 ## explicit; go 1.18 github.com/whosonfirst/go-whosonfirst-writer/v3 -# github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.0 +# github.com/whosonfirst/go-writer-featurecollection/v3 v3.0.1 ## explicit; go 1.18 github.com/whosonfirst/go-writer-featurecollection/v3 # github.com/whosonfirst/go-writer-jsonl/v3 v3.0.1