How do you make a comic book superhero film set in New York? The answer is that you don't make it in New York. Instead, you shoot it in a green-screen studio in New Mexico
There are several reasons for doing this.
First, it's kind-of difficult to get the sort of shots you need with real people in a real city. But if you use a combination of live action and digitally-scanned actors, the creative options are almost limitless, as opposed to extremely limited.
And then there's the legal side of it. You have to get permission to do anything out of the ordinary in New York. Like flying a helicopter between buildings. You can't get permission for that at all, which, if the sight of helicopters and other flying objects whizzing round the corner of a block just above street-level is intrinsic to the plot, is a problem.
So, shooting in New Mexico in a green-screen soundstage within a virtual depiction of New York would be an easy choice if it weren't for the sheer difficulty of creating the world's most famous city from scratch, as a believable 3D model.
Here's what ILM said about this arduous and meticulous process:
Although roughly a third of "The Avengers" is set in New York City precious little was actually filmed there. ILM crew members photographed 7-miles of city streets from a variety of heights and at different times of day totaling 250,000 images. The crew then digitally recreated roughly 20 square blocks of mid-town Manhattan using a variety of techniques. Live action shoots were held primarily on sound stages in New Mexico and in the streets of Cleveland.
Here's a video showing how it was done: