Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EqualsExact (non-spatial) method #46

Closed
peterstace opened this issue Aug 20, 2019 · 2 comments · Fixed by #50
Closed

EqualsExact (non-spatial) method #46

peterstace opened this issue Aug 20, 2019 · 2 comments · Fixed by #50
Assignees
Labels
algorithm These are the fun tickets :-) feature New feature or request

Comments

@peterstace
Copy link
Owner

Would be useful for the Geometry interface to have an Equals method that just checks if the representation is exactly the same (similar to behaviour of reflect deep equal).

It would essentially just check that the types are exactly the same, and then iterate over all coordinates comparing them.

@peterstace
Copy link
Owner Author

This is pretty similar to equalsExact from geos: http://geos.refractions.net/ro/doxygen_docs/html/classgeos_1_1geom_1_1Geometry.html#a48

Maybe we just want that instead...

@peterstace peterstace changed the title Equals (non-spatial) method EqualsExact (non-spatial) method Aug 20, 2019
@peterstace
Copy link
Owner Author

Would also be useful to ignore ordering differences during the comparison, e.g.:

  • Ignoring forwards/backwards order for LineStrings
  • Ignoring ring direction in Polygons
  • Ignoring order of holes in Polygons
  • Ignoring order of points in multipoints

Could use the "options" pattern in Go, i.e.

type interface Geometry {
    ...
    EqualsExact(other Geometry, opts ...EqualsExactOption)
    ....
}

The options could be:

func Tolerance(tol float64) EqualsExactOption {
    ...
}

var IgnoreOrder = EqualsExactOption(...)

@peterstace peterstace self-assigned this Aug 26, 2019
@peterstace peterstace added algorithm These are the fun tickets :-) feature New feature or request labels Aug 26, 2019
@peterstace peterstace mentioned this issue Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
algorithm These are the fun tickets :-) feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant