  In this paper we present an analysis of the physical and chemical conditions
of the planetary nebula NGC 40 through spatially-resolved spectroscopic maps.
We also introduce a new algorithm --2D_NEB-- based on the well-established IRAF
nebular package, which was developed to enable the use of the spectroscopic
maps to easily estimate the astrophysical quantities of ionised nebulae. The
2D_NEB was benchmarked, and we clearly show that it works properly, since it
compares nicely with the IRAF nebular software.
  Using this software, we derive the maps of several physical parameters of NGC
40. From these maps, we conclude that Te[NII] shows only a slight temperature
variation from region to region, with its values constrained between ~8,000 K
and ~9,500 K. Electron densities, on the other hand, have a much more prominent
spatial variation, as Ne[SII] values vary from ~1,000 cm^(-3) to ~3,000
cm^(-3). Maps of the chemical abundances also show significant variations. From
the big picture of our work, we strongly suggest that analysis with spatial
resolution be mandatory for more complete study of the physical and chemical
properties of planetary nebulae.
