geotools
geotools copied to clipboard
Replaced Vertex class by Edge
As told in issue #39, the chosen name was not the right one.
Here's the right one according to the chosen semantic field (vertices / edges).
I'm not sure that edge is the right term, it imples the object is only a part of a geometry rather a geometry type himself. I'd rather use Vector as the name of the class and edge in the usage of the Vector class inside the Polygon class.
Maybe not the right one, indeed, but far better than the misuse of vertex ;)
I'm not a big fan of edge
neither: it was just a way to stay in the same semantic field as vertex
.
The problem with vector is that it represents an origin (ok, we get from
), a direction, and a magnitude : we have a target point instead (::to()
), but the behavior of the vector is also present: ::destination()
If we want to stay in the semantic field of geometry, we should prefer the use of edge
(or segment
) as we want to represent a line between two points
who can be a part of a geometry (or not). If we want to represent a point, a direction an a magnitude, we should use vector
.
I'm not that sure we want it to be a geometry.
I think the real problem is to ask: how will we use this object? It has a lot of usages which are very distinct. We might want to split it in different classes.
Nonetheless, it's clearly not an edge
which is just a point of the boundary of a polygon.