We study a two-tiered wireless sensor network consisting of N access points (APs) and M base stations (BSs). The sensing data, which is distributed on the sensing field according to a density function f, is first transmitted to the APs and then forwarded to the BSs. Our goal is to find an optimal deployment of APs and BSs to minimize the average weighted total, or Lagrangian, of sensor and AP powers. For one base station, M = 1, we show that the optimal deployment of APs is simply a linear transformation of the optimal N-level quantizer for density f, and the sole BS should be located at the geometric centroid of the sensing field. We also define the AP-Sensor power function as the minimum AP power for a given sensor power constraint. We provide the exact expression of the AP-Sensor power function and prove that, like a rate-distortion function, it is a convex function. For more than one base station, M>1, we provide a necessary condition for the optimal deployment.