Deep learning and traditional machine learning algorithms have been widely applied to enhance the classification accuracy in remote sensing images. However, due to the variety and changeability of buildings, identifying building rooftops based on remote sensing images is still a challenge. Taking advantage of hyperspectral remote sensing imagery and spectroscopy, we propose a deep convolutional neural networks (CNN) approach with pure pixel index (PPI) constraints, named CNNP, to identify building rooftops materials. The framework, which accepts two kinds of data cubes as input data, extract spectral and spatial information by using 1D CNN and 3-D CNNs with different kernel size, respectively. After the feature extraction, aiming to identify different building materials, the output of the top layer is the input to a classifier in a ratio decided upon by the PPI of the central pixel. To verify the effectiveness, we use Hyperion and push-broom hyperspectral imager (PHI) data sets that represent high and low spatial resolution images to compare our proposed method with other traditional remote sensing image classification approaches, such as support vector machine; stacked auto-encoders; deep belief network; 1D CNN; and 2-D CNN; 3-D CNN; MiniGCN. The quantitative and qualitative results show that compared to otherrepresentative methods, CNNP achieves better performance, for both kinds of data, on Hyperion and PHI data sets with overall accuracy of 98.83% and 99.82%, respectively. And, the proposed method also provides an innovative idea for constructing other frameworks of hyperspectral image classification.