Optimal Spatiotemporal Management of Resources and Economic Activities Under Pollution Externalities