TITLE: Abstract definition of convex set
QUESTION [39 upvotes]: I'd like to formulate an abstract definition of convex sets: a set $K$ is convex if it is endowed with a ternary operation $K\times[0,1]\times K\to K$, written $(x:t:y)$, satisfying axioms

$(x:0:y)=(x:t:x)=x$
$(x:t:y)=(y:1-t:x)$
$(x:t:(y:\frac ut:z))=((x:\frac{t-u}{1-u}:y):u:z)$

The axioms imply that, for every $x_1,\dots,x_n\in K$ and $t_i\ge0$ with $\sum t_i=1$ the convex combination $\sum t_i x_i\in K$ is well defined.
Examples are the usual convex subsets of real vector spaces, with $(x:t:y)=(1-t)x+ty$, but also trees with $(x:t:y)$ the unique point at ratio $t$ on the geodesic from $x$ to $y$, and more generally $\mathbb R$-trees (geodesic metric spaces in which all triangles are isometric to tripods).
I'm sure this has already been explored, and I'd rather not reinvent the wheel (and I possibly missed some useful axioms), but I couldn't find any reference to such notions.
Natural questions that come to mind are:

define an affine map between convex sets $K,L$ as a map $f\colon K\to L$ with $f(x:t:y)=(f(x):t:f(y))$. Topologize then convex sets by making all affine maps to $\mathbb R$ continuous. What can be said of these topological spaces?
can every convex set be represented in a vector space? I have in mind the map $K\to\ell^1(K)/\{\delta_{(x:t:y)}=(1-t)\delta_x+t\delta_y\forall x,t,y\}$, though the topologies will probably not match (and I'm not sure I want to close the space I quotient $\ell^1$ by).

Thanks to all! Any kinds of references or comments are welcome.

REPLY [5 votes]: A good (but probably not up to date) reference on several abstractions of the notion of convexity is

Singer, Ivan. Abstract convex analysis. Vol. 20. John Wiley & Sons, 1997.

There you'll find notions like "order convexity" in posets, "metric convexity" for metric spaces, abstract convex combinations, but also notions based on approximation from the outside or based on abstraction of the "convex hull" operation. I am not sure if something along th lines of your ideas is in there, but it is a good read anyway.