add method
Implementation
void add(Geometry g)
{
if (g.isEmpty()) return;
if (g is Polygon) addPolygon(g);
// LineString also handles LinearRings
else if (g is LineString) addLineString(g);
else if (g is Point) addPoint(g);
else if (g is MultiPoint) addCollection(g);
else if (g is MultiLineString) addCollection(g);
else if (g is MultiPolygon) addCollection(g);
else if (g is GeometryCollection) addCollection(g);
else throw new UnsupportedError(g.runtimeType.toString());
}