Twice in the past 18 months, the secretive agency that analyzes U.S. satellite photographs and prepares military maps has been blamed for costly mishaps: a Marine jet's collision with an Italian ski lift in February 1998 and NATO's bombing of the Chinese Embassy in Yugoslavia this May.

Until those incidents, NIMA--the National Imagery and Mapping Agency, based in Bethesda--kept a very low profile. It was all but invisible in the alphabet soup of federal agencies, even though it has about 9,000 employees, a budget estimated at about $1 billion and a vital role in U.S. intelligence gathering.

Now, some critics question whether NIMA is competent. "The world today is a come-as-you-are fight, and NIMA is not ready," says Robert D. Steele, a former CIA case officer and Marine Corps intelligence official.

To defend itself, the three-year-old agency partially lifted its veil of secrecy, inviting a reporter to visit its headquarters, pore over its maps, and hear about its successes as well as failures in NATO's war on Yugoslavia.

Among the unheralded successes was the creation of computerized, three-dimensional imagery to guide the Army's AH-64A Apache helicopters along various routes through the mountains from Albania into Kosovo. But the Apaches never went into combat.

NIMA was created in 1996 by combining the Defense Mapping Agency--the Pentagon's mapmaking shop--and the CIA's satellite imagery analysis center, whose staff had years of experience in the arcane art of interpreting satellite photos. The theory was that merging these two disciplines would enable the new agency to produce high-tech "geospatial" products such as the 3-D Apache routes.

But the nation's newest intelligence agency was beset by problems from the outset. Many of the CIA's veteran photo analysts did not want to be merged into a mapping organization. They departed in droves. Intelligence officials also questioned whether a new agency was necessary to produce geospatial data.

Congress, after cutting the agency's budget for the first three years of its existence, is now moving to boost funding in fiscal 2000. Congressional staffers say that despite NIMA's lapses, the Hill is convinced that its director, Army Lt. Gen. James C. King, has laid out a coherent vision for moving the agency into the digital age.

NIMA does not dispute that it prepared the map used in the accidental bombing of the Chinese Embassy on May 7, which killed three Chinese citizens, wounded more than 20 others and severely strained U.S.-Chinese relations. And NIMA officials acknowledge that the map was flawed in one key respect: It did not show that the embassy had moved to a new location in Belgrade, the Yugoslav capital, in 1996.

But the agency maintains that the map was never intended for use in precision targeting.

The officials, who spoke on condition of anonymity, said the 1:10,000-scale battle map--on which 1 centimeter represents 100 meters of terrain--was designed to help in evacuating U.S. citizens and conducting "basic tactical operations," such as driving through streets in military vehicles.

"We're scrambling to take all of the data that we have and merge it together, because people are using our products in ways we never envisioned they would be used," one senior NIMA official said.

U.S. officials have told the Chinese government that the airstrike by an American B-2 bomber was aimed at a Yugoslav arms agency, the Federal Directorate of Supply and Procurement. According to the official U.S. explanation, CIA analysts who had the correct address of the arms agency, 2 Umetnosti Boulevard, made a mistake when they tried to determine which unnumbered building on NIMA's map corresponded to it.

Then the location was fed into computer databases for review. But the mistake was not caught because the databases, maintained by other U.S. intelligence agencies as well as by NIMA, still showed the Chinese Embassy at its old site in another section of Belgrade.

According to a senior NIMA official, the map of Belgrade was one of about 2,000 detailed maps of cities around the world that the agency maintains under a standing request from the Pentagon. But it is impossible to update all the maps continually.

"A hard-copy map is outdated before it is printed," said Gen. King, 53, who took NIMA's helm in March 1998 after serving as intelligence director for the Joint Chiefs of Staff.

Most of NIMA's city maps are replaced every six to 10 years. NIMA officials say the map of Belgrade, which was completed in 1997 and reviewed for sufficiency in 1998, was considered so new that neither the Pentagon nor the CIA asked NIMA to revise it when NATO began bombing Yugoslavia in March.

One congressional aide who monitors the U.S. intelligence community argues that NIMA is at fault for not keeping its database up to date. But the aide also acknowledges that NIMA's records are only as good as the information it can obtain. He noted that the State Department still provided the Chinese Embassy's old address when it gave NIMA a new listing of Chinese embassy addresses worldwide a month after the embassy bombing in Belgrade.

"It just proves--garbage in, garbage out," the staffer said.

NIMA's maps are assembled by analysts who are fluent in dozens of languages and use maps collected openly and surreptitiously around the world. One cavernous room inside NIMA headquarters is filled, floor to ceiling, with map cases; there are seven drawers of maps of Tehran alone.

But the first tourist map of Belgrade located by the CIA that correctly listed the embassy's new address was printed by a Belgrade firm in 1998. That map, officials noted, mislabeled the street on which the Chinese Embassy was located.

"It's tremendously complicated," one official said of the mapmaking process, "because you get conflicting information."

Although NIMA failed to update its Belgrade map at the start of the conflict, the agency was far from idle. With hundreds of analysts working round the clock, it churned out 30 new maps of other Yugoslav cities and towns as well as the computerized terrain models for the Apache helicopters.

NIMA was able to produce the 3-D imagery quickly because it had been working on a Pentagon project to chart low-level obstructions around the globe. That project, in turn, stemmed from the agency's previous source of embarrassment, the 1998 accident in which a U.S. EA-6B Prowler jet based in Aviano, Italy, struck a 370-foot-high gondola cable in the Alps, sending 20 skiers plunging to their deaths.

The Marine pilots blamed a NIMA aeronautical chart for not showing the cable. But the chart warned that not all vertical obstructions above 200 feet were depicted. It also said clearly that flying below 1,000 feet was prohibited in that area. For NIMA, says the congressional aide who monitors intelligence, "Aviano is clearly a bum rap."

After the Chinese Embassy bombing, Pentagon officials directed NIMA to draw up new maps identifying hundreds of "no strike" buildings such as embassies, churches, schools and hospitals across Yugoslavia. That caused NIMA cartographers to interview people with firsthand knowledge of various cities and to show them classified satellite photos, block by block, to determine each building's purpose.

"This is the first time we've ever had to do this," one NIMA official said. "To do this job properly requires all-source work--it requires human intelligence. You can't tell what goes on inside most buildings from imagery."

Right Coordinates, Wrong Building

An American bomber accidentally destroyed the Chinese Embassy on May 7, killing three and wounding more than 20. Here is the

map that was used and how the target was determined.

1. The arms agency and the Chinese Embassy were both shown as unidentified buildings 300 yards apart on the map.

2. An intelligence officer got the correct address of the Yugoslav arms procurement agency from the Internet because the agency was not located on the map at left.

3. The officer used the numbering of buildings on parallel streets to mistakenly identify the embassy as the arms agency.

4. He took the map to an expert in aerial photography who determined the coordinates of the targeted building.

5. The bombs accurately hit those coordinates.

6. A cross-check of various databases listing sensitive sites, such as schools, hospitals and embassies, failed to catch the error because the data had not been updated after the Chinese Embassy moved in 1996.

CAPTION: A Marine checks damage to U.S. Embassy in Beijing incurred when protesters attacked it three days after the Chinese Embassy was bombed in Belgrade.