Skip to content

Commit

Permalink
Also backpedal a bit on geometry change
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 14, 2024
1 parent 00c3d47 commit b85fa9c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions flow/model/qvalue/qvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,23 @@ func compareHstore(value1, value2 interface{}) bool {
}

func compareGeometry(value1, value2 interface{}) bool {
geo1 := value1.(*geom.Geom)

geo2, err := geom.NewGeomFromWKT(value2.(string))
if err != nil {
panic(err)
}

return geo1.Equals(geo2)
switch v1 := value1.(type) {
case *geom.Geom:
return v1.Equals(geo2)
case string:
geo1, err := geom.NewGeomFromWKT(v1)
if err != nil {
panic(err)
}
return geo1.Equals(geo2)
default:
panic(fmt.Sprintf("invalid geometry value type %T: %v", value1, value1))
}
}

func compareStruct(value1, value2 interface{}) bool {
Expand Down

0 comments on commit b85fa9c

Please sign in to comment.