There are three cases where you can publish[1] a photo without consent:
- Person of special public interest (literally: person of contemporary history, this is an idiomatic term and sounds less strange in German), which means you can take a picture of a politician holding a speech or an artist doing a public performance or a CEO addressing employees. Important exception for professionals, but there are various rules one needs to be aware of, for instance you probably cannot take a photo of the same CEO buying new shoes or eating dinner at a restaurant.
- The photograph does not primarily depict the person. Your landscape photo would be fine, for example, and your street scene may or may not be. Apparently the test criterion is: is the picture materially changed if the person is removed? So a photo of a beach landscape is permissible, but not so much if there's people bathing in the foreground.
- The photo is of a public gathering: a public concert, a political rally, though this only applies if it's a photo of the gathering as a whole, and not specifically an individual in it.
So, yes, in the end it is a bit of a case of "I can't define it, but I know it when I see it". In practice, you just err on the side of caution, and it works out fine. E.g. I don't really worry about if when I take a photo of a friend outside and there's a few people in the background (due to rule #2).
Source (German): https://www.medienrecht-urheberrecht.de/fotorecht-bildrecht/...
[1] I'm not sure how the law handles the case of merely taking a photo and never publishing it, nor what exactly constitutes publishing, e.g. presumably showing holiday snaps at a family gathering does not constitute publishing