handle empty intersection results

master
Oliver Tonnhofer 2013-05-28 16:16:24 +02:00
parent 767fe37eb1
commit b5408e9376
1 changed files with 3 additions and 0 deletions

View File

@ -179,6 +179,9 @@ func (clipper *Clipper) Clip(geom *geos.Geom) ([]*geos.Geom, error) {
if g.PreparedIntersects(hit.Prepared, geom) {
hit.Unlock()
newPart := g.Intersection(hit.Geom, geom)
if newPart == nil {
continue
}
newParts := filterGeometryByType(g, newPart, geomType)
for _, p := range newParts {
intersections = append(intersections, p)