addGeometry method

void addGeometry(
  1. Geometry g
)

Implementation

void addGeometry(Geometry g) {
  if (g.isEmpty()) return;

  // check if this Geometry should obey the Boundary Determination Rule
  // all collections except MultiPolygons obey the rule
  if (g is MultiPolygon) useBoundaryDeterminationRule = false;

  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());
}