do not auto destroy BoundsPolygon
parent
34cf674fa0
commit
122bfc4f31
|
@ -160,7 +160,6 @@ func (this *Geos) BoundsPolygon(bounds Bounds) *Geom {
|
||||||
// geom inherited by Polygon, no destroy
|
// geom inherited by Polygon, no destroy
|
||||||
|
|
||||||
geom = this.Polygon(geom, nil)
|
geom = this.Polygon(geom, nil)
|
||||||
this.DestroyLater(geom)
|
|
||||||
return geom
|
return geom
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ func SplitPolygonAtGrid(g *geos.Geos, geom *geos.Geom, gridWidth, currentGridWid
|
||||||
return nil, errors.New("couldn't create bounds polygon")
|
return nil, errors.New("couldn't create bounds polygon")
|
||||||
}
|
}
|
||||||
part := g.Intersection(geom, clipGeom)
|
part := g.Intersection(geom, clipGeom)
|
||||||
|
g.Destroy(clipGeom)
|
||||||
if part == nil {
|
if part == nil {
|
||||||
return nil, errors.New("couldn't create intersection")
|
return nil, errors.New("couldn't create intersection")
|
||||||
}
|
}
|
||||||
|
@ -96,6 +97,7 @@ func SplitPolygonAtGrid(g *geos.Geos, geom *geos.Geom, gridWidth, currentGridWid
|
||||||
result = append(result, part)
|
result = append(result, part)
|
||||||
} else {
|
} else {
|
||||||
moreParts, err := SplitPolygonAtGrid(g, part, gridWidth, currentGridWidth/2.0)
|
moreParts, err := SplitPolygonAtGrid(g, part, gridWidth, currentGridWidth/2.0)
|
||||||
|
g.Destroy(part)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue