geotools icon indicating copy to clipboard operation
geotools copied to clipboard

Replaced Vertex class by Edge

Open remi-san opened this issue 8 years ago • 2 comments

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).

remi-san avatar Mar 09 '16 19:03 remi-san

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.

codisart avatar Apr 08 '16 14:04 codisart

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.

remi-san avatar Apr 08 '16 15:04 remi-san