Skip to content

Incorrect result for Union (and touch, most likely other operations as well) when creating donut polygon. #112

@ewsterrenburg

Description

@ewsterrenburg

image

polygon1, _ := geoencoding.Decode([]byte(`POLYGON((0 0,0 1,0 2,0 3,1 3,1 2,1 1,2 1,2 2,3 2,3 1,4 1,4 2,5 2,5 1,5 0,4 0,3 0,2 0,1 0,0 0))`), geoencoding.WKT)
polygon2, _ := geoencoding.Decode([]byte(`POLYGON((1 2,1 3,2 3,2 2,1 2))`), geoencoding.WKT)

strategy := planar.NormalStrategy()
i, e := strategy.Union(polygon1.Geom(), polygon2.Geom())
fmt.Println(i, e)

Provides both nil as result and nil as error, while the result should be the combined polygon (with a hole).

(unfortunately, my knowledge of Go is not sufficient to debug this myself and come up with a pull request).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions