go-spatial / geom

Geometry interfaces to help drive interoperability within the Go geospatial community
MIT License
168 stars 37 forks source link

Testing #1

Closed jyutzler closed 6 years ago

jyutzler commented 7 years ago

This PR now contains a complete implementation (structs and associated tests) for all of the interfaces in geom.go. Minor changes were made to the interfaces to improve clarity and consistency.

jyutzler commented 7 years ago

Comments fall into the following categories

In what is currently in master, there are no methods on Geometry. It is unclear to me how this is useful. We already know these things are geometry-related by virtue of being in the geom package. If a function takes a Geometry as an argument but you have to type switch everything anyway, you might as well pass interface{} as an argument. Instead, let's make our interfaces be useful, with useful methods drawn from Simple Features, the spec this is derived from. We're talking about a small number of methods with well-defined implementations. We've already spent more time discussing this than the total amount of time it will take to develop all of these methods for all implementations of the interfaces.

Let me put this another way. If you don't give me a way to implement BBox in a reasonable way, I will not use this API because it doesn't actually help me. A switch statement in a util function is not reasonable because that function must have intimate knowledge of every type of geometry type, including ones not written yet. To me, dragging your feet on this for the sake of interface purity is not constructive.