Open-Source-Spatial-Clean-Cooking-Tool / OnStove

This repository contain the general code for the Open Source Spatial Clean Cooking Tool OnStove
MIT License
7 stars 8 forks source link

Add condition to avoid error in traveltime map when there are no forest #208

Closed camiloramirezgo closed 2 years ago

camiloramirezgo commented 2 years ago

This could be done potentially by adding a condition to the travel_time function the Layer class in layer.py: https://github.com/Open-Source-Spatial-Clean-Cooking-Tool/OnSSTOVE/blob/bb0eed312eb6fee5064e9fd81a1d9db5a7209d77/onsstove/layer.py#L66-L89

We could check if the self.start_points(condition=condition) do not return any points (when there are no forest) and make the distance raster values all np.nan and avoid calling the mcp.find_costs(starts=pointlist).