We investigate the topological classification of the subgap bands induced in a two-dimensional superconductor by a densely packed chain of magnetic moments with ferromagnetic or spiral alignments. The wave functions for these bands are composites of Yu-Shiba-Rusinov-type states and magnetic scattering states and have a significant spatial extension away from the magnetic moments. We show that this spatial structure prohibits a straightforward extraction of a Hamiltonian useful for the topological classification. To address the latter correctly, we construct a family of spatially varying topological Hamiltonians for the subgap bands adapted for the broken translational symmetry caused by the chain. The spatial dependence in particular captures the transition to the topologically trivial bulk phase when moving away from the chain by showing how this, necessarily discontinuous, transition can be understood from an alignment of zeros with poles of Green's functions. Through the latter, the topological Hamiltonians reflect a characteristic found otherwise primarily in strongly interacting systems.