Inference and Prediction Problems for Spatial and Spatiotemporal Data