[#782] locode: Simplify build quadtree
Some checks failed
Tests and linters / Lint (pull_request) Failing after 10s
DCO action / DCO (pull_request) Successful in 2m34s
Vulncheck / Vulncheck (pull_request) Failing after 3m7s
Build / Build Components (1.21) (pull_request) Successful in 3m57s
Tests and linters / Staticcheck (pull_request) Successful in 4m43s
Build / Build Components (1.20) (pull_request) Successful in 5m35s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m8s
Tests and linters / Tests (1.20) (pull_request) Successful in 8m20s
Tests and linters / Tests with -race (pull_request) Successful in 8m14s
Some checks failed
Tests and linters / Lint (pull_request) Failing after 10s
DCO action / DCO (pull_request) Successful in 2m34s
Vulncheck / Vulncheck (pull_request) Failing after 3m7s
Build / Build Components (1.21) (pull_request) Successful in 3m57s
Tests and linters / Staticcheck (pull_request) Successful in 4m43s
Build / Build Components (1.20) (pull_request) Successful in 5m35s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m8s
Tests and linters / Tests (1.20) (pull_request) Successful in 8m20s
Tests and linters / Tests with -race (pull_request) Successful in 8m14s
Signed-off-by: nesterfifa <vemeyzer@gmail.com>
This commit is contained in:
parent
91fe0d3531
commit
f31b4c1a7b
1 changed files with 12 additions and 11 deletions
|
@ -92,17 +92,18 @@ func (db *DB) buildQuadtree() error {
|
|||
})
|
||||
|
||||
for _, feature := range db.features {
|
||||
if multiPolygon, ok := feature.Geometry.(orb.MultiPolygon); ok {
|
||||
for _, polygon := range multiPolygon {
|
||||
newFeature := geojson.NewFeature(polygon)
|
||||
newFeature.Properties = feature.Properties.Clone()
|
||||
err := db.tree.Add(newFeature)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else if _, ok := feature.Geometry.(orb.Polygon); ok {
|
||||
err := db.tree.Add(feature)
|
||||
multiPolygon := make(orb.MultiPolygon, 0)
|
||||
|
||||
if polygon, ok := feature.Geometry.(orb.Polygon); ok {
|
||||
multiPolygon = append(multiPolygon, polygon)
|
||||
} else {
|
||||
multiPolygon = feature.Geometry.(orb.MultiPolygon)
|
||||
}
|
||||
|
||||
for _, polygon := range multiPolygon {
|
||||
newFeature := geojson.NewFeature(polygon)
|
||||
newFeature.Properties = feature.Properties.Clone()
|
||||
err := db.tree.Add(newFeature)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue