code: public static int vertex_count(Geometry geom) {
  		Geometry.Type gt = geom.getType();
  		if (Geometry.isMultiVertex(gt.value()))
  			return ((MultiVertexGeometry) geom).getPointCount();
  
  		if (geom.isEmpty())
  			return 0;
  
  		if (gt == Geometry.Type.Envelope)
  			return 4;
  
  		if (gt == Geometry.Type.Point)
  			return 1;
  
  		if (Geometry.isSegment(gt.value()))
  			return 2;
  
  		throw new GeometryException("missing type");
  	}
docs: Returns count of geometry vertices: 1 for Point, 4 for Envelope,
  get_point_count for MultiVertexGeometry types, 2 for segment types Returns 0
  if geometry is empty.
  @param geom The geometry to get the vertex count for.
  @return The vertex count.