checkValid method

void checkValid(
  1. Geometry g
)

Implementation

void checkValid(Geometry g) {
  validErr = null;

  // empty geometries are always valid!
  if (g.isEmpty()) return;

  if (g is Point)
    checkValidP(g);
  else if (g is MultiPoint)
    checkValidMP(g);
  // LineString also handles LinearRings
  else if (g is LinearRing)
    checkValidLR(g);
  else if (g is LineString)
    checkValidL(g);
  else if (g is Polygon)
    checkValidPol(g);
  else if (g is MultiPolygon)
    checkValidMPol(g);
  else if (g is GeometryCollection)
    checkValidGC(g);
  else
    throw new UnsupportedError(g.runtimeType.toString());
}