  We provide conditions which guarantee that ergodic measures are dense in the
simplex of invariant probability measures of a dynamical system given by a
continuous map acting on a Polish space. Using them we study generic properties
of invariant measures and prove that every invariant measure has a generic
point. In the compact case, density of ergodic measures means that the simplex
of invariant measures is either a singleton of a measure concentrated on a
single periodic orbit or the Poulsen simplex. Our properties focus on the set
of periodic points and we introduce two concepts: close\-ability with respect
to a set of periodic points and linkability of a set of periodic points.
Examples are provided to show that these are independent properties. They hold,
for example, for systems having the periodic specification property. But they
hold also for a much wider class of systems which contains, for example,
irreducible Markov chains over a countable alphabet, all $\beta$-shifts, all
$S$-gap shifts, ${C}^1$-generic diffeomorphisms of a compact manifold $M$, and
certain geodesic flows of a complete connected negatively curved manifold.
