In this paper, we instantly infer the gas consumption and pollution emission of vehicles traveling on a city’s road network in current time slot, using GPS trajectories from a sample of vehicles (e.g., taxicabs). The knowledge cannot only be used to suggest cost-efficient driving routes but also identify the road segments where gas has been wasted significantly. In the meantime, the instant estimation of the pollution emission from vehicles can enable pollution alerts, and, in the long run, help diagnose the root cause of air pollution. In our method, we first compute the travel speed of each road segment using the GPS trajectories received recently. As many road segments are not traversed by trajectories (i.e., data sparsity), we propose a Travel Speed Estimation (TSE) model based on a context-aware matrix factorization approach. TSE leverages features learned from other data sources, e.g., map data and historical trajectories, to deal with the data sparsity problem. We then propose a Traffic Volume Inference (TVI) model to infer the number of vehicles passing each road segment per minute. TVI is an unsupervised Bayesian Network that incorporates multiple factors, such as the travel speed, weather conditions, and geographical features of a road. Given the travel speed and traffic volume of a road segment, the gas consumption and emission can be calculated based on existing environmental theories. We evaluated our method based on extensive experiments, using the GPS trajectories generated by over 32,000 taxis in Beijing over a period of two months. The results demonstrate the advantages of our method beyond baselines, validating the contribution of its components and finding interesting discoveries for social good.