diff --git a/go.mod b/go.mod index 7f3d1ed0..ae9f3aaa 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/tidwall/buntdb v1.1.0 github.com/tidwall/cities v0.0.0-20190730194520-dbe1ae0b862c // indirect github.com/tidwall/geoindex v1.1.0 - github.com/tidwall/geojson v1.1.10 + github.com/tidwall/geojson v1.1.12 github.com/tidwall/gjson v1.3.2 github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb // indirect github.com/tidwall/lotsa v0.0.0-20180225195211-a03631ac7f1c // indirect diff --git a/go.sum b/go.sum index 8fa5c3e8..720fe160 100644 --- a/go.sum +++ b/go.sum @@ -63,6 +63,8 @@ github.com/tidwall/geojson v1.1.8 h1:n/WT/PG0OEHrxUJQoeqkupWDt3pwbHMynl6OF9xKIM0 github.com/tidwall/geojson v1.1.8/go.mod h1:tBjfxeALRFLc25LLpjtWzy2nIrNmW1ze1EAhLtd8+QQ= github.com/tidwall/geojson v1.1.10 h1:ALzsrTn62pq65DudSQpYDjjCUaq6dP1XQm51GVYgJyo= github.com/tidwall/geojson v1.1.10/go.mod h1:tBjfxeALRFLc25LLpjtWzy2nIrNmW1ze1EAhLtd8+QQ= +github.com/tidwall/geojson v1.1.12 h1:Ol83kqH2zeYJHP16xteZtr8VRukIXeF/TqVvJodM41M= +github.com/tidwall/geojson v1.1.12/go.mod h1:tBjfxeALRFLc25LLpjtWzy2nIrNmW1ze1EAhLtd8+QQ= github.com/tidwall/gjson v1.3.2 h1:+7p3qQFaH3fOMXAJSrdZwGKcOO/lYdGS0HqGhPqDdTI= github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb h1:5NSYaAdrnblKByzd7XByQEJVT8+9v0W/tIY0Oo4OwrE= diff --git a/vendor/github.com/tidwall/geojson/feature.go b/vendor/github.com/tidwall/geojson/feature.go index 518127bc..89c7e695 100644 --- a/vendor/github.com/tidwall/geojson/feature.go +++ b/vendor/github.com/tidwall/geojson/feature.go @@ -110,7 +110,7 @@ func (g *Feature) Within(obj Object) bool { // Contains ... func (g *Feature) Contains(obj Object) bool { - return g.base.Within(obj) + return g.base.Contains(obj) } // WithinRect ... @@ -180,7 +180,8 @@ func parseJSONFeature(keys *parseKeys, opts *ParseOptions) (Object, error) { if point, ok := g.base.(*Point); ok { if g.extra != nil { members := g.extra.members - if gjson.Get(members, "properties.type").String() == "Circle" { + if !opts.DisableCircleType && + gjson.Get(members, "properties.type").String() == "Circle" { // Circle radius := gjson.Get(members, "properties.radius").Float() units := gjson.Get(members, "properties.radius_units").String() diff --git a/vendor/github.com/tidwall/geojson/object.go b/vendor/github.com/tidwall/geojson/object.go index 05db9261..6972575b 100644 --- a/vendor/github.com/tidwall/geojson/object.go +++ b/vendor/github.com/tidwall/geojson/object.go @@ -95,6 +95,9 @@ type ParseOptions struct { // type when a geojson point only consists of an 2D x/y coord and no extra // json members. AllowSimplePoints bool + // DisableCircleType disables the special Circle syntax that is unique to + // only Tile38. + DisableCircleType bool } // DefaultParseOptions ... @@ -104,6 +107,7 @@ var DefaultParseOptions = &ParseOptions{ IndexGeometryKind: geometry.QuadTree, RequireValid: false, AllowSimplePoints: false, + DisableCircleType: false, } // Parse a GeoJSON object diff --git a/vendor/modules.txt b/vendor/modules.txt index 198e6c86..34c3c6f9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -81,7 +81,7 @@ github.com/tidwall/buntdb # github.com/tidwall/geoindex v1.1.0 github.com/tidwall/geoindex github.com/tidwall/geoindex/child -# github.com/tidwall/geojson v1.1.10 +# github.com/tidwall/geojson v1.1.12 github.com/tidwall/geojson github.com/tidwall/geojson/geo github.com/tidwall/geojson/geometry